WIP scanning
This commit is contained in:
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include <streaming.h>
|
#include <streaming.h>
|
||||||
|
|
||||||
|
#include "tuning.h"
|
||||||
|
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "usb_standard_request.h"
|
#include "usb_standard_request.h"
|
||||||
|
|
||||||
@ -239,6 +241,13 @@ int main(void) {
|
|||||||
rf_path_init(&rf_path);
|
rf_path_init(&rf_path);
|
||||||
|
|
||||||
unsigned int phase = 0;
|
unsigned int phase = 0;
|
||||||
|
|
||||||
|
unsigned int blocks_queued = 0;
|
||||||
|
const uint64_t scan_freq_min = 100000000;
|
||||||
|
const uint64_t scan_freq_max = 6000000000;
|
||||||
|
const uint64_t scan_freq_step = 20000000;
|
||||||
|
uint64_t scan_freq = scan_freq_min;
|
||||||
|
set_freq(scan_freq);
|
||||||
while(true) {
|
while(true) {
|
||||||
// Check whether we need to initiate a CPLD update
|
// Check whether we need to initiate a CPLD update
|
||||||
if (start_cpld_update)
|
if (start_cpld_update)
|
||||||
@ -248,6 +257,7 @@ int main(void) {
|
|||||||
if ( usb_bulk_buffer_offset >= 16384
|
if ( usb_bulk_buffer_offset >= 16384
|
||||||
&& phase == 1
|
&& phase == 1
|
||||||
&& transceiver_mode() != TRANSCEIVER_MODE_OFF) {
|
&& transceiver_mode() != TRANSCEIVER_MODE_OFF) {
|
||||||
|
if (blocks_queued == 2)
|
||||||
usb_transfer_schedule_block(
|
usb_transfer_schedule_block(
|
||||||
(transceiver_mode() == TRANSCEIVER_MODE_RX)
|
(transceiver_mode() == TRANSCEIVER_MODE_RX)
|
||||||
? &usb_endpoint_bulk_in : &usb_endpoint_bulk_out,
|
? &usb_endpoint_bulk_in : &usb_endpoint_bulk_out,
|
||||||
@ -256,12 +266,14 @@ int main(void) {
|
|||||||
NULL, NULL
|
NULL, NULL
|
||||||
);
|
);
|
||||||
phase = 0;
|
phase = 0;
|
||||||
|
blocks_queued++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up IN transfer of buffer 1.
|
// Set up IN transfer of buffer 1.
|
||||||
if ( usb_bulk_buffer_offset < 16384
|
if ( usb_bulk_buffer_offset < 16384
|
||||||
&& phase == 0
|
&& phase == 0
|
||||||
&& transceiver_mode() != TRANSCEIVER_MODE_OFF) {
|
&& transceiver_mode() != TRANSCEIVER_MODE_OFF) {
|
||||||
|
if (blocks_queued == 2)
|
||||||
usb_transfer_schedule_block(
|
usb_transfer_schedule_block(
|
||||||
(transceiver_mode() == TRANSCEIVER_MODE_RX)
|
(transceiver_mode() == TRANSCEIVER_MODE_RX)
|
||||||
? &usb_endpoint_bulk_in : &usb_endpoint_bulk_out,
|
? &usb_endpoint_bulk_in : &usb_endpoint_bulk_out,
|
||||||
@ -270,6 +282,16 @@ int main(void) {
|
|||||||
NULL, NULL
|
NULL, NULL
|
||||||
);
|
);
|
||||||
phase = 1;
|
phase = 1;
|
||||||
|
blocks_queued++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (blocks_queued > 2) {
|
||||||
|
scan_freq += scan_freq_step;
|
||||||
|
if (scan_freq > scan_freq_max) {
|
||||||
|
scan_freq = scan_freq_min;
|
||||||
|
}
|
||||||
|
set_freq(scan_freq);
|
||||||
|
blocks_queued = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user