From c1411e5c1b475213fe0e5066e65a9791bd93fd58 Mon Sep 17 00:00:00 2001 From: August Quint <49277349+AugustQu@users.noreply.github.com> Date: Wed, 22 Jan 2020 15:49:07 +0100 Subject: [PATCH] added support for SDS011 --- src/senddata.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/senddata.cpp b/src/senddata.cpp index f4f6b085..367a5c68 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -3,6 +3,11 @@ Ticker sendcycler; +#if (HAS_SDS011) +extern float pm10; +extern float pm25; +#endif + void sendcycle() { xTaskNotifyFromISR(irqHandlerTask, SENDCYCLE_IRQ, eSetBits, NULL); } @@ -13,6 +18,10 @@ void SendPayload(uint8_t port, sendprio_t prio) { MessageBuffer_t SendBuffer; // contains MessageSize, MessagePort, MessagePrio, Message[] +#if (HAS_SDS011) + sds011_loop(); +#endif + SendBuffer.MessageSize = payload.getSize(); SendBuffer.MessagePrio = prio; @@ -94,6 +103,10 @@ void sendData() { payload.addCount(macs_wifi, MAC_SNIFF_WIFI); if (cfg.blescan) payload.addCount(macs_ble, MAC_SNIFF_BLE); +#endif +#if (HAS_SDS011) + payload.addPM10(pm10); + payload.addPM25(pm25); #endif SendPayload(COUNTERPORT, prio_normal); // clear counter if not in cumulative counter mode @@ -172,4 +185,4 @@ void flushQueues() { #ifdef HAS_SPI spi_queuereset(); #endif -} \ No newline at end of file +}