senddata restructured
This commit is contained in:
parent
bb3f06bfc4
commit
2821bc60f3
@ -47,8 +47,8 @@ build_flags =
|
||||
; otherwise device may crash in dense environments due to serial buffer overflow
|
||||
;
|
||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
|
||||
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
|
||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
|
||||
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
|
||||
;
|
||||
; override lora settings from LMiC library in lmic/config.h and use main.h instead
|
||||
|
@ -38,8 +38,7 @@ extern uint64_t uptimecounter;
|
||||
extern int countermode, screensaver, adrmode, lorasf, txpower, rlim;
|
||||
extern uint16_t macs_total, macs_wifi, macs_ble; // MAC counters
|
||||
extern std::set<uint16_t> macs;
|
||||
extern hw_timer_t
|
||||
*channelSwitch; // hardware timer used for wifi channel switching
|
||||
extern hw_timer_t *channelSwitch, *sendCycle;
|
||||
|
||||
#ifdef HAS_GPS
|
||||
extern gpsStatus_t gps_status; // struct for storing gps data
|
||||
|
@ -107,16 +107,18 @@ void set_rssi(uint8_t val) {
|
||||
|
||||
void set_sendcycle(uint8_t val) {
|
||||
cfg.sendcycle = val;
|
||||
// update send cycle interrupt
|
||||
timerAlarmWrite(sendCycle, cfg.sendcycle * 2 * 10000, true);
|
||||
// reload interrupt after each trigger of channel switch cycle
|
||||
ESP_LOGI(TAG, "Remote command: set payload send cycle to %d seconds",
|
||||
cfg.sendcycle * 2);
|
||||
};
|
||||
|
||||
void set_wifichancycle(uint8_t val) {
|
||||
cfg.wifichancycle = val;
|
||||
// modify wifi channel rotation IRQ
|
||||
timerAlarmWrite(
|
||||
channelSwitch, cfg.wifichancycle * 10000,
|
||||
true); // reload interrupt after each trigger of channel switch cycle
|
||||
// update channel rotation interrupt
|
||||
timerAlarmWrite(channelSwitch, cfg.wifichancycle * 10000, true);
|
||||
|
||||
ESP_LOGI(TAG,
|
||||
"Remote command: set Wifi channel switch interval to %.1f seconds",
|
||||
cfg.wifichancycle / float(100));
|
||||
|
Loading…
Reference in New Issue
Block a user