Index: firmware/App/Controllers/Buttons.c =================================================================== diff -u -rc67def50892f9a7c2f1f22985b5351465a8f6773 -ra2bc96881a5fc3d8f779246b2abebf15a8de9384 --- firmware/App/Controllers/Buttons.c (.../Buttons.c) (revision c67def50892f9a7c2f1f22985b5351465a8f6773) +++ firmware/App/Controllers/Buttons.c (.../Buttons.c) (revision a2bc96881a5fc3d8f779246b2abebf15a8de9384) @@ -138,14 +138,14 @@ PIN_SIGNAL_STATE_T off = getCPLDOffButton(); PIN_SIGNAL_STATE_T stop = getCPLDStopButton(); - // set current button states read from CPLD + // Set current button states read from CPLD dataOffButtonState.data = ( off == PIN_SIGNAL_HIGH ? BUTTON_STATE_PRESSED : BUTTON_STATE_RELEASED ); dataStopButtonState.data = ( stop == PIN_SIGNAL_HIGH ? BUTTON_STATE_PRESSED : BUTTON_STATE_RELEASED ); - // handle button state transitions for stop button + // Handle button state transitions for stop button handleStopButtonProcessing(); - // handle button state transitions for off button + // Handle button state transitions for off button handleOffButtonProcessing(); } @@ -225,7 +225,7 @@ case BUTTON_SELF_TEST_STATE_START: buttonSelfTestState = BUTTON_SELF_TEST_STATE_IN_PROGRESS; buttonSelfTestTimerCount = getMSTimerCount(); - // no break here so we pass through directly to in progress processing + // No break here so we pass through directly to in progress processing case BUTTON_SELF_TEST_STATE_IN_PROGRESS: if ( ( dataOffButtonState.data == BUTTON_STATE_RELEASED ) && ( dataStopButtonState.data == BUTTON_STATE_RELEASED ) ) @@ -241,11 +241,11 @@ buttonSelfTestState = BUTTON_SELF_TEST_STATE_COMPLETE; result = SELF_TEST_STATUS_FAILED; } - // else just stay in progress and wait for next call + // Else just stay in progress and wait for next call break; case BUTTON_SELF_TEST_STATE_COMPLETE: - // if we get called in this state, assume we're doing self-test again + // If we get called in this state, assume we are doing self-test again buttonSelfTestState = BUTTON_SELF_TEST_STATE_START; break; @@ -273,7 +273,7 @@ switch ( response ) { case OFF_BUTTON_RSP_USER_REQUESTS_POWER_OFF: - // if we're in a mode that allows power off, set off pending flag and request user confirmation + // If we are in a mode that allows power off, set off pending flag and request user confirmation if ( TRUE == isCurrentOpModeOkToTurnOff() ) { offRequestAwaitingUserConfirmation = TRUE; @@ -283,18 +283,18 @@ #endif } else - { // send rejection response to power off request + { // Send rejection response to power off request sendOffButtonMsgToUI( OFF_BUTTON_CMD_REJECT_USER_OFF_REQUEST ); } break; case OFF_BUTTON_RSP_USER_CONFIRMS_POWER_OFF: - // is an off request pending user confirmation? + // Is an off request pending user confirmation? if ( TRUE == offRequestAwaitingUserConfirmation ) { - // reset off request pending flag + // Reset off request pending flag offRequestAwaitingUserConfirmation = FALSE; - // if we're in a mode that allows power off, initiate power off sequence + // If we are in a mode that allows power off, initiate power off sequence if ( TRUE == isCurrentOpModeOkToTurnOff() ) { broadcastPowerOffWarning(); @@ -315,18 +315,18 @@ break; case OFF_BUTTON_RSP_USER_REJECTS_POWER_OFF: - // is an off request pending user confirmation? + // Is an off request pending user confirmation? if ( TRUE == offRequestAwaitingUserConfirmation ) { - // reset off request pending flag + // Reset off request pending flag offRequestAwaitingUserConfirmation = FALSE; } break; default: - // ok - do nothing + // Ok - do nothing break; - } // end switch + } // End switch } /*********************************************************************//** @@ -360,12 +360,12 @@ *************************************************************************/ static void handleOffButtonProcessing( void ) { - // handle button state transitions for off button + // Handle button state transitions for off button if ( getOffButtonState() != prevOffButtonState ) { if ( getOffButtonState() == BUTTON_STATE_PRESSED ) { - // if off request in a valid mode, send to UI for user confirmation + // If off request in a valid mode, send to UI for user confirmation userConfirmOffButton( OFF_BUTTON_RSP_USER_REQUESTS_POWER_OFF ); #ifdef SIMULATE_UI userConfirmOffButton( OFF_BUTTON_RSP_USER_CONFIRMS_POWER_OFF ); @@ -374,7 +374,7 @@ prevOffButtonState = getOffButtonState(); } - // if off request has not been confirmed by user before it expires, cancel it + // If off request has not been confirmed by user before it expires, cancel it if ( TRUE == offRequestAwaitingUserConfirmation ) { offRequestPendingTimer += TASK_PRIORITY_INTERVAL; @@ -385,14 +385,14 @@ } } - // if user confirmed off button press, manage off request sequence + // If user confirmed off button press, manage off request sequence if ( TRUE == offButtonPressPending ) { - // delay power off to provide sub-systems time to prepare for shutdown + // Delay power off to provide sub-systems time to prepare for shutdown offRequestDelayTimer += TASK_PRIORITY_INTERVAL; if ( offRequestDelayTimer >= OFF_REQUEST_DELAY_TIME_MS ) { - // power off sequence is 4 50 ms toggles of the off request output signal + // Power off sequence is 4 50 ms toggles of the off request output signal offRequestPulseTimer += TASK_PRIORITY_INTERVAL; if ( offRequestPulseTimer >= OFF_REQUEST_PULSE_INTVL_MS ) { @@ -418,7 +418,7 @@ *************************************************************************/ static void handleStopButtonProcessing( void ) { - // handle button state transitions for stop button + // Handle button state transitions for stop button if ( getStopButtonState() != prevStopButtonState ) { if ( getStopButtonState() == BUTTON_STATE_PRESSED ) @@ -429,10 +429,10 @@ prevStopButtonState = getStopButtonState(); } - // handle when a stop button press is pending + // Handle when a stop button press is pending if ( TRUE == stopButtonPressPending ) { - // if stop button not consumed within a reasonable time, s/w fault + // If stop button not consumed within a reasonable time, s/w fault if ( TRUE == didTimeout( stopButtonPendingTimer, STOP_BUTTON_PENDING_TIMEOUT_MS ) ) { stopButtonPressPending = FALSE;