diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 11be798a5..7a83a7c17 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -35,7 +35,7 @@ jobs: echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags) - uses: actions/checkout@v2 with: - repository: adafruit/ci-arduino + repository: brentru/ci-arduino path: ci - name: Install CI-Arduino run: bash ci/actions_install.sh @@ -43,7 +43,7 @@ jobs: run: | git clone --quiet https://github.com/brentru/Adafruit_MQTT_Library.git /home/runner/Arduino/libraries/Adafruit_MQTT_Library - name: Build for ESP32-Sx - run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --no_warn + run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} - name: list run : | ls diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index baaf895bd..87d1090db 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -180,6 +180,7 @@ void Wippersnapper::set_ssid_pass() { @brief Configures the device's Adafruit IO credentials. This method should be used only if filesystem-backed provisioning is not avaliable. +*/ /****************************************************************************/ void Wippersnapper::set_user_key() { WS_DEBUG_PRINTLN("ERROR: Please define a network interface!"); diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 1a1e80290..49cc5b621 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -365,7 +365,8 @@ void WipperSnapper_Component_I2C::deinitI2CDevice( for (iter = drivers.begin(), end = drivers.end(); iter != end; ++iter) { if ((*iter)->getI2CAddress() == deviceAddr) { // Delete the object that iter points to - delete *iter; + // delete *iter; + *iter = nullptr; // ESP-IDF, Erase–remove iter ptr from driver vector #if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) *iter = nullptr; diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h index d40ef08f2..2ffc297d0 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h @@ -38,7 +38,7 @@ class WipperSnapper_I2C_Driver { /*******************************************************************************/ WipperSnapper_I2C_Driver(TwoWire *i2c, uint16_t sensorAddress) { _i2c = i2c; - _sensorAddress; + _sensorAddress = sensorAddress; } /*******************************************************************************/ @@ -104,10 +104,12 @@ class WipperSnapper_I2C_Driver { enableSensorObjectTemp(); setSensorObjectTempPeriod( msgDeviceInitReq->i2c_device_properties[propertyIdx].sensor_period); + break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT: enableSensorLight(); setSensorLightPeriod( msgDeviceInitReq->i2c_device_properties[propertyIdx].sensor_period); + break; default: break; } diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_SCD30.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_SCD30.h index 93db2c886..26841aa7c 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_SCD30.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_SCD30.h @@ -42,13 +42,6 @@ class WipperSnapper_I2C_Driver_SCD30 : public WipperSnapper_I2C_Driver { _sensorAddress = sensorAddress; } - /*******************************************************************************/ - /*! - @brief Destructor for an SCD30 sensor. - */ - /*******************************************************************************/ - ~WipperSnapper_I2C_Driver_SCD30() { delete _scd30; } - /*******************************************************************************/ /*! @brief Initializes the SCD30 sensor and begins I2C. @@ -56,8 +49,8 @@ class WipperSnapper_I2C_Driver_SCD30 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool begin() { - _scd30 = new Adafruit_SCD30(); - bool isInit = _scd30->begin((uint8_t)_sensorAddress, _i2c); + _scd = new Adafruit_SCD30(); + bool isInit = _scd->begin((uint8_t)_sensorAddress, _i2c); return isInit; } @@ -72,12 +65,12 @@ class WipperSnapper_I2C_Driver_SCD30 : public WipperSnapper_I2C_Driver { /*******************************************************************************/ bool getEventAmbientTemperature(sensors_event_t *tempEvent) { // check if sensor is enabled and data is available - if (_tempSensorPeriod != 0 && (!_scd30->dataReady())) + if (_tempSensorPeriod != 0 && (!_scd->dataReady())) return false; // attempt to get temperature data sensors_event_t humidEvent; - if (!_scd30->getEvent(&humidEvent, tempEvent)) + if (!_scd->getEvent(&humidEvent, tempEvent)) return false; return true; @@ -94,12 +87,12 @@ class WipperSnapper_I2C_Driver_SCD30 : public WipperSnapper_I2C_Driver { /*******************************************************************************/ bool getEventRelativeHumidity(sensors_event_t *humidEvent) { // check if sensor is enabled and data is available - if (_humidSensorPeriod != 0 && (!_scd30->dataReady())) + if (_humidSensorPeriod != 0 && (!_scd->dataReady())) return false; // attempt to get temperature data sensors_event_t tempEvent; - if (!_scd30->getEvent(humidEvent, &tempEvent)) + if (!_scd->getEvent(humidEvent, &tempEvent)) return false; return true; @@ -116,16 +109,16 @@ class WipperSnapper_I2C_Driver_SCD30 : public WipperSnapper_I2C_Driver { /*******************************************************************************/ bool getEventCO2(sensors_event_t *co2Event) { // check if sensor is enabled and data is available - if (_CO2SensorPeriod != 0 && (!_scd30->dataReady())) + if (_CO2SensorPeriod != 0 && (!_scd->dataReady())) return false; // TODO: This is a TEMPORARY HACK, we need to add CO2 type to // adafruit_sensor - co2Event->data[0] = _scd30->CO2; + co2Event->data[0] = _scd->CO2; return true; } protected: - Adafruit_SCD30 *_scd30; ///< SCD30 driver object + Adafruit_SCD30 *_scd; ///< SCD30 driver object }; #endif // WipperSnapper_I2C_Driver_SCD30 \ No newline at end of file diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 6a70bbea5..e26b1142e 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -404,7 +404,7 @@ void Wippersnapper_FS::parseSecrets() { } // error check if SSID is the from templated json - if (WS._network_ssid == "YOUR_WIFI_SSID_HERE") { + if (strcmp(WS._network_ssid, "YOUR_WIFI_SSID_HERE") == 0) { writeToBootOut( "* ERROR: Default SSID found in secrets.json, please edit " "the secrets.json file and reset the board for the changes to take " @@ -447,7 +447,7 @@ void Wippersnapper_FS::parseSecrets() { fsHalt(); } // error check if wifi password is from template - if (WS._network_pass == "YOUR_WIFI_PASS_HERE") { + if (strcmp(WS._network_pass, "YOUR_WIFI_PASS_HERE") == 0) { writeToBootOut("Default SSID found in secrets.json, please edit " "the secrets.json file and reset the board\n"); fsHalt();