Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/uart/drivers/ws_uart_drv_pm25aqi.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,17 @@ class ws_uart_drv_pm25aqi : public ws_uart_drv {
/*******************************************************************************/
bool begin() override {
_aqi = new Adafruit_PM25AQI();
bool is_pm1006 = (strcmp(getDriverID(), "pm1006") == 0);
#ifdef USE_SW_UART
if (!_aqi->begin_UART(
_swSerial)) { // connect to the sensor over software serial
_swSerial, // connect to the sensor over software serial
is_pm1006)) {
return false;
}
#else
if (!_aqi->begin_UART(
_hwSerial)) { // connect to the sensor over hardware serial
_hwSerial, // connect to the sensor over hardware serial
is_pm1006)) {
return false;
}
#endif
Expand Down
Loading