aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.c
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2019-02-07 17:59:02 +0200
committerAvi Levkovich <avi@twine-s.com>2019-02-07 17:59:02 +0200
commit5a3c7560c32ad3346fa2648466e9791c8bebf2aa (patch)
treec6b1cfa0c7a02db2bb459b5250157c3388d09878 /Software/Embedded_SW/Embedded/Modules/Control/control.c
parentf9a198d8c975cbead14f4c4bf09970b71128dc41 (diff)
downloadTango-5a3c7560c32ad3346fa2648466e9791c8bebf2aa.tar.gz
Tango-5a3c7560c32ad3346fa2648466e9791c8bebf2aa.zip
update the logic of Machine Leds (using PWM)
and few changes in the buttons logic
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index 0cda9b5a6..100fefbd8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -51,6 +51,7 @@
#include <inc/hw_ints.h>
#include "drivers/adc_sampling/adc.h"
+#include "Modules/General/buttons.h"
#include "control.h"
#include "MillisecTask.h"
@@ -157,10 +158,20 @@ void ControlStop(void)
uint32_t ControlActivityLed( uint32_t Parameter1)
{
static bool flag = false;
+ static uint8_t counter;
+ const uint8_t Blink_Freq = 15;//odd number
+
if (flag==true)
{
COMM_RED_LED_ON;
ACTIVITY_RED_LED_OFF; // Heaters indication - all the Heaters OFF
+ if(power.color == fastBILNK)
+ Pannel_Leds(POWER_ON_OFF,MODE_OFF);
+
+ if((power.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(POWER_ON_OFF,MODE_OFF);
+ }
flag = false;
}
else
@@ -168,8 +179,22 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
COMM_RED_LED_OFF;
if (HeaterActive > 0)// Blink the led on heating
ACTIVITY_RED_LED_ON;// Heaters indication - at least one of the Heaters is ON
+
+ if(power.color == fastBILNK)
+ Pannel_Leds(POWER_ON_OFF,MODE_ON);
+
+ if((power.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(POWER_ON_OFF,MODE_ON);
+ }
+
flag = true;
}
+
+ if (counter < 0xFF)
+ counter++;
+ else
+ counter = Blink_Freq + 1;
return OK;
}
uint32_t ControlEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue)