EIVE System #376
@ -457,22 +457,7 @@ void PCDUHandler::checkAndUpdatePduSwitch(GOMSPACE::Pdu pdu, pcdu::Switches swit
|
|||||||
uint8_t setValue) {
|
uint8_t setValue) {
|
||||||
using namespace pcdu;
|
using namespace pcdu;
|
||||||
if (switchStates[switchIdx] != setValue) {
|
if (switchStates[switchIdx] != setValue) {
|
||||||
#if OBSW_INITIALIZE_SWITCHES == 1
|
|
||||||
// This code initializes the switches to the default init switch states on every reboot.
|
|
||||||
// This is not done by the PCDU unless it is power-cycled.
|
|
||||||
if (((pdu == GOMSPACE::Pdu::PDU1) and firstSwitchInfoPdu1) or
|
|
||||||
((pdu == GOMSPACE::Pdu::PDU2) and firstSwitchInfoPdu2)) {
|
|
||||||
ReturnValue_t state = PowerSwitchIF::SWITCH_OFF;
|
|
||||||
if (INIT_SWITCH_STATES[switchIdx] == ON) {
|
|
||||||
state = PowerSwitchIF::SWITCH_ON;
|
|
||||||
}
|
|
||||||
sendSwitchCommand(switchIdx, state);
|
|
||||||
} else {
|
|
||||||
triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx);
|
triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
switchStates[switchIdx] = setValue;
|
switchStates[switchIdx] = setValue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user