Clean up SGPIO vector assignment code.
This commit is contained in:
@ -188,23 +188,21 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
|
|||||||
gpio_set(PORT_LED1_3, PIN_LED2);
|
gpio_set(PORT_LED1_3, PIN_LED2);
|
||||||
usb_endpoint_init(&usb_endpoint_bulk_in);
|
usb_endpoint_init(&usb_endpoint_bulk_in);
|
||||||
rf_path_set_direction(RF_PATH_DIRECTION_RX);
|
rf_path_set_direction(RF_PATH_DIRECTION_RX);
|
||||||
|
vector_table.irq[NVIC_SGPIO_IRQ] = sgpio_isr_rx;
|
||||||
} else if (transceiver_mode == TRANSCEIVER_MODE_TX) {
|
} else if (transceiver_mode == TRANSCEIVER_MODE_TX) {
|
||||||
gpio_clear(PORT_LED1_3, PIN_LED2);
|
gpio_clear(PORT_LED1_3, PIN_LED2);
|
||||||
gpio_set(PORT_LED1_3, PIN_LED3);
|
gpio_set(PORT_LED1_3, PIN_LED3);
|
||||||
usb_endpoint_init(&usb_endpoint_bulk_out);
|
usb_endpoint_init(&usb_endpoint_bulk_out);
|
||||||
rf_path_set_direction(RF_PATH_DIRECTION_TX);
|
rf_path_set_direction(RF_PATH_DIRECTION_TX);
|
||||||
|
vector_table.irq[NVIC_SGPIO_IRQ] = sgpio_isr_tx;
|
||||||
} else {
|
} else {
|
||||||
gpio_clear(PORT_LED1_3, PIN_LED2);
|
gpio_clear(PORT_LED1_3, PIN_LED2);
|
||||||
gpio_clear(PORT_LED1_3, PIN_LED3);
|
gpio_clear(PORT_LED1_3, PIN_LED3);
|
||||||
rf_path_set_direction(RF_PATH_DIRECTION_OFF);
|
rf_path_set_direction(RF_PATH_DIRECTION_OFF);
|
||||||
|
vector_table.irq[NVIC_SGPIO_IRQ] = sgpio_isr_rx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( transceiver_mode != TRANSCEIVER_MODE_OFF ) {
|
if( transceiver_mode != TRANSCEIVER_MODE_OFF ) {
|
||||||
vector_table_entry_t sgpio_isr_fn = sgpio_isr_rx;
|
|
||||||
if( transceiver_mode == TRANSCEIVER_MODE_TX ) {
|
|
||||||
sgpio_isr_fn = sgpio_isr_tx;
|
|
||||||
}
|
|
||||||
vector_table.irq[NVIC_SGPIO_IRQ] = sgpio_isr_fn;
|
|
||||||
baseband_streaming_enable();
|
baseband_streaming_enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user