diff --git a/firmware/hackrf_usb/usb_api_transceiver.c b/firmware/hackrf_usb/usb_api_transceiver.c index c3584219..624fd4aa 100644 --- a/firmware/hackrf_usb/usb_api_transceiver.c +++ b/firmware/hackrf_usb/usb_api_transceiver.c @@ -269,7 +269,12 @@ void transceiver_shutdown(void) led_off(LED2); led_off(LED3); rf_path_set_direction(&rf_path, RF_PATH_DIRECTION_OFF); - m0_state.mode = M0_MODE_RX; + m0_state.mode = M0_MODE_IDLE; + // The M0 may already be waiting for the next SGPIO + // exchange interrupt. In order to ensure that the M0 + // switches over to its idle loop, we need to set the + // SGPIO exchange interrupt flag here. + SGPIO_SET_STATUS_1 = (1 << SGPIO_SLICE_A); } void transceiver_startup(const transceiver_mode_t mode) {