diff --git a/examples/m5atom/platformio.ini b/examples/m5atom/platformio.ini index a5430515..3604fe91 100644 --- a/examples/m5atom/platformio.ini +++ b/examples/m5atom/platformio.ini @@ -23,4 +23,4 @@ build_flags = lib_deps = hpsaturn/CanAirIO Air Quality Sensors Library @ 0.7.4 fastled/FastLED@^3.5.0 - m5stack/M5Atom@^0.0.7 + m5stack/M5Atom@^0.1.2 diff --git a/library.json b/library.json index 579886ff..019c2b11 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "CanAirIO Air Quality Sensors Library", - "version": "0.7.4", + "version": "0.7.5", "homepage":"https://canair.io", "keywords": [ @@ -86,7 +86,7 @@ {"name":"AM232X", "owner":"robtillaart", "version":"0.5.0"}, {"name":"sps30", "owner":"paulvha","version":"1.4.17"}, {"name":"MH-Z19", "owner":"wifwaf", "version":"1.5.4"}, - {"name":"S8_UART", "owner":"jcomas", "version":"1.0.1"}, + {"name":"S8_UART", "owner":"jcomas", "version":"1.0.2"}, {"name":"Sensirion Core","owner":"sensirion","version":"0.6.0"}, {"name":"Sensirion I2C SCD4x","owner":"sensirion","version":"0.4.0"}, {"name":"Sensirion I2C SEN5X","owner":"sensirion","version":"0.3.0"}, diff --git a/library.properties b/library.properties index 821d61ac..fe026e74 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CanAirIO Air Quality Sensors Library -version=0.7.4 +version=0.7.5 author=@hpsaturn, CanAirIO project maintainer=Antonio Vanegas url=https://github.com/kike-canaries/canairio_sensorlib diff --git a/src/Sensors.cpp b/src/Sensors.cpp index d156d88b..d4a729d8 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -1970,6 +1970,9 @@ void Sensors::startI2C() { Wire.begin(I2C1_SDA_PIN, I2C1_SCL_PIN); enableWire1(); #endif +#ifdef ESP32C3_AIRGRADIENT + Wire.begin(7, 6); +#endif } void Sensors::enableWire1() { @@ -2006,36 +2009,16 @@ bool Sensors::serialInit(u_int pms_type, unsigned long speed_baud, int pms_rx, i if (devmode) Serial.printf("-->[SLIB] UART init with speed\t: %lu TX:%i RX:%i\r\n", speed_baud, pms_tx, pms_rx); +#if ARDUINO_USB_CDC_ON_BOOT // Serial used for USB CDC + Serial0.begin(9600, SERIAL_8N1); + _serial = &Serial0; + return true; +#endif switch (SENSOR_COMMS) { case SERIALPORT: Serial.begin(speed_baud); _serial = &Serial; break; -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(SAMD21G18A) || \ - defined(ARDUINO_SAM_DUE) - case SERIALPORT1: - Serial1.begin(speed_baud); - _serial = &Serial1; - break; -#endif -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(ARDUINO_SAM_DUE) - case SERIALPORT2: - Serial2.begin(speed_baud); - _serial = &Serial2; - break; - - case SERIALPORT3: - Serial3.begin(speed_baud); - _serial = &Serial3; - break; -#endif -#if defined(__AVR_ATmega32U4__) - case SERIALPORT1: - Serial1.begin(speed_baud); - _serial = &Serial1; - break; -#endif - #if defined(ARDUINO_ARCH_ESP32) // on a Sparkfun ESP32 Thing the default pins for serial1 are used for acccessing flash memory // you have to define different pins upfront in order to use serial1 port. diff --git a/src/Sensors.hpp b/src/Sensors.hpp index e55937df..e4047548 100644 --- a/src/Sensors.hpp +++ b/src/Sensors.hpp @@ -24,8 +24,8 @@ #include #endif -#define CSL_VERSION "0.7.4" -#define CSL_REVISION 383 +#define CSL_VERSION "0.7.5" +#define CSL_REVISION 384 /*************************************************************** * S E T U P E S P 3 2 B O A R D S A N D F I E L D S @@ -69,6 +69,9 @@ #elif ESP32C3 #define PMS_RX 20 #define PMS_TX 21 +#elif ESP32C3_AIRGRADIENT +#define PMS_RX 0 +#define PMS_TX 1 #else // **DEFAULT** for legacy CanAirIO devices: #define PMS_RX 17 // D1MIN1 / TTGOT7 / ESP32DEVKIT, also for main ESP32 dev boards use it diff --git a/unified-lib-deps.ini b/unified-lib-deps.ini index c649e8ae..c3ab3788 100644 --- a/unified-lib-deps.ini +++ b/unified-lib-deps.ini @@ -10,7 +10,7 @@ lib_deps = robtillaart/AM232X@0.5.0 paulvha/sps30@1.4.17 wifwaf/MH-Z19@1.5.4 - jcomas/S8_UART@1.0.1 + jcomas/S8_UART@1.0.2 sensirion/Sensirion Core@0.6.0 sensirion/Sensirion I2C SCD4x@0.4.0 sensirion/Sensirion I2C SEN5X @ 0.3.0