diff --git a/supervisor/shared/bluetooth/bluetooth.c b/supervisor/shared/bluetooth/bluetooth.c index 877fbc6ef262d..48b186bbdf12d 100644 --- a/supervisor/shared/bluetooth/bluetooth.c +++ b/supervisor/shared/bluetooth/bluetooth.c @@ -212,11 +212,11 @@ void supervisor_bluetooth_init(void) { boot_in_discovery_mode = true; reset_state = 0x0; } + bool bonded = common_hal_bleio_adapter_is_bonded_to_central(&common_hal_bleio_adapter_obj); #if !CIRCUITPY_USB_DEVICE // Boot into discovery if USB isn't available and we aren't bonded already. // Checking here allows us to have the status LED solidly on even if no button was // pressed. - bool bonded = common_hal_bleio_adapter_is_bonded_to_central(&common_hal_bleio_adapter_obj); bool wifi_workflow_active = false; #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI && CIRCUITPY_OS_GETENV char _api_password[64]; @@ -255,6 +255,11 @@ void supervisor_bluetooth_init(void) { if (boot_in_discovery_mode) { common_hal_bleio_adapter_erase_bonding(&common_hal_bleio_adapter_obj); } + if (boot_in_discovery_mode || bonded) { + workflow_state = WORKFLOW_ENABLED; + } else { + workflow_state = WORKFLOW_DISABLED; + } #if CIRCUITPY_STATUS_LED new_status_color(BLACK); status_led_deinit(); @@ -358,7 +363,7 @@ void supervisor_bluetooth_disable_workflow(void) { bool supervisor_bluetooth_workflow_is_enabled(void) { #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE - if (workflow_state == 1) { + if (workflow_state == WORKFLOW_ENABLED) { return true; } #endif diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 152e67b27b1e6..13f896c45bc3a 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -83,7 +83,6 @@ void supervisor_workflow_start(void) { #if CIRCUITPY_BLEIO bleio_reset(); - supervisor_bluetooth_enable_workflow(); supervisor_start_bluetooth(); #endif