aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-03-19 17:13:05 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-03-19 17:13:05 +0200
commit1cc50551034a4fbb5e00a9224dfd2a78d4ca9728 (patch)
tree97d95ce915f3b42f7e6676c9750898f8657a1da4 /Software/Embedded_SW
parent42ce5a31ab95f5de94c46b106268e042cc81e6d6 (diff)
downloadTango-1cc50551034a4fbb5e00a9224dfd2a78d4ca9728.tar.gz
Tango-1cc50551034a4fbb5e00a9224dfd2a78d4ca9728.zip
randomness test
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index ddcba57bc..d8a96a4d9 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -418,6 +418,7 @@ void ScrewsStartControlTimer (void)
return;
}
+int random = 0;
void ScrewTimerInterrupt(int ARG0)
{
ROM_TimerIntClear(Screw_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt
@@ -427,7 +428,7 @@ void ScrewTimerInterrupt(int ARG0)
{
ROM_TimerLoadSet(Screw_timerBase, TIMER_A,(int)ScrewRunningTime);
MotorSetDirection (HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewCurrentDirection);
- MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
+ MotorSetSpeedDirect(HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed+random);
ScrewChangeCounter = 0;
ScrewChangeLimit = ScrewRunningTime/12000000;
ScrewDirectionChangeCounter++;
@@ -437,6 +438,9 @@ void ScrewTimerInterrupt(int ARG0)
TimerDisable(Screw_timerBase, TIMER_A);
}
ROM_IntMasterEnable();
+ random++;
+ if (random >= 2)
+ random = -1;
//Report("ScrewTimerInterrupt dir, duration, speed", __FILE__,ScrewCurrentDirection,ScrewRunningTime, RpMessage, ScrewSpeed, 0);
//
// Enable all interrupts.