diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 9018a7203..2bdb7ec04 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -99,7 +99,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: Checkout Board Definitions uses: actions/checkout@v2 @@ -305,7 +305,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 diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 82756259c..d9ce6a619 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -346,6 +346,8 @@ bool Wippersnapper::configureDigitalPinReq( /*****************************************************************************/ bool cbDecodePinConfigMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { + (void)field; // marking unused parameters to avoid compiler warning + (void)arg; // marking unused parameters to avoid compiler warning bool is_success = true; WS_DEBUG_PRINTLN("cbDecodePinConfigMsg"); @@ -386,6 +388,8 @@ bool cbDecodePinConfigMsg(pb_istream_t *stream, const pb_field_t *field, bool cbDecodeDigitalPinWriteMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { bool is_success = true; + (void)field; // marking unused parameters to avoid compiler warning + (void)arg; // marking unused parameters to avoid compiler warning WS_DEBUG_PRINTLN("cbDecodeDigitalPinWriteMsg"); // Decode stream into a PinEvent @@ -417,6 +421,7 @@ bool cbDecodeDigitalPinWriteMsg(pb_istream_t *stream, const pb_field_t *field, */ /**************************************************************************/ bool cbSignalMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { + (void)arg; // marking unused parameters to avoid compiler warning bool is_success = true; WS_DEBUG_PRINTLN("cbSignalMsg"); @@ -567,15 +572,11 @@ bool encodeI2CResponse(wippersnapper_signal_v1_I2CResponse *msgi2cResponse) { @brief Initializes an I2C bus component @param msgInitRequest A pointer to an i2c bus initialization message. - @param i2cPort - Desired I2C port to initialize. @return True if initialized successfully, False otherwise. */ /******************************************************************************************/ -bool initializeI2CBus(wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest, - int i2cPort) { - // TODO: i2cPort is not handled right now, we should add support for multiple - // i2c ports! +bool initializeI2CBus(wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest) { + // FUTURE TODO:we should add support for multiple i2c ports! if (WS._isI2CPort0Init) return true; // Initialize bus @@ -599,6 +600,8 @@ bool initializeI2CBus(wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest, /******************************************************************************************/ bool cbDecodeI2CDeviceInitRequestList(pb_istream_t *stream, const pb_field_t *field, void **arg) { + (void)field; // marking unused parameters to avoid compiler warning + (void)arg; // marking unused parameters to avoid compiler warning WS_DEBUG_PRINTLN("EXEC: cbDecodeI2CDeviceInitRequestList"); // Decode stream into individual msgI2CDeviceInitRequest messages wippersnapper_i2c_v1_I2CDeviceInitRequest msgI2CDeviceInitRequest = @@ -616,7 +619,7 @@ bool cbDecodeI2CDeviceInitRequestList(pb_istream_t *stream, wippersnapper_signal_v1_I2CResponse_resp_i2c_device_init_tag; // Check I2C bus - if (!initializeI2CBus(msgI2CDeviceInitRequest.i2c_bus_init_req, 0)) { + if (!initializeI2CBus(msgI2CDeviceInitRequest.i2c_bus_init_req)) { WS_DEBUG_PRINTLN("ERROR: Failed to initialize I2C Bus"); msgi2cResponse.payload.resp_i2c_device_init.bus_response = WS._i2cPort0->getBusStatus(); @@ -664,6 +667,7 @@ bool cbDecodeI2CDeviceInitRequestList(pb_istream_t *stream, bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field, void **arg) { bool is_success = true; + (void)arg; // marking unused parameter to avoid compiler warning WS_DEBUG_PRINTLN("cbDecodeSignalRequestI2C"); // Create I2C Response wippersnapper_signal_v1_I2CResponse msgi2cResponse = @@ -687,7 +691,7 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field, wippersnapper_i2c_v1_I2CBusScanResponse_init_zero; // Check I2C bus - if (!initializeI2CBus(msgScanReq.bus_init_request, 0)) { + if (!initializeI2CBus(msgScanReq.bus_init_request)) { WS_DEBUG_PRINTLN("ERROR: Failed to initialize I2C Bus"); msgi2cResponse.payload.resp_i2c_scan.bus_response = WS._i2cPort0->getBusStatus(); @@ -756,7 +760,7 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field, wippersnapper_signal_v1_I2CResponse_resp_i2c_device_init_tag; // Check I2C bus - if (!initializeI2CBus(msgI2CDeviceInitRequest.i2c_bus_init_req, 0)) { + if (!initializeI2CBus(msgI2CDeviceInitRequest.i2c_bus_init_req)) { WS_DEBUG_PRINTLN("ERROR: Failed to initialize I2C Bus"); msgi2cResponse.payload.resp_i2c_device_init.bus_response = WS._i2cPort0->getBusStatus(); @@ -904,6 +908,7 @@ void cbSignalI2CReq(char *data, uint16_t len) { bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { WS_DEBUG_PRINTLN("Decoding Servo Message..."); + (void)arg; // marking unused parameter to avoid compiler warning if (field->tag == wippersnapper_signal_v1_ServoRequest_servo_attach_tag) { WS_DEBUG_PRINTLN("GOT: Servo Attach"); // Attempt to decode contents of servo_attach message @@ -1082,6 +1087,7 @@ void cbServoMsg(char *data, uint16_t len) { /******************************************************************************************/ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { WS_DEBUG_PRINTLN("Decoding PWM Message..."); + (void)arg; // marking unused parameter to avoid compiler warning if (field->tag == wippersnapper_signal_v1_PWMRequest_attach_request_tag) { WS_DEBUG_PRINTLN("GOT: PWM Pin Attach"); // Attempt to decode contents of PWM attach message @@ -1286,6 +1292,7 @@ void cbPWMMsg(char *data, uint16_t len) { /******************************************************************************************/ bool cbDecodeDs18x20Msg(pb_istream_t *stream, const pb_field_t *field, void **arg) { + (void)arg; // marking unused parameter to avoid compiler warning if (field->tag == wippersnapper_signal_v1_Ds18x20Request_req_ds18x20_init_tag) { WS_DEBUG_PRINTLN("[Message Type] Init. DS Sensor"); @@ -1373,6 +1380,7 @@ void cbSignalDSReq(char *data, uint16_t len) { /******************************************************************************************/ bool cbDecodePixelsMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { + (void)arg; // marking unused parameter to avoid compiler warning if (field->tag == wippersnapper_signal_v1_PixelsRequest_req_pixels_create_tag) { WS_DEBUG_PRINTLN( @@ -1528,6 +1536,7 @@ void cbRegistrationStatus(char *data, uint16_t len) { */ /**************************************************************************/ void cbErrorTopic(char *errorData, uint16_t len) { + (void)len; // marking unused parameter to avoid compiler warning WS_DEBUG_PRINT("IO Ban Error: "); WS_DEBUG_PRINTLN(errorData); // Disconnect client from broker @@ -1558,6 +1567,7 @@ void cbErrorTopic(char *errorData, uint16_t len) { */ /**************************************************************************/ void cbThrottleTopic(char *throttleData, uint16_t len) { + (void)len; // marking unused parameter to avoid compiler warning WS_DEBUG_PRINT("IO Throttle Error: "); WS_DEBUG_PRINTLN(throttleData); char *throttleMessage; diff --git a/src/components/analogIO/Wippersnapper_AnalogIO.cpp b/src/components/analogIO/Wippersnapper_AnalogIO.cpp index a6bc4ea57..56c5f6fce 100644 --- a/src/components/analogIO/Wippersnapper_AnalogIO.cpp +++ b/src/components/analogIO/Wippersnapper_AnalogIO.cpp @@ -329,7 +329,7 @@ void Wippersnapper_AnalogIO::update() { if (_analog_input_pins[i].enabled == true) { // Does the pin execute on-period? - if (millis() - _analog_input_pins[i].prvPeriod > + if ((long)millis() - _analog_input_pins[i].prvPeriod > _analog_input_pins[i].period && _analog_input_pins[i].period != 0L) { WS_DEBUG_PRINT("Executing periodic event on A"); diff --git a/src/components/ds18x20/ws_ds18x20.cpp b/src/components/ds18x20/ws_ds18x20.cpp index 50e26db9f..91360271d 100644 --- a/src/components/ds18x20/ws_ds18x20.cpp +++ b/src/components/ds18x20/ws_ds18x20.cpp @@ -30,7 +30,7 @@ ws_ds18x20::ws_ds18x20() {} /*************************************************************/ ws_ds18x20::~ws_ds18x20() { // delete DallasTemp sensors and release onewire buses - for (int idx = 0; idx < _ds18xDrivers.size(); idx++) { + for (size_t idx = 0; idx < _ds18xDrivers.size(); idx++) { delete _ds18xDrivers[idx]->dallasTempObj; delete _ds18xDrivers[idx]->oneWire; } @@ -135,7 +135,7 @@ bool ws_ds18x20::addDS18x20( void ws_ds18x20::deleteDS18x20( wippersnapper_ds18x20_v1_Ds18x20DeInitRequest *msgDS18x20DeinitReq) { // Loop thru vector of drivers to find the unique address - for (int idx = 0; idx < _ds18xDrivers.size(); idx++) { + for (size_t idx = 0; idx < _ds18xDrivers.size(); idx++) { if (strcmp(_ds18xDrivers[idx]->onewire_pin, msgDS18x20DeinitReq->onewire_pin) == 0) { WS_DEBUG_PRINT("Deleting OneWire instance on pin "); @@ -185,7 +185,7 @@ void ws_ds18x20::update() { for (int i = 0; i < (*iter)->sensorPropertiesCount; i++) { // has sensor_period elapsed? if (curTime - (*iter)->sensorPeriodPrv > - (*iter)->sensorProperties[i].sensor_period) { + (long)(*iter)->sensorProperties[i].sensor_period) { // issue global temperature request to all DS sensors WS_DEBUG_PRINTLN("Requesting temperature.."); (*iter)->dallasTempObj->requestTemperatures(); diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 28846e79b..e35110cc3 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -560,7 +560,7 @@ void WipperSnapper_Component_I2C::updateI2CDeviceProperties( uint16_t i2cAddress = (uint16_t)msgDeviceUpdateReq->i2c_device_address; // Loop thru vector of drivers to find the unique address - for (int i = 0; i < drivers.size(); i++) { + for (size_t i = 0; i < drivers.size(); i++) { if (drivers[i]->getI2CAddress() == i2cAddress) { // Update the properties of each driver for (int j = 0; j < msgDeviceUpdateReq->i2c_device_properties_count; diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h index ad71b15ca..c48283c8f 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver.h @@ -46,7 +46,7 @@ class WipperSnapper_I2C_Driver { @brief Destructor for an I2C sensor. */ /*******************************************************************************/ - ~WipperSnapper_I2C_Driver() { _sensorAddress = 0; } + virtual ~WipperSnapper_I2C_Driver() {} /*******************************************************************************/ /*! @@ -206,7 +206,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventCO2(sensors_event_t *co2Event) { return false; } + virtual bool getEventCO2(sensors_event_t *co2Event) { + (void) + co2Event; // Parameter is intentionally unused in this virtual function. + return false; + } /****************************** SENSOR_TYPE: ECO2 * *******************************/ @@ -248,7 +252,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventECO2(sensors_event_t *eco2Event) { return false; } + virtual bool getEventECO2(sensors_event_t *eco2Event) { + (void)eco2Event; // Parameter is intentionally unused in this virtual + // function. + return false; + } /****************************** SENSOR_TYPE: TVOC * *******************************/ @@ -290,7 +298,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventTVOC(sensors_event_t *tvocEvent) { return false; } + virtual bool getEventTVOC(sensors_event_t *tvocEvent) { + (void)tvocEvent; // Parameter is intentionally unused in this virtual + // function. + return false; + } /********************** SENSOR_TYPE: AMBIENT TEMPERATURE (°C) * ***********************/ @@ -336,7 +348,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventAmbientTemp(sensors_event_t *tempEvent) { return false; } + virtual bool getEventAmbientTemp(sensors_event_t *tempEvent) { + (void)tempEvent; // Parameter is intentionally unused in this virtual + // function. + return false; + } /************************* SENSOR_TYPE: RELATIVE_HUMIDITY * ***********************/ @@ -382,6 +398,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventRelativeHumidity(sensors_event_t *humidEvent) { + (void)humidEvent; // Parameter is intentionally unused in this virtual + // function. return false; } @@ -427,6 +445,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventPressure(sensors_event_t *pressureEvent) { + (void)pressureEvent; // Parameter is intentionally unused in this virtual + // function. return false; } @@ -472,6 +492,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventAltitude(sensors_event_t *altitudeEvent) { + (void)altitudeEvent; // Parameter is intentionally unused in this virtual + // function. return false; } @@ -522,6 +544,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventObjectTemp(sensors_event_t *objectTempEvent) { + (void)objectTempEvent; // Parameter is intentionally unused in this virtual + // function. return false; } @@ -569,7 +593,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventLight(sensors_event_t *lightEvent) { return false; } + virtual bool getEventLight(sensors_event_t *lightEvent) { + (void)lightEvent; // Parameter is intentionally unused in this virtual + // function. + return false; + } /**************************** SENSOR_TYPE: PM10_STD * ****************************/ @@ -615,7 +643,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventPM10_STD(sensors_event_t *pm10StdEvent) { return false; } + virtual bool getEventPM10_STD(sensors_event_t *pm10StdEvent) { + (void)pm10StdEvent; // Parameter is intentionally unused in this virtual + // function. + return false; + } /**************************** SENSOR_TYPE: PM25_STD * ****************************/ @@ -661,7 +693,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventPM25_STD(sensors_event_t *pm25StdEvent) { return false; } + virtual bool getEventPM25_STD(sensors_event_t *pm25StdEvent) { + (void)pm25StdEvent; // Parameter is intentionally unused in this virtual + // function. + return false; + } /**************************** SENSOR_TYPE: PM100_STD * ****************************/ @@ -708,6 +744,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventPM100_STD(sensors_event_t *pm100StdEvent) { + (void)pm100StdEvent; // Parameter is intentionally unused in this virtual + // function. return false; } @@ -760,6 +798,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventUnitlessPercent(sensors_event_t *unitlessPercentEvent) { + (void)unitlessPercentEvent; // Parameter is intentionally unused in this + // virtual function. return false; } @@ -804,7 +844,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventVoltage(sensors_event_t *voltageEvent) { return false; } + virtual bool getEventVoltage(sensors_event_t *voltageEvent) { + (void)voltageEvent; // Parameter is intentionally unused in this virtual + // function. + return false; + } /****************************** SENSOR_TYPE: Raw * *******************************/ @@ -846,7 +890,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventRaw(sensors_event_t *rawEvent) { return false; } + virtual bool getEventRaw(sensors_event_t *rawEvent) { + (void) + rawEvent; // Parameter is intentionally unused in this virtual function. + return false; + } /****************************** SENSOR_TYPE: Ambient Temp (°F) * *******************************/ @@ -1019,6 +1067,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventGasResistance(sensors_event_t *gasEvent) { + (void) + gasEvent; // Parameter is intentionally unused in this virtual function. return false; } @@ -1067,7 +1117,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventNOxIndex(sensors_event_t *gasEvent) { return false; } + virtual bool getEventNOxIndex(sensors_event_t *gasEvent) { + (void) + gasEvent; // Parameter is intentionally unused in this virtual function. + return false; + } /****************************** SENSOR_TYPE: VOC Index (index) * *******************************/ @@ -1114,7 +1168,11 @@ class WipperSnapper_I2C_Driver { otherwise. */ /*******************************************************************************/ - virtual bool getEventVOCIndex(sensors_event_t *gasEvent) { return false; } + virtual bool getEventVOCIndex(sensors_event_t *gasEvent) { + (void) + gasEvent; // Parameter is intentionally unused in this virtual function. + return false; + } /**************************** SENSOR_TYPE: PROXIMITY * ****************************/ @@ -1189,6 +1247,8 @@ class WipperSnapper_I2C_Driver { */ /*******************************************************************************/ virtual bool getEventProximity(sensors_event_t *proximityEvent) { + (void)proximityEvent; // Parameter is intentionally unused in this virtual + // function. return false; } diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor.h index 0d733f778..5e69b4b33 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor.h @@ -49,7 +49,7 @@ class WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor @brief Destructor for a STEMMA soil sensor. */ /*******************************************************************************/ - ~WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor() { delete _seesaw; } + ~WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor() { _seesaw = nullptr; } /*******************************************************************************/ /*! @@ -99,7 +99,7 @@ class WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor } protected: - Adafruit_seesaw *_seesaw; ///< Seesaw object + Adafruit_seesaw *_seesaw = nullptr; ///< Seesaw object }; #endif // WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor_H \ No newline at end of file diff --git a/src/components/pixels/ws_pixels.cpp b/src/components/pixels/ws_pixels.cpp index dcc782b29..daf663f49 100644 --- a/src/components/pixels/ws_pixels.cpp +++ b/src/components/pixels/ws_pixels.cpp @@ -34,7 +34,7 @@ strand_s strands[MAX_PIXEL_STRANDS]{ /**************************************************************************/ ws_pixels::~ws_pixels() { // de-allocate all strands - for (int i = 0; i < sizeof(strands) / sizeof(strands[0]); i++) + for (size_t i = 0; i < sizeof(strands) / sizeof(strands[0]); i++) deallocateStrand(i); } @@ -46,7 +46,7 @@ ws_pixels::~ws_pixels() { */ /******************************************************************************/ int16_t ws_pixels::allocateStrand() { - for (int16_t strandIdx = 0; strandIdx < sizeof(strands) / sizeof(strands[0]); + for (size_t strandIdx = 0; strandIdx < sizeof(strands) / sizeof(strands[0]); strandIdx++) { if (strands[strandIdx].type == wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_UNSPECIFIED) { @@ -338,7 +338,7 @@ bool ws_pixels::addStrand( /**************************************************************************/ int ws_pixels::getStrandIdx(int16_t dataPin, wippersnapper_pixels_v1_PixelsType type) { - for (int16_t strandIdx = 0; strandIdx < sizeof(strands) / sizeof(strands[0]); + for (size_t strandIdx = 0; strandIdx < sizeof(strands) / sizeof(strands[0]); strandIdx++) { if (type == wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_NEOPIXEL && strands[strandIdx].pinNeoPixel == dataPin) diff --git a/src/components/pwm/ws_pwm.cpp b/src/components/pwm/ws_pwm.cpp index ce6f3c074..06c29ca35 100644 --- a/src/components/pwm/ws_pwm.cpp +++ b/src/components/pwm/ws_pwm.cpp @@ -48,11 +48,16 @@ ws_pwm::~ws_pwm() { _ledcMgr = nullptr; } */ /******************************************************************/ bool ws_pwm::attach(uint8_t pin, double freq, uint8_t resolution) { + // Future TODO: Maybe this function should be within #ifdef for ARCH_ESP32 bool is_attached = true; #if defined(ARDUINO_ARCH_ESP32) uint8_t rc = _ledcMgr->attachPin(pin, freq, resolution); if (rc == LEDC_CH_ERR) is_attached = false; +#else + (void)pin; // marking as unused parameter to avoid compiler warning + (void)freq; // marking as unused parameter to avoid compiler warning + (void)resolution; // marking as unused parameter to avoid compiler warning #endif return is_attached; // always true on non-esp32 } diff --git a/src/components/servo/ws_servo.cpp b/src/components/servo/ws_servo.cpp index 5223ed9be..23db82a97 100644 --- a/src/components/servo/ws_servo.cpp +++ b/src/components/servo/ws_servo.cpp @@ -36,7 +36,7 @@ ws_servo::~ws_servo() { */ /**************************************************************************/ servoComponent *ws_servo::getServoComponent(uint8_t pin) { - for (int i = 0; i < sizeof(_servos) / sizeof(_servos[0]); i++) { + for (size_t i = 0; i < sizeof(_servos) / sizeof(_servos[0]); i++) { WS_DEBUG_PRINTLN(_servos[i].pin); if (_servos[i].pin == pin) return &_servos[i]; @@ -72,6 +72,7 @@ bool ws_servo::servo_attach(int pin, int minPulseWidth, int maxPulseWidth, #ifdef ARDUINO_ARCH_ESP32 rc = servo->attach(pin, minPulseWidth, maxPulseWidth, freq); #else + (void)freq; // supress warning when we don't use the frequency parameter rc = servo->attach(pin, minPulseWidth, maxPulseWidth); #endif if (rc == ERR_SERVO_ATTACH)