Index: App/Contollers/Buttons.c =================================================================== diff -u -r9aec79f151c686b730888c98f70f53ad958fe9b5 -rc91e9da338d92432930d3589a4055ebbb404c6cb --- App/Contollers/Buttons.c (.../Buttons.c) (revision 9aec79f151c686b730888c98f70f53ad958fe9b5) +++ App/Contollers/Buttons.c (.../Buttons.c) (revision c91e9da338d92432930d3589a4055ebbb404c6cb) @@ -177,21 +177,30 @@ /************************************************************************* * @brief userConfirmOffButton * The userConfirmOffButton function handles user confirmation of the off \n - * button. The off request will be initiated here. + * button. The off request will be initiated here if confirmed or cancelled \n + * if rejected by user. * @details - * Inputs : stopButtonState, prevStopButtonState + * Inputs : current operation mode * Outputs : stopButtonPressPending - * @param none + * @param response : 1 = confirmed, 0 = rejected * @return none *************************************************************************/ -void userConfirmOffButton( void ) +void userConfirmOffButton( U08 response ) { - if ( TRUE == isCurrentOpModeOkToTurnOff() ) + // did user confirm? + if ( 1 == response ) { - offButtonPressPending = TRUE; - offRequestPulseCount = OFF_REQUEST_PULSE_COUNT; - offRequestPulseTimer = 0; + if ( TRUE == isCurrentOpModeOkToTurnOff() ) + { + offButtonPressPending = TRUE; + offRequestPulseCount = OFF_REQUEST_PULSE_COUNT; + offRequestPulseTimer = 0; + } } + else // user did not confirm + { + // for now, don't need to do anything to reject off button press + } } /************************************************************************* @@ -290,7 +299,7 @@ { // TODO - send off button to UI for user confirmation // TODO - remove later (just pretend user confirmed for now) - userConfirmOffButton(); + userConfirmOffButton(1); } } prevOffButtonState = offButtonState;