Skip to content

Commit d92d07d

Browse files
committed
pbio/drv/bluetooth_btstack: Fix reference to peripheral.
This must go before the switch.
1 parent 5af8ccb commit d92d07d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pbio/drv/bluetooth/bluetooth_btstack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,10 @@ pbio_error_t pbdrv_bluetooth_peripheral_write_characteristic_func(pbio_os_state_
815815

816816
pbio_error_t pbdrv_bluetooth_peripheral_disconnect_func(pbio_os_state_t *state, void *context) {
817817

818+
pbdrv_bluetooth_peripheral_t *peri = &peripheral_singleton;
819+
818820
PBIO_OS_ASYNC_BEGIN(state);
819821

820-
pbdrv_bluetooth_peripheral_t *peri = &peripheral_singleton;
821822
if (peri->con_handle != HCI_CON_HANDLE_INVALID) {
822823
gap_disconnect(peri->con_handle);
823824
}

0 commit comments

Comments
 (0)