added support for SDS011
This commit is contained in:
parent
7a465f7c75
commit
c1411e5c1b
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user