new option WIFICOUNTER fixed

This commit is contained in:
Verkehrsrot 2019-04-13 18:44:25 +02:00
parent 77e795dbf8
commit 38118cae6c
3 changed files with 12 additions and 6 deletions

View File

@ -9,7 +9,9 @@ static const char TAG[] = __FILE__;
Ticker housekeeper;
void housekeeping() { xTaskNotifyFromISR(irqHandlerTask, CYCLIC_IRQ, eSetBits, NULL); }
void housekeeping() {
xTaskNotifyFromISR(irqHandlerTask, CYCLIC_IRQ, eSetBits, NULL);
}
// do all housekeeping
void doHousekeeping() {
@ -24,7 +26,7 @@ void doHousekeeping() {
#ifdef HAS_SPI
spi_housekeeping();
#endif
#if(HAS_LORA)
#if (HAS_LORA)
lora_housekeeping();
#endif
@ -32,7 +34,7 @@ void doHousekeeping() {
ESP_LOGD(TAG, "IRQhandler %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(irqHandlerTask),
eTaskGetState(irqHandlerTask));
#if(HAS_GPS)
#if (HAS_GPS)
ESP_LOGD(TAG, "Gpsloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(GpsTask), eTaskGetState(GpsTask));
#endif
@ -115,8 +117,10 @@ uint32_t getFreeRAM() {
}
void reset_counters() {
#if ((WIFICOUNTER) || (BLECOUNTER))
macs.clear(); // clear all macs container
macs_total = 0; // reset all counters
macs_wifi = 0;
macs_ble = 0;
#endif
}

View File

@ -409,9 +409,7 @@ void setup() {
#endif
// cyclic function interrupts
#if (WIFICOUNTER) || (BLECOUNTER)
sendcycler.attach(SENDCYCLE * 2, sendcycle);
#endif
housekeeper.attach(HOMECYCLE, housekeeping);
// button interrupt

View File

@ -3,7 +3,9 @@
Ticker sendcycler;
void sendcycle() { xTaskNotifyFromISR(irqHandlerTask, SENDCYCLE_IRQ, eSetBits, NULL); }
void sendcycle() {
xTaskNotifyFromISR(irqHandlerTask, SENDCYCLE_IRQ, eSetBits, NULL);
}
// put data to send in RTos Queues used for transmit over channels Lora and SPI
void SendPayload(uint8_t port, sendprio_t prio) {
@ -57,6 +59,7 @@ void sendCounter() {
while (bitmask) {
switch (bitmask & mask) {
#if ((WIFICOUNTER) || (BLECOUNTER))
case COUNT_DATA:
payload.reset();
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
@ -70,6 +73,7 @@ void sendCounter() {
ESP_LOGI(TAG, "Counter cleared");
}
break;
#endif
#if (HAS_BME)
case MEMS_DATA: