Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions supervisor/shared/bluetooth/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion supervisor/shared/workflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ void supervisor_workflow_start(void) {

#if CIRCUITPY_BLEIO
bleio_reset();
supervisor_bluetooth_enable_workflow();
supervisor_start_bluetooth();
#endif

Expand Down