Skip to content

Commit 08471fa

Browse files
committed
api/bluetooth: only cancel workflow when using BLE
The host can read the response if called via USB, so we don't need to cancel in that case.
1 parent 9bd222b commit 08471fa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/rust/bitbox02-rust/src/hww/api/bluetooth.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,12 @@ async fn process_upgrade(
164164
if response.is_ok() {
165165
hal.ui().status("Upgrade\nsuccessful", true).await;
166166
bitbox02::reset_ble();
167-
// Since the Bluetooth host will not be there anymore to read this response, this task will
168-
// not be cleared by the executor. We do it manually to make space for the next task upon
169-
// reconnection.
170-
crate::async_usb::cancel();
167+
if bitbox02::communication_mode_ble_enabled() {
168+
// Since the Bluetooth host will not be there anymore to read this response, this task
169+
// will not be cleared by the executor. We do it manually to make space for the next
170+
// task upon reconnection.
171+
crate::async_usb::cancel();
172+
}
171173
} else {
172174
hal.ui().status("Upgrade failed", false).await;
173175
}

0 commit comments

Comments
 (0)