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 {
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
You can’t perform that action at this time.
0 commit comments