Set M0 mode to IDLE when transceiver mode is OFF.
At this point, streaming has been stopped, so there will be no further SGPIO interrupts. However, the M0 will still be spinning on the interrupt flag, waiting to proceed. To ensure that the M0 actually reaches its idle loop, we set the SGPIO interrupt flag once. The M0 will then finish spinning on the flag, clear the flag, see the new mode setting, and jump to the idle loop.
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user