diff --git a/src/cyclic.cpp b/src/cyclic.cpp index 62e712d7..9d108747 100644 --- a/src/cyclic.cpp +++ b/src/cyclic.cpp @@ -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 } \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index e0cad626..8a5255d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 diff --git a/src/senddata.cpp b/src/senddata.cpp index be84c677..ebfd84e1 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -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: