Kind of working hw sync

This commit is contained in:
Mike Davis
2016-12-15 21:56:49 +02:00
parent 976c99c1ad
commit 25929965f5

View File

@ -50,6 +50,8 @@ static volatile transceiver_mode_t _transceiver_mode = TRANSCEIVER_MODE_OFF;
void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) { void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
baseband_streaming_disable(&sgpio_config); baseband_streaming_disable(&sgpio_config);
disable_sync
usb_endpoint_disable(&usb_endpoint_bulk_in); usb_endpoint_disable(&usb_endpoint_bulk_in);
usb_endpoint_disable(&usb_endpoint_bulk_out); usb_endpoint_disable(&usb_endpoint_bulk_out);
@ -76,6 +78,9 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
if( _transceiver_mode != TRANSCEIVER_MODE_OFF ) { if( _transceiver_mode != TRANSCEIVER_MODE_OFF ) {
si5351c_activate_best_clock_source(&clock_gen); si5351c_activate_best_clock_source(&clock_gen);
wait_for_sync
baseband_streaming_enable(&sgpio_config); baseband_streaming_enable(&sgpio_config);
} }
} }
@ -261,11 +266,13 @@ int main(void) {
cpld_update(); cpld_update();
// if(!synced) {
if(hw_sync_ready()) { if(hw_sync_ready()) {
synced = true; synced = true;
hw_sync_ack(); hw_sync_ack();
led_on(LED3); led_on(LED3);
} }
// }
//int gpio_sync_in_flag = gpio_get(gpio_sync_in); //int gpio_sync_in_flag = gpio_get(gpio_sync_in);