File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,6 @@ static pbio_error_t run_ui(pbio_os_state_t *state, pbio_os_timer_t *timer) {
194194
195195 // Stop advertising if we are still doing so.
196196 if (pbsys_status_test (PBIO_PYBRICKS_STATUS_BLE_ADVERTISING )) {
197- pbsys_status_clear (PBIO_PYBRICKS_STATUS_BLE_ADVERTISING );
198197 DEBUG_PRINT ("Stop advertising on HMI exit.\n" );
199198 pbdrv_bluetooth_start_advertising (false);
200199 PBIO_OS_AWAIT (state , & sub , pbdrv_bluetooth_await_advertise_or_scan_command (& sub , NULL ));
@@ -210,6 +209,11 @@ static pbio_error_t run_ui(pbio_os_state_t *state, pbio_os_timer_t *timer) {
210209 pbdrv_button_get_pressed ();
211210 }));
212211
212+ // We have already stopped advertising above, but it is nicer to keep the
213+ // visual active until you release the button. Otherwise, it appears as if
214+ // the hub is already off when you are shutting down.
215+ pbsys_status_clear (PBIO_PYBRICKS_STATUS_BLE_ADVERTISING );
216+
213217 // Start run animations
214218 pbsys_hub_light_matrix_handle_user_program_start ();
215219 #if PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS
You can’t perform that action at this time.
0 commit comments