Oops! Forgot to change MAX2837 mode from RX to TX when transceiver mode is changed.

Initialize MAX5864 earlier, in "transceiver" mode (where both ADC and DAC are active), and then shift SSP1 into MAX2837 mode and leave it there, for faster tuning and RX/TX switching.
This commit is contained in:
Jared Boone
2012-10-17 15:59:47 -07:00
parent 6babcbe579
commit d4da08a3d7

View File

@ -178,9 +178,13 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
if( transceiver_mode == TRANSCEIVER_MODE_RX ) { if( transceiver_mode == TRANSCEIVER_MODE_RX ) {
gpio_clear(PORT_LED1_3, PIN_LED3); gpio_clear(PORT_LED1_3, PIN_LED3);
usb_endpoint_init(&usb_endpoint_bulk_in); usb_endpoint_init(&usb_endpoint_bulk_in);
max2837_rx();
} else { } else {
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);
max2837_tx();
} }
sgpio_configure(transceiver_mode, true); sgpio_configure(transceiver_mode, true);
@ -443,6 +447,9 @@ int main(void) {
usb_run(&usb_device); usb_run(&usb_device);
ssp1_init(); ssp1_init();
ssp1_set_mode_max5864();
max5864_xcvr();
ssp1_set_mode_max2837(); ssp1_set_mode_max2837();
max2837_setup(); max2837_setup();
@ -456,8 +463,6 @@ int main(void) {
max2837_set_frequency(freq); max2837_set_frequency(freq);
max2837_start(); max2837_start();
max2837_rx(); max2837_rx();
ssp1_set_mode_max5864();
max5864_xcvr();
while(true) { while(true) {
// Wait until buffer 0 is transmitted/received. // Wait until buffer 0 is transmitted/received.