Skip to content

Commit c30d605

Browse files
committed
strip update() out, not part of init
1 parent 0ccf766 commit c30d605

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -233,45 +233,5 @@ bool WipperSnapper_Component_I2C::deinitI2CDevice(
233233
*/
234234
/*******************************************************************************/
235235
void WipperSnapper_Component_I2C::update() {
236-
for (int i = 0; i < drivers.size(); i++) {
237-
// Empty wippersnapper_i2c_v1_I2CSensorEvent container message
238-
wippersnapper_i2c_v1_I2CSensorEvent sensorEvent =
239-
wippersnapper_i2c_v1_I2CSensorEvent_init_zero;
240-
241-
// Check if i2c device has a temperature sensor
242-
if (drivers[i]->getTempSensorPeriod() > -1L) {
243-
long curTime = millis(); // take the current time
244-
if (curTime - drivers[i]->getTempSensorPeriodPrv() >
245-
drivers[i]->getTempSensorPeriod()) {
246-
// Update temperature sensor and fill field
247-
wippersnapper_i2c_v1_SensorEvent sensorEventMsg =
248-
wippersnapper_i2c_v1_SensorEvent_init_zero;
249-
drivers[i]->updateTempSensor(&sensorEventMsg.event_data.temperature);
250-
WS_DEBUG_PRINT("Read Temperature Sensor Value: ");
251-
WS_DEBUG_PRINT(sensorEventMsg.event_data.temperature);
252-
WS_DEBUG_PRINTLN(" Degrees C");
253-
// TODO: Pack into the sensorEvent message
254-
}
255-
}
256-
257-
// Check if i2c device has a humidity sensor
258-
if (drivers[i]->getHumidSensorPeriod() > -1L) {
259-
long curTime = millis(); // take the current time
260-
if (curTime - drivers[i]->getHumidSensorPeriodPrv() >
261-
drivers[i]->getHumidSensorPeriod()) {
262-
// Update temperature sensor and fill field
263-
wippersnapper_i2c_v1_SensorEvent sensorEventMsg =
264-
wippersnapper_i2c_v1_SensorEvent_init_zero;
265-
drivers[i]->updateHumidSensor(
266-
&sensorEventMsg.event_data.relative_humidity);
267-
WS_DEBUG_PRINT("Read Humidity Sensor Value: ");
268-
WS_DEBUG_PRINT(sensorEventMsg.event_data.temperature);
269-
WS_DEBUG_PRINTLN(" %RH");
270-
}
271-
}
272-
273-
// TODO //
274-
// Fill the container I2CSensorEvent -> Signal proto
275-
// Publish proto
276-
}
236+
// TODO
277237
}

0 commit comments

Comments
 (0)