@@ -20,8 +20,27 @@ Burnwire ::~Burnwire() {}
2020// Handler implementations for typed input ports
2121// ----------------------------------------------------------------------
2222
23- void Burnwire ::stop_handler (FwIndexType portNum) {
24- // TODO
23+ // void Burnwire ::stop_handler(FwIndexType portNum) {
24+ // //TODO
25+ // }
26+
27+ void Burnwire ::schedIn_handler (FwIndexType portNum, U32 context) {
28+ if (this ->m_state == Fw::On::ON) {
29+ this ->m_safetyCounter ++;
30+ if (this ->m_safetyCounter == 1 ) {
31+ this ->log_ACTIVITY_HI_SafetyTimerStatus (Fw::On::ON);
32+ }
33+
34+ if (this ->m_safetyCounter >= m_safetyMaxCount) {
35+ // 30 seconds reached → turn OFF
36+ this ->gpioSet_out (0 , Fw::Logic::LOW);
37+ this ->gpioSet_out (1 , Fw::Logic::LOW);
38+
39+ this ->m_state = Fw::On::OFF;
40+ this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::OFF);
41+ this ->log_ACTIVITY_HI_SafetyTimerStatus (Fw::On::OFF);
42+ }
43+ }
2544}
2645
2746// ----------------------------------------------------------------------
@@ -36,6 +55,9 @@ void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
3655 // confirm response
3756 this ->cmdResponse_out (opCode, cmdSeq, Fw::CmdResponse::OK);
3857
58+ // reset count to 0
59+ this ->m_safetyCounter = 0 ;
60+
3961 this ->gpioSet_out (0 , Fw::Logic::HIGH);
4062 this ->gpioSet_out (1 , Fw::Logic::HIGH);
4163}
0 commit comments