diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-04 10:54:18 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-04-04 10:54:18 +0300 |
| commit | 30ebe0cb5b35ddbb7ce61b9e845c935e3fd8667a (patch) | |
| tree | 8ddedd2ac34da99a3d8f986f4d4ee2c0c19c6b2f /Software/Embedded_SW | |
| parent | 5fbbb670dba573001f3e8054c78f3cd853585d44 (diff) | |
| download | Tango-30ebe0cb5b35ddbb7ce61b9e845c935e3fd8667a.tar.gz Tango-30ebe0cb5b35ddbb7ce61b9e845c935e3fd8667a.zip | |
stop power down, idle leds.
Diffstat (limited to 'Software/Embedded_SW')
3 files changed, 23 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c index 48da24487..7d42ad8f5 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c @@ -21,6 +21,8 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/Valves/Valve.h" +#include "Modules/General/buttons.h" + #include "heaters/heaters_ex.h" #define DEFAULT_IDLE_TIME_LIMIT 3600 @@ -73,6 +75,7 @@ uint32_t PowerIdleCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) { Report("PowerIdle Idle activated ",__FILE__,__LINE__,(int)powerIdleSecondsLimit,RpWarning,(int)powerIdleSecondsCounter,0); powerIdleState = true; + SetPowerMachineState(sttIDLE); //move to idle state PowerIdleSetIdle(); } @@ -100,6 +103,7 @@ void PowerIdleOutOfIdleState(void) if (powerIdleState == true) { powerIdleState = false; + SetPowerMachineState(sttON); if (HandleProcessParameters(&ActiveProcessParameters)!= OK) { LOG_ERROR (1, "Turn Heaters active failed"); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index f0cf641ae..dcb91ea55 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -74,6 +74,14 @@ uint32_t PowerOffInit(void) return OK; } /*******************************************************************************************************/ +uint32_t PowerOffCancel(void) +{ + if (PowerOffMachineState >= POWER_OFF_HEAD_CLEAN) + PowerOffMachineState = POWER_OFF_CANCELLED; + return OK; +} + +/*******************************************************************************************************/ uint32_t PowerOffHeadClean(void) { //TBD @@ -318,6 +326,15 @@ uint32_t PowerOffSequenceStateMachine( POWER_OFF_STAGES_ENUM ReadValue) case POWER_OFF_POWER_OFF: status = PowerOffPowerOff(); break; + case POWER_OFF_ERROR: + case POWER_OFF_CANCELLED: + RemoveControlCallback( PowerOffControlId,PowerOffScheduler); + PowerOffControlId = 0xFF; + RemoveControlCallback(WaitForProcessControlId, PowerOffWaitForProcessesCallback); + RemoveControlCallback(WaitForProcessControlId, PowerOffWaitForTemperatureCallback); + WaitForProcessControlId = 0xFF; + LOG_ERROR(ReadValue,"POWER OFF Cancelled"); + break; default: LOG_ERROR(ReadValue,"ERROR IN POWER OFF STATE MACHINE"); break; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h index fa1e123bd..af4d4230d 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h @@ -24,11 +24,13 @@ POWER_OFF_TURN_OFF_BLOWER, POWER_OFF_POWER_OFF, POWER_OFF_ERROR, + POWER_OFF_CANCELLED, POWER_OFF_MAX, }POWER_OFF_STAGES_ENUM; uint32_t PowerOffInit(void); +uint32_t PowerOffCancel(void);//POWER_OFF_CANCELLED #endif /* STATEMACHINES_INITIALIZATION_POWEROFFSEQUENCE_H_ */ |
