Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions firmware/hackrf_usb/usb_api_transceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,16 @@ void transceiver_startup(const transceiver_mode_t mode)

transceiver_dma_setup();

/*
* Settle on a clock source before tuning. If CLKIN was in use but the
* external clock has since disappeared, this falls back to the XTAL
* and waits out the Si5351C PLL reset. Doing this first means the
* RFFC5071/MAX283x tuning below (via radio_switch_opmode) always
* happens against a stable, already-selected reference instead of
* racing a clock-source glitch triggered after tuning is committed.
*/
activate_best_clock_source();

radio_switch_opmode(&radio, mode);

switch (mode) {
Expand All @@ -394,8 +404,6 @@ void transceiver_startup(const transceiver_mode_t mode)
default:
break;
}

activate_best_clock_source();
}

usb_request_status_t usb_vendor_request_set_transceiver_mode(
Expand Down
Loading