Fix scanner telemetry

This commit is contained in:
Goebish 2019-09-14 14:12:23 +02:00
parent d7ef15d435
commit 31d88d6f37

View File

@ -99,13 +99,15 @@ uint16_t Scanner_callback()
switch (phase) switch (phase)
{ {
case SCAN_CHANNEL_CHANGE: case SCAN_CHANNEL_CHANGE:
rf_ch_num++; if(telemetry_link == 0) {
if (rf_ch_num >= (SCAN_MAX_RADIOCHANNEL + 1)) rf_ch_num++;
rf_ch_num = 0; if (rf_ch_num >= (SCAN_MAX_RADIOCHANNEL + 1))
if (scan_tlm_index++ == 0) rf_ch_num = 0;
pkt[0] = rf_ch_num; // start channel for telemetry packet if (scan_tlm_index++ == 0)
Scanner_scan_next(); pkt[0] = rf_ch_num; // start channel for telemetry packet
phase = SCAN_GET_RSSI; Scanner_scan_next();
phase = SCAN_GET_RSSI;
}
return SCAN_CHANNEL_LOCK_TIME; return SCAN_CHANNEL_LOCK_TIME;
case SCAN_GET_RSSI: case SCAN_GET_RSSI:
phase = SCAN_CHANNEL_CHANGE; phase = SCAN_CHANNEL_CHANGE;
@ -124,6 +126,7 @@ uint16_t initScanner(void)
{ {
rf_ch_num = SCAN_MAX_RADIOCHANNEL; rf_ch_num = SCAN_MAX_RADIOCHANNEL;
scan_tlm_index = 0; scan_tlm_index = 0;
telemetry_link = 0;
phase = SCAN_CHANNEL_CHANGE; phase = SCAN_CHANNEL_CHANGE;
Scanner_cc2500_init(); Scanner_cc2500_init();
CC2500_Strobe(CC2500_SRX); CC2500_Strobe(CC2500_SRX);