Skip to content

Commit 137ce64

Browse files
committed
chore: reformat WipperSnapper_I2C.cpp
1 parent 0426fc6 commit 137ce64

File tree

1 file changed

+52
-44
lines changed

1 file changed

+52
-44
lines changed

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ void WipperSnapper_Component_I2C::update() {
10361036
WS_DEBUG_PRINTLN(
10371037
"ERROR: Failed to get ambient temperature sensor reading!");
10381038
sensorsReturningFalse = true;
1039-
if (retries==1) {
1039+
if (retries == 1) {
10401040
(*iter)->setSensorAmbientTempPeriodPrv(curTime);
10411041
}
10421042
}
@@ -1064,7 +1064,7 @@ void WipperSnapper_Component_I2C::update() {
10641064
WS_DEBUG_PRINTLN(
10651065
"ERROR: Failed to obtain ambient temp. (°F)) sensor reading!");
10661066
sensorsReturningFalse = true;
1067-
if (retries==1) {
1067+
if (retries == 1) {
10681068
(*iter)->setSensorAmbientTempFPeriodPrv(curTime);
10691069
}
10701070
}
@@ -1093,7 +1093,7 @@ void WipperSnapper_Component_I2C::update() {
10931093
WS_DEBUG_PRINTLN(
10941094
"ERROR: Failed to get object temperature sensor (°C) reading!");
10951095
sensorsReturningFalse = true;
1096-
if (retries==1) {
1096+
if (retries == 1) {
10971097
(*iter)->setSensorObjectTempPeriodPrv(curTime);
10981098
}
10991099
}
@@ -1122,7 +1122,7 @@ void WipperSnapper_Component_I2C::update() {
11221122
WS_DEBUG_PRINTLN(
11231123
"ERROR: Failed to get object temperature sensor (°F) reading!");
11241124
sensorsReturningFalse = true;
1125-
if (retries==1) {
1125+
if (retries == 1) {
11261126
(*iter)->setSensorObjectTempFPeriodPrv(curTime);
11271127
}
11281128
}
@@ -1166,14 +1166,15 @@ void WipperSnapper_Component_I2C::update() {
11661166
WS_DEBUG_PRINTLN(" hPa");
11671167

11681168
// pack event data into msg
1169-
fillEventMessage(&msgi2cResponse, event.pressure,
1170-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE);
1169+
fillEventMessage(
1170+
&msgi2cResponse, event.pressure,
1171+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE);
11711172

11721173
(*iter)->setSensorPressurePeriodPrv(curTime);
11731174
} else {
11741175
WS_DEBUG_PRINTLN("ERROR: Failed to get Pressure sensor reading!");
11751176
sensorsReturningFalse = true;
1176-
if (retries==1) {
1177+
if (retries == 1) {
11771178
(*iter)->setSensorPressurePeriodPrv(curTime);
11781179
}
11791180
}
@@ -1193,12 +1194,12 @@ void WipperSnapper_Component_I2C::update() {
11931194
WS_DEBUG_PRINTLN(" ppm");
11941195

11951196
fillEventMessage(&msgi2cResponse, event.CO2,
1196-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2);
1197+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2);
11971198
(*iter)->setSensorCO2PeriodPrv(curTime);
11981199
} else {
11991200
WS_DEBUG_PRINTLN("ERROR: Failed to obtain CO2 sensor reading!");
12001201
sensorsReturningFalse = true;
1201-
if (retries==1) {
1202+
if (retries == 1) {
12021203
(*iter)->setSensorCO2PeriodPrv(curTime);
12031204
}
12041205
}
@@ -1218,12 +1219,12 @@ void WipperSnapper_Component_I2C::update() {
12181219
WS_DEBUG_PRINTLN(" ppm");
12191220

12201221
fillEventMessage(&msgi2cResponse, event.eCO2,
1221-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ECO2);
1222+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ECO2);
12221223
(*iter)->setSensorECO2PeriodPrv(curTime);
12231224
} else {
12241225
WS_DEBUG_PRINTLN("ERROR: Failed to obtain eCO2 sensor reading!");
12251226
sensorsReturningFalse = true;
1226-
if (retries==1) {
1227+
if (retries == 1) {
12271228
(*iter)->setSensorECO2PeriodPrv(curTime);
12281229
}
12291230
}
@@ -1243,12 +1244,12 @@ void WipperSnapper_Component_I2C::update() {
12431244
WS_DEBUG_PRINTLN(" ppb");
12441245

12451246
fillEventMessage(&msgi2cResponse, event.tvoc,
1246-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC);
1247+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC);
12471248
(*iter)->setSensorTVOCPeriodPrv(curTime);
12481249
} else {
12491250
WS_DEBUG_PRINTLN("ERROR: Failed to obtain TVOC sensor reading!");
12501251
sensorsReturningFalse = true;
1251-
if (retries==1) {
1252+
if (retries == 1) {
12521253
(*iter)->setSensorTVOCPeriodPrv(curTime);
12531254
}
12541255
}
@@ -1268,14 +1269,15 @@ void WipperSnapper_Component_I2C::update() {
12681269
WS_DEBUG_PRINTLN(" m");
12691270

12701271
// pack event data into msg
1271-
fillEventMessage(&msgi2cResponse, event.altitude,
1272-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE);
1272+
fillEventMessage(
1273+
&msgi2cResponse, event.altitude,
1274+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE);
12731275

12741276
(*iter)->setSensorAltitudePeriodPrv(curTime);
12751277
} else {
12761278
WS_DEBUG_PRINTLN("ERROR: Failed to get altitude sensor reading!");
12771279
sensorsReturningFalse = true;
1278-
if (retries==1) {
1280+
if (retries == 1) {
12791281
(*iter)->setSensorAltitudePeriodPrv(curTime);
12801282
}
12811283
}
@@ -1296,13 +1298,13 @@ void WipperSnapper_Component_I2C::update() {
12961298

12971299
// pack event data into msg
12981300
fillEventMessage(&msgi2cResponse, event.light,
1299-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT);
1301+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT);
13001302

13011303
(*iter)->setSensorLightPeriodPrv(curTime);
13021304
} else {
13031305
WS_DEBUG_PRINTLN("ERROR: Failed to get light sensor reading!");
13041306
sensorsReturningFalse = true;
1305-
if (retries==1) {
1307+
if (retries == 1) {
13061308
(*iter)->setSensorLightPeriodPrv(curTime);
13071309
}
13081310
}
@@ -1322,14 +1324,15 @@ void WipperSnapper_Component_I2C::update() {
13221324
WS_DEBUG_PRINTLN(" ppm");
13231325

13241326
// pack event data into msg
1325-
fillEventMessage(&msgi2cResponse, event.pm10_std,
1326-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD);
1327+
fillEventMessage(
1328+
&msgi2cResponse, event.pm10_std,
1329+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD);
13271330
// try again in curTime seconds
13281331
(*iter)->setSensorPM10_STDPeriodPrv(curTime);
13291332
} else {
13301333
WS_DEBUG_PRINTLN("ERROR: Failed to get PM1.0 sensor reading!");
13311334
sensorsReturningFalse = true;
1332-
if (retries==1) {
1335+
if (retries == 1) {
13331336
(*iter)->setSensorPM10_STDPeriodPrv(curTime);
13341337
}
13351338
}
@@ -1349,14 +1352,15 @@ void WipperSnapper_Component_I2C::update() {
13491352
WS_DEBUG_PRINTLN(" ppm");
13501353

13511354
// pack event data into msg
1352-
fillEventMessage(&msgi2cResponse, event.pm25_std,
1353-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD);
1355+
fillEventMessage(
1356+
&msgi2cResponse, event.pm25_std,
1357+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD);
13541358
// try again in curTime seconds
13551359
(*iter)->setSensorPM25_STDPeriodPrv(curTime);
13561360
} else {
13571361
WS_DEBUG_PRINTLN("ERROR: Failed to get PM2.5 sensor reading!");
13581362
sensorsReturningFalse = true;
1359-
if (retries==1) {
1363+
if (retries == 1) {
13601364
(*iter)->setSensorPM25_STDPeriodPrv(curTime);
13611365
}
13621366
}
@@ -1376,14 +1380,15 @@ void WipperSnapper_Component_I2C::update() {
13761380
WS_DEBUG_PRINTLN(" ppm");
13771381

13781382
// pack event data into msg
1379-
fillEventMessage(&msgi2cResponse, event.pm25_std,
1380-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD);
1383+
fillEventMessage(
1384+
&msgi2cResponse, event.pm25_std,
1385+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD);
13811386
(*iter)->setSensorPM100_STDPeriodPrv(
13821387
curTime); // try again in curTime seconds
13831388
} else {
13841389
WS_DEBUG_PRINTLN("ERROR: Failed to get PM10.0 sensor reading!");
13851390
sensorsReturningFalse = true;
1386-
if (retries==1) {
1391+
if (retries == 1) {
13871392
(*iter)->setSensorPM100_STDPeriodPrv(curTime);
13881393
}
13891394
}
@@ -1404,13 +1409,13 @@ void WipperSnapper_Component_I2C::update() {
14041409

14051410
// pack event data into msg
14061411
fillEventMessage(&msgi2cResponse, event.voltage,
1407-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE);
1412+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE);
14081413
// try again in curTime seconds
14091414
(*iter)->setSensorVoltagePeriodPrv(curTime);
14101415
} else {
14111416
WS_DEBUG_PRINTLN("ERROR: Failed to get voltage sensor reading!");
14121417
sensorsReturningFalse = true;
1413-
if (retries==1) {
1418+
if (retries == 1) {
14141419
(*iter)->setSensorVoltagePeriodPrv(curTime);
14151420
}
14161421
}
@@ -1431,13 +1436,13 @@ void WipperSnapper_Component_I2C::update() {
14311436

14321437
// pack event data into msg
14331438
fillEventMessage(&msgi2cResponse, event.current,
1434-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CURRENT);
1439+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CURRENT);
14351440
// try again in curTime seconds
14361441
(*iter)->setSensorCurrentPeriodPrv(curTime);
14371442
} else {
14381443
WS_DEBUG_PRINTLN("ERROR: Failed to get Current sensor reading!");
14391444
sensorsReturningFalse = true;
1440-
if (retries==1) {
1445+
if (retries == 1) {
14411446
(*iter)->setSensorCurrentPeriodPrv(curTime);
14421447
}
14431448
}
@@ -1466,7 +1471,7 @@ void WipperSnapper_Component_I2C::update() {
14661471
WS_DEBUG_PRINTLN(
14671472
"ERROR: Failed to get unitless percent sensor reading!");
14681473
sensorsReturningFalse = true;
1469-
if (retries==1) {
1474+
if (retries == 1) {
14701475
(*iter)->setSensorUnitlessPercentPeriodPrv(curTime);
14711476
}
14721477
}
@@ -1485,12 +1490,12 @@ void WipperSnapper_Component_I2C::update() {
14851490
WS_DEBUG_PRINTLN(event.data[0]);
14861491

14871492
fillEventMessage(&msgi2cResponse, event.data[0],
1488-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW);
1493+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW);
14891494
(*iter)->setSensorRawPeriodPrv(curTime);
14901495
} else {
14911496
WS_DEBUG_PRINTLN("ERROR: Failed to obtain Raw sensor reading!");
14921497
sensorsReturningFalse = true;
1493-
if (retries==1) {
1498+
if (retries == 1) {
14941499
(*iter)->setSensorRawPeriodPrv(curTime);
14951500
}
14961501
}
@@ -1517,7 +1522,7 @@ void WipperSnapper_Component_I2C::update() {
15171522
WS_DEBUG_PRINTLN(
15181523
"ERROR: Failed to obtain gas resistance sensor reading!");
15191524
sensorsReturningFalse = true;
1520-
if (retries==1) {
1525+
if (retries == 1) {
15211526
(*iter)->setSensorGasResistancePeriodPrv(curTime);
15221527
}
15231528
}
@@ -1535,13 +1540,14 @@ void WipperSnapper_Component_I2C::update() {
15351540
WS_DEBUG_PRINT("\tNOx Index: ");
15361541
WS_DEBUG_PRINT(event.nox_index);
15371542

1538-
fillEventMessage(&msgi2cResponse, event.data[0],
1539-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX);
1543+
fillEventMessage(
1544+
&msgi2cResponse, event.data[0],
1545+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX);
15401546
(*iter)->setSensorNOxIndexPeriodPrv(curTime);
15411547
} else {
15421548
WS_DEBUG_PRINTLN("ERROR: Failed to obtain NOx index sensor reading!");
15431549
sensorsReturningFalse = true;
1544-
if (retries==1) {
1550+
if (retries == 1) {
15451551
(*iter)->setSensorNOxIndexPeriodPrv(curTime);
15461552
}
15471553
}
@@ -1559,13 +1565,14 @@ void WipperSnapper_Component_I2C::update() {
15591565
WS_DEBUG_PRINT("\tVOC Index: ");
15601566
WS_DEBUG_PRINT(event.voc_index);
15611567

1562-
fillEventMessage(&msgi2cResponse, event.data[0],
1563-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX);
1568+
fillEventMessage(
1569+
&msgi2cResponse, event.data[0],
1570+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX);
15641571
(*iter)->setSensorVOCIndexPeriodPrv(curTime);
15651572
} else {
15661573
WS_DEBUG_PRINTLN("ERROR: Failed to obtain VOC index sensor reading!");
15671574
sensorsReturningFalse = true;
1568-
if (retries==1) {
1575+
if (retries == 1) {
15691576
(*iter)->setSensorVOCIndexPeriodPrv(curTime);
15701577
}
15711578
}
@@ -1584,14 +1591,15 @@ void WipperSnapper_Component_I2C::update() {
15841591
WS_DEBUG_PRINT(event.data[0]);
15851592

15861593
// pack event data into msg
1587-
fillEventMessage(&msgi2cResponse, event.data[0],
1588-
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY);
1594+
fillEventMessage(
1595+
&msgi2cResponse, event.data[0],
1596+
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY);
15891597

15901598
(*iter)->setSensorProximityPeriodPrv(curTime);
15911599
} else {
15921600
WS_DEBUG_PRINTLN("ERROR: Failed to get proximity sensor reading!");
15931601
sensorsReturningFalse = true;
1594-
if (retries==1) {
1602+
if (retries == 1) {
15951603
(*iter)->setSensorProximityPeriodPrv(curTime);
15961604
}
15971605
}

0 commit comments

Comments
 (0)