Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r69b93e39861c5493d273f25d9e43cacd0b5819e2 -rce596a29a2bd6384d70b2fe7b9c332b0f1f37a84 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 69b93e39861c5493d273f25d9e43cacd0b5819e2) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision ce596a29a2bd6384d70b2fe7b9c332b0f1f37a84) @@ -27,7 +27,7 @@ static U32 switchesDataPublicationCounter; ///< Switches data publication counter. static OVERRIDE_U32_T switchesDataPublishInterval = { SWITCHES_DATA_PUB_INTERVAL, SWITCHES_DATA_PUB_INTERVAL, 0, 0 }; ///< Interval (in ms) at which to publish switches data to CAN bus. -static SWITCH_STATUS_T switchesStatus[ NUM_OF_DOORS_AND_SWITCHES ]; ///< Switches status array. +static SWITCH_STATUS_T switchesStatus[ NUM_OF_DOORS_AND_SWITCHES ]; ///< Switches status array. // ********** private function prototypes ********** @@ -101,7 +101,9 @@ else if ( TRUE == didTimeout( switchesStatus[ i ].debounceStartTime, SWITCHES_DEBOUNCE_TIME_MS ) ) { switchesStatus[ i ].debounceStartTime = 0; - switchesStatus[ i ].status.data = currentSwitchStatus; + // If the bit is 0, the door switch is open, because it is normally open switch + // TODO investigate the polarity of the pump track switch once it tied to the cartridge latch + switchesStatus[ i ].status.data = ( 0 == currentSwitchStatus ? STATE_OPEN : STATE_CLOSED ); } } else