libpax integration 6 (trigger sendcycle)

This commit is contained in:
cyberman54 committed 2021-04-01 12:17:46 +02:00
1 parent 9335161676
commit 0b271f95b3
8 files changed
+17 -17

No files matched your search

+3 -2
View File
@@ -12,10 +12,11 @@ void process_count(void) {
count_from_libpax.wifi_count, count_from_libpax.ble_count);
libpax_macs_ble = count_from_libpax.ble_count;
libpax_macs_wifi = count_from_libpax.wifi_count;
setSendIRQ();
}
void init_libpax() {
libpax_counter_init(process_count, &count_from_libpax, SENDCYCLE * 2 * 1000,
void init_libpax(void) {
libpax_counter_init(process_count, &count_from_libpax, cfg.sendcycle * 2 * 1000,
1);
libpax_counter_start();
}
+6 -7
View File
@@ -65,11 +65,11 @@ MatrixDisplayIRQ-> esp32 timer 3
ButtonIRQ -> external GPIO
PMUIRQ -> PMU chip GPIO
fired by software (Ticker.h)
TIMESYNC_IRQ -> setTimeSyncIRQ()
CYCLIC_IRQ -> setCyclicIRQ()
SENDCYCLE_IRQ -> setSendIRQ()
BME_IRQ -> setBMEIRQ()
fired by software
TIMESYNC_IRQ -> setTimeSyncIRQ() -> Ticker.h
CYCLIC_IRQ -> setCyclicIRQ() -> Ticker.h
SENDCYCLE_IRQ -> setSendIRQ() -> xTimer
BME_IRQ -> setBMEIRQ() -> Ticker.h
ClockTask (Core 1), see timekeeper.cpp
@@ -89,7 +89,7 @@ triggers pps 1 sec impulse
// local Tag for logging
static const char TAG[] = __FILE__;
char clientId[20] = {0}; // unique ClientID
char clientId[20] = {0}; // unique ClientID
void setup() {
@@ -484,7 +484,6 @@ void setup() {
#endif // HAS_BUTTON
// cyclic function interrupts
sendTimer.attach(cfg.sendcycle * 2, setSendIRQ);
cyclicTimer.attach(HOMECYCLE, setCyclicIRQ);
// only if we have a timesource we do timesync
+2 -1
View File
@@ -67,9 +67,10 @@ void set_rssi(uint8_t val[]) {
void set_sendcycle(uint8_t val[]) {
cfg.sendcycle = val[0];
// update send cycle interrupt [seconds / 2]
sendTimer.attach(cfg.sendcycle * 2, setSendIRQ);
ESP_LOGI(TAG, "Remote command: set send cycle to %d seconds",
cfg.sendcycle * 2);
libpax_counter_stop();
init_libpax();
}
void set_sleepcycle(uint8_t val[]) {
+1 -1
View File
@@ -102,7 +102,7 @@ void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) {
wakeup_gpio = GPIO_NUM_MAX;
// stop further enqueuing of senddata and MAC processing
sendTimer.detach();
libpax_counter_stop();
// switch off radio and other power consuming hardware
#if (HAS_SDS011)
-2
View File
@@ -1,8 +1,6 @@
// Basic Config
#include "senddata.h"
Ticker sendTimer;
void setSendIRQ() { xTaskNotify(irqHandlerTask, SENDCYCLE_IRQ, eSetBits); }
// put data to send in RTos Queues used for transmit over channels Lora and SPI