|
|
@ -40,10 +40,10 @@ |
|
|
|
|
|
|
|
// For channel scanner
|
|
|
|
#define MAX_CHANNELS 125
|
|
|
|
#define MAX_SAMPLES 100
|
|
|
|
#define MAX_SAMPLES 30
|
|
|
|
|
|
|
|
int channel_loads[MAX_CHANNELS]; // Channel 0 ~ Channel 124
|
|
|
|
uint64_t pipeIn = 0xE8E8F0F0E1LL; // TODO: set it to EEPROM
|
|
|
|
uint64_t pipeIn = 0xE8E8F0F0E1LL; // TODO: set it to EEPROM
|
|
|
|
RF24 radio(NRF24_CE, NRF24_CSN); // Starting up the module on GPIO5 (CE), GPIO4 (CSN)
|
|
|
|
bool nrf_enable = false; |
|
|
|
bool nrf_scanner = false; |
|
|
@ -731,6 +731,10 @@ void IRAM_ATTR onTimer(){ |
|
|
|
uptime++; |
|
|
|
packet_sent = packet_sent_count; |
|
|
|
packet_sent_count = 0; |
|
|
|
ble_profiling = ble_profiling_raw; |
|
|
|
ble_profiling_raw = 0; |
|
|
|
nrf_profiling = nrf_profiling_raw; |
|
|
|
nrf_profiling_raw = 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1207,20 +1211,17 @@ void loop() { |
|
|
|
|
|
|
|
// Each seconds tick
|
|
|
|
if(millis() > last_seconds) { |
|
|
|
/*
|
|
|
|
ble_profiling = ble_profiling_raw; |
|
|
|
ble_profiling_raw = 0; |
|
|
|
|
|
|
|
nrf_profiling = nrf_profiling_raw; |
|
|
|
nrf_profiling_raw = 0; |
|
|
|
|
|
|
|
/*
|
|
|
|
Serial.print(F("NRF:")); |
|
|
|
Serial.println(nrf_profiling); |
|
|
|
*/ |
|
|
|
|
|
|
|
last_seconds = millis() + 1000; |
|
|
|
|
|
|
|
|
|
|
|
// For maximize the RF
|
|
|
|
/*
|
|
|
|
if(delay_maxrf) { |
|
|
@ -1250,6 +1251,8 @@ void loop() { |
|
|
|
webserver_setup = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
last_seconds = millis() + 1000; |
|
|
|
} |
|
|
|
|
|
|
|
read_all_voltage(); |
|
|
@ -1301,6 +1304,7 @@ void loop() { |
|
|
|
} |
|
|
|
|
|
|
|
void update_display(void) { |
|
|
|
update_delay = 10; |
|
|
|
if(millis() > last_update) { |
|
|
|
// Determine stick position
|
|
|
|
if(millis() > last_menu_stick_read) { |
|
|
@ -1342,6 +1346,7 @@ void update_display(void) { |
|
|
|
) { |
|
|
|
// Must be out of the menu...
|
|
|
|
update_delay = 10; |
|
|
|
nrf_scanner = false; |
|
|
|
|
|
|
|
// Determine the menu position
|
|
|
|
if(stick_navigation_position == MENU_RIGHT) { |
|
|
@ -2866,6 +2871,9 @@ void rx_binding(void) { |
|
|
|
} |
|
|
|
|
|
|
|
void rf_scanners(void) { |
|
|
|
// Trying to allocate all to this loop
|
|
|
|
update_delay = 1; |
|
|
|
|
|
|
|
int y = 0; |
|
|
|
static char buf[10]; |
|
|
|
static int result_x = 0; |
|
|
|