@@ -12,19 +12,31 @@ namespace Components {
1212// Component construction and destruction
1313// ----------------------------------------------------------------------
1414
15- Burnwire ::Burnwire (const char * const compName) : BurnwireComponentBase(compName) {}
15+ Burnwire ::Burnwire (const char * const compName) : BurnwireComponentBase(compName) {
16+ this ->m_safetyCounter = 0 ;
17+ this ->m_state = Fw::On::OFF;
18+ Fw::ParamValid valid;
19+ this ->m_safetyMaxCount = this ->paramGet_SAFETY_TIMER (valid);
20+ this ->log_ACTIVITY_HI_SafetyTimerSet (this ->m_safetyMaxCount );
21+ this ->log_ACTIVITY_HI_SafetyTimerSet (m_safetyMaxCount);
22+ }
1623
1724Burnwire ::~Burnwire () {}
1825
1926// ----------------------------------------------------------------------
2027// Handler implementations for typed input ports
2128// ----------------------------------------------------------------------
2229void Burnwire ::burnStart_handler (FwIndexType portNum) {
23- // TODO
30+ this ->m_safetyCounter = 0 ;
31+ this ->m_state = Fw::On::ON;
32+ this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::ON);
2433}
2534
2635void Burnwire ::burnStop_handler (FwIndexType portNum) {
27- // TODO
36+ this ->m_state = Fw::On::OFF;
37+ this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::OFF);
38+ this ->gpioSet_out (0 , Fw::Logic::LOW);
39+ this ->gpioSet_out (1 , Fw::Logic::LOW);
2840}
2941
3042// void Burnwire ::stop_handler(FwIndexType portNum) {
@@ -40,7 +52,7 @@ void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
4052 this ->log_ACTIVITY_HI_SafetyTimerStatus (Fw::On::ON);
4153 }
4254
43- if (this ->m_safetyCounter >= m_safetyMaxCount) {
55+ if (this ->m_safetyCounter >= this -> m_safetyMaxCount ) {
4456 // 30 seconds reached → turn OFF
4557 this ->gpioSet_out (0 , Fw::Logic::LOW);
4658 this ->gpioSet_out (1 , Fw::Logic::LOW);
@@ -56,14 +68,12 @@ void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
5668// Handler implementations for commands
5769// ----------------------------------------------------------------------
5870
59- void Burnwire ::START_BURNWIRE_cmdHandler (FwOpcodeType opCode, U32 cmdSeq) {
60- // reset count to 0
71+ void Burnwire ::START_BURNWIRE_cmdHandler (FwOpcodeType opCode, U32 cmdSeq, U32 max_duration) {
6172 this ->m_safetyCounter = 0 ;
62- // update private member variable
73+ this -> m_safetyMaxCount = max_duration;
6374 this ->m_state = Fw::On::ON;
64- // send event
6575 this ->log_ACTIVITY_HI_SetBurnwireState (Fw::On::ON);
66- // confirm response
76+ this -> log_ACTIVITY_HI_SafetyTimerSet (max_duration);
6777 this ->cmdResponse_out (opCode, cmdSeq, Fw::CmdResponse::OK);
6878}
6979
@@ -75,4 +85,13 @@ void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
7585 this ->gpioSet_out (1 , Fw::Logic::LOW);
7686}
7787
88+ void Burnwire ::parameterUpdated (FwPrmIdType id) {
89+ if (id == this ->PARAMID_SAFETY_TIMER ) {
90+ Fw::ParamValid valid;
91+ this ->m_safetyMaxCount = this ->paramGet_SAFETY_TIMER (valid);
92+ this ->log_ACTIVITY_HI_SafetyTimerSet (this ->m_safetyMaxCount );
93+ }
94+ this ->log_ACTIVITY_HI_SafetyTimerSet (m_safetyMaxCount);
95+ }
96+
7897} // namespace Components
0 commit comments