@@ -176,24 +176,17 @@ void handle_reset_button()
176
176
reset_pressed = 0 ;
177
177
power_led_sleep_state_on = PWR_LED_SLEEP_STATE_DEFAULT ;
178
178
179
- if (gpio_reset_count <= RESET_SHORT_PRESS ) {
180
- main_shutdown_state = MAIN_LED_BLINK_ONCE ;
181
- }
182
- else if (gpio_reset_count < RESET_MID_PRESS ) {
179
+ if (gpio_reset_count < RESET_SHORT_PRESS ) {
183
180
// Indicate button has been released to stop to cancel the shutdown
184
181
main_shutdown_state = MAIN_LED_BLINK_ONCE ;
185
182
}
186
- else if (gpio_reset_count >= RESET_MID_PRESS ) {
183
+ else if (gpio_reset_count >= RESET_SHORT_PRESS ) {
187
184
// Indicate the button has been released when shutdown is requested
188
185
main_shutdown_state = MAIN_USER_EVENT ;
189
186
}
190
187
} else if (reset_pressed && gpio_get_reset_btn_fwrd ()) {
191
188
// Reset button is still pressed
192
- if (gpio_reset_count <= RESET_SHORT_PRESS ) {
193
- // Enter the shutdown pending state to begin LED dimming
194
- main_shutdown_state = MAIN_SHUTDOWN_PENDING ;
195
- }
196
- else if (gpio_reset_count < RESET_MID_PRESS ) {
189
+ if (gpio_reset_count < RESET_SHORT_PRESS ) {
197
190
// Enter the shutdown pending state to begin LED dimming
198
191
main_shutdown_state = MAIN_SHUTDOWN_PENDING ;
199
192
}
@@ -253,7 +246,7 @@ void board_30ms_hook()
253
246
break ;
254
247
case MAIN_SHUTDOWN_PENDING :
255
248
// Fade the PWM until the board is about to be shut down
256
- shutdown_led_dc = PWR_LED_INIT_FADE_BRIGHTNESS - gpio_reset_count * (PWR_LED_INIT_FADE_BRIGHTNESS - PWR_LED_FADEOUT_MIN_BRIGHTNESS )/(RESET_MID_PRESS );
249
+ shutdown_led_dc = PWR_LED_INIT_FADE_BRIGHTNESS - gpio_reset_count * (PWR_LED_INIT_FADE_BRIGHTNESS - PWR_LED_FADEOUT_MIN_BRIGHTNESS )/(RESET_SHORT_PRESS );
257
250
break ;
258
251
case MAIN_SHUTDOWN_REACHED :
259
252
// Hold LED in min brightness
0 commit comments