Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -ref6d5a5ca314cbe30131156824e9d32792402fc4 -rff5d79f69db29d73a440d0ca8e6854b5837205d3 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision ef6d5a5ca314cbe30131156824e9d32792402fc4) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision ff5d79f69db29d73a440d0ca8e6854b5837205d3) @@ -120,8 +120,19 @@ // If the debounce time has been elapsed, update the switch status to the new status else if ( TRUE == didTimeout( switchesStatus[ i ].debounceStartTime, SWITCHES_DEBOUNCE_TIME_MS ) ) { - switchesStatus[ i ].debounceStartTime = 0; + + if (FRONT_DOOR == i) + { + // Log front door switch change + sendTreatmentLogEventData( FRONT_DOOR_SWITCH_CHANGED_EVENT, (F32)switchesStatus[ i ].status.data, (F32)currentSwitchStatus ); + } + else if (PUMP_TRACK_SWITCH == i) + { + // Log pump track switch change + sendTreatmentLogEventData( PUMP_TRACK_SWITCH_CHANGED_EVENT, (F32)switchesStatus[ i ].status.data, (F32)currentSwitchStatus ); + } // If the bit is 0, the door switch is open, because it is normally open switch + switchesStatus[ i ].debounceStartTime = 0; switchesStatus[ i ].status.data = currentSwitchStatus; } }