@@ -27,22 +27,31 @@ Burnwire ::~Burnwire() {}
2727// Handler implementations for typed input ports
2828// ----------------------------------------------------------------------
2929void Burnwire ::burnStart_handler (FwIndexType portNum) {
30+ this ->startBurn ();
31+ }
32+
33+ void Burnwire ::burnStop_handler (FwIndexType portNum) {
34+ this ->stopBurn ();
35+ }
36+
37+ // void Burnwire ::stop_handler(FwIndexType portNum) {
38+ // //TODO
39+ // }
40+
41+ void Burnwire::startBurn () {
3042 this ->m_safetyCounter = 0 ;
3143 this ->m_state = Fw::On::ON;
3244 this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::ON);
45+ this ->log_ACTIVITY_HI_SafetyTimerSet (this ->m_safetyMaxCount );
3346}
3447
35- void Burnwire ::burnStop_handler (FwIndexType portNum ) {
48+ void Burnwire::stopBurn ( ) {
3649 this ->m_state = Fw::On::OFF;
3750 this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::OFF);
3851 this ->gpioSet_out (0 , Fw::Logic::LOW);
3952 this ->gpioSet_out (1 , Fw::Logic::LOW);
4053}
4154
42- // void Burnwire ::stop_handler(FwIndexType portNum) {
43- // //TODO
44- // }
45-
4655void Burnwire ::schedIn_handler (FwIndexType portNum, U32 context) {
4756 if (this ->m_state == Fw::On::ON) {
4857 this ->m_safetyCounter ++;
@@ -69,20 +78,14 @@ void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
6978// ----------------------------------------------------------------------
7079
7180void Burnwire ::START_BURNWIRE_cmdHandler (FwOpcodeType opCode, U32 cmdSeq, U32 max_duration) {
72- this ->m_safetyCounter = 0 ;
7381 this ->m_safetyMaxCount = max_duration;
74- this ->m_state = Fw::On::ON;
75- this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::ON);
76- this ->log_ACTIVITY_HI_SafetyTimerSet (max_duration);
82+ this ->startBurn ();
7783 this ->cmdResponse_out (opCode, cmdSeq, Fw::CmdResponse::OK);
7884}
7985
8086void Burnwire ::STOP_BURNWIRE_cmdHandler (FwOpcodeType opCode, U32 cmdSeq) {
81- this ->m_state = Fw::On::OFF;
82- this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::OFF);
87+ this ->stopBurn ();
8388 this ->cmdResponse_out (opCode, cmdSeq, Fw::CmdResponse::OK);
84- this ->gpioSet_out (0 , Fw::Logic::LOW);
85- this ->gpioSet_out (1 , Fw::Logic::LOW);
8689}
8790
8891void Burnwire ::parameterUpdated (FwPrmIdType id) {
0 commit comments