From 1cc50551034a4fbb5e00a9224dfd2a78d4ca9728 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 19 Mar 2019 17:13:05 +0200 Subject: randomness test --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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. -- cgit v1.3.1 From 69a41da59eb41a681e644505d5e7814c2c4f6973 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 19 Mar 2019 18:11:46 +0200 Subject: VOC Gas sensor polling --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 8 +++++++- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 8e4a36e62..88877f113 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -85,7 +85,7 @@ uint32_t Dancer_Data[NUM_OF_DANCERS] = {0}; float Speed_Data = 0; uint32_t DrawerFansStatus = 0; uint32_t SystemFansStatus = 0; - +uint8_t Gas_PPM = 0; bool watchdogCriticalAlarm = false; @@ -514,6 +514,7 @@ uint32_t MillisecLowLoop(uint32_t tick) { Read_Heaters_Current(Heater_i); } + Gas_PPM = Calculate_Gas_Power_Consumption(); } if (OneMinute_Tick) { @@ -621,6 +622,11 @@ uint32_t getDrawerFansStatus(void) { return DrawerFansStatus; } +uint8_t getGasReading(void) +{ + return Gas_PPM; +} + uint32_t getSystemFansStatus(void) { return SystemFansStatus; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h index 7e2af1079..064302685 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h @@ -32,6 +32,7 @@ uint32_t getADCData(int DeviceId); float getSensorSpeedData(void); uint32_t getDrawerFansStatus(void); uint32_t getSystemFansStatus(void); +uint8_t getGasReading(void); void MillisecInit(void); void MillisecStop(void); -- cgit v1.3.1