Skip to content

Commit bcf1d08

Browse files
authored
Merge pull request #746 from adafruit/745-update-v1-codebase-to-use-latest-release-of-pm25-library-is_pm1006-flag
Update PM2.5 begin_UART call for PM1006 (PM25AQI v2.0.0)
2 parents 3fa0d82 + f92df0a commit bcf1d08

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/uart/drivers/ws_uart_drv_pm25aqi.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,17 @@ class ws_uart_drv_pm25aqi : public ws_uart_drv {
8181
/*******************************************************************************/
8282
bool begin() override {
8383
_aqi = new Adafruit_PM25AQI();
84+
bool is_pm1006 = (strcmp(getDriverID(), "pm1006") == 0);
8485
#ifdef USE_SW_UART
8586
if (!_aqi->begin_UART(
86-
_swSerial)) { // connect to the sensor over software serial
87+
_swSerial, // connect to the sensor over software serial
88+
is_pm1006)) {
8789
return false;
8890
}
8991
#else
9092
if (!_aqi->begin_UART(
91-
_hwSerial)) { // connect to the sensor over hardware serial
93+
_hwSerial, // connect to the sensor over hardware serial
94+
is_pm1006)) {
9295
return false;
9396
}
9497
#endif

0 commit comments

Comments
 (0)