@@ -84,7 +84,8 @@ class LVSS : public CANDevice {
8484 };
8585 };
8686
87- union switchData {
87+ /* * Struct to hold the data for individual boards */
88+ union switchData_u {
8889 uint16_t battCurrent;
8990 uint16_t hibCurrent;
9091 uint16_t tmsCurrent;
@@ -97,18 +98,10 @@ class LVSS : public CANDevice {
9798 int16_t switch2Temp;
9899 };
99100
100- union switchFaults {
101- uint16_t switchFaultVal;
102- struct {
103- uint16_t currentFault : 1 ;
104- uint16_t temperatureFault : 1 ;
105- };
106- };
107-
108101 /* * FSM State declaration */
109102 enum class State {
110103 INITIALIZATION = 0u ,
111- IDLE = 1u ,
104+ RUNNING = 1u ,
112105 };
113106
114107 /* *
@@ -140,9 +133,8 @@ class LVSS : public CANDevice {
140133
141134 ACS71240 acs71240;
142135
143- switchData PowerSwitchState;
144-
145- switchFaults SwitchFaults;
136+ /* * Holds data for individual boards */
137+ switchData_u PowerSwitchState;
146138
147139 /* * Tracks signal from VCU */
148140 uint16_t VCUBoardSig = 0 ;
@@ -151,7 +143,7 @@ class LVSS : public CANDevice {
151143 uint16_t battPackCurrent = 0x00 ;
152144
153145 /* * Tracks power switch fault */
154- uint16_t switchFaultstatus = 0x00 ;
146+ uint16_t switchFaultStatus = 0x00 ;
155147
156148 /* *
157149 * The current state of the LVSS
@@ -177,7 +169,7 @@ class LVSS : public CANDevice {
177169 /* *
178170 * Checks LVSS values
179171 *
180- * State: State::IDLE
172+ * State: State::RUNNING
181173 */
182174 void runningState ();
183175
@@ -241,7 +233,7 @@ class LVSS : public CANDevice {
241233 /* * Transfer data */
242234 DATA_LINK_START_KEY_21XX (0x00 , 0x02 ),
243235 DATA_LINK_21XX (0x00 , 0x01 , CO_TUNSIGNED16 , &battPackCurrent),
244- DATA_LINK_21XX (0x00 , 0x02 , CO_TUNSIGNED16 , &switchFaultstatus ),
236+ DATA_LINK_21XX (0x00 , 0x02 , CO_TUNSIGNED16 , &switchFaultStatus ),
245237
246238 DATA_LINK_START_KEY_21XX (0x01 , 0x04 ),
247239 DATA_LINK_21XX (0x01 , 0x01 , CO_TUNSIGNED16 , &PowerSwitchState.battCurrent ),
0 commit comments