diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-07 18:00:49 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-07 18:00:49 +0200 |
| commit | 85be4860a445cd2cb5dcc01a582fbea5fe21c200 (patch) | |
| tree | 91fc526021912d78d37a22273e71e50fcddc5c3f /Software/Embedded_SW/Embedded/Modules/Control/control.c | |
| parent | 340de72c8da0c0a5a661664f7fa26f756e43a15a (diff) | |
| parent | 5a3c7560c32ad3346fa2648466e9791c8bebf2aa (diff) | |
| download | Tango-85be4860a445cd2cb5dcc01a582fbea5fe21c200.tar.gz Tango-85be4860a445cd2cb5dcc01a582fbea5fe21c200.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 8349e7f91..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) @@ -208,8 +233,8 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF uint32_t device_i; uint32_t deviceId = 0xFF; - if (CtrlFrequency == eOneMillisecond) - { + //if (CtrlFrequency == eOneMillisecond) + //{ for(device_i = 0;device_i < MAX_TANGO_CONTROL_DEVICES;device_i++) { if (ControlArray[device_i].ControlActive == false) @@ -218,8 +243,8 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF break; } } - if ((deviceId!=0xFF )&&(deviceId> MaxHighDevices)) - MaxHighDevices = deviceId; + /* if ((deviceId!=0xFF )&&(deviceId> MaxHighDevices)) + // MaxHighDevices = deviceId; } else { @@ -231,7 +256,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF break; } } - } + }*/ if (deviceId == 0xFF) { @@ -348,7 +373,8 @@ uint32_t ControlLoop(uint32_t tick) Tick998 = (tick%eOneSecond == 996) ?true:false; */ //ROM_IntMasterDisable(); - for (ControlDevice_i = 0; ControlDevice_i < MaxHighDevices;ControlDevice_i++) + //for (ControlDevice_i = 0; ControlDevice_i < MaxHighDevices;ControlDevice_i++) + for (ControlDevice_i = 0; ControlDevice_i < MAX_TANGO_CONTROL_DEVICES;ControlDevice_i++) { if (ControlArray[ControlDevice_i].ControlActive) { |
