File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/components/uart/drivers Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,17 @@ class ws_uart_drv_pm25aqi : public ws_uart_drv {
81
81
/* ******************************************************************************/
82
82
bool begin () override {
83
83
_aqi = new Adafruit_PM25AQI ();
84
+ bool is_pm1006 = (strcmp (getDriverID (), " pm1006" ) == 0 );
84
85
#ifdef USE_SW_UART
85
86
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)) {
87
89
return false ;
88
90
}
89
91
#else
90
92
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)) {
92
95
return false ;
93
96
}
94
97
#endif
You can’t perform that action at this time.
0 commit comments