Skip to content

Commit

Permalink
add suggestions from Tyeth, src/components/i2c/WipperSnapper_I2C.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Aug 21, 2023
1 parent c769a0d commit ece56dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/analogIO/Wippersnapper_AnalogIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/components/ds18x20/ws_ds18x20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,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;
Expand Down

0 comments on commit ece56dd

Please sign in to comment.