Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ifdefs for external temperature sensor #80

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/Sensors/Sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define WITH_SCD30
#define WITH_SFA30
#define WITH_GPS
#define WITH_EXT_TEMP
#endif

#ifdef SCK22_AIR
Expand All @@ -21,6 +22,7 @@
#define WITH_ADS1X15
#define WITH_SFA30
#define WITH_GPS
#define WITH_EXT_TEMP
#endif

#ifdef SCK23_AIR
Expand All @@ -32,6 +34,7 @@
#define WITH_ADS1X15
#define WITH_SFA30
#define WITH_GPS
#define WITH_EXT_TEMP
#endif

#ifdef SCK_WATER
Expand Down Expand Up @@ -59,6 +62,7 @@
// #define WITH_ATLAS // Saves 884 bytes
// #define WITH_CHIRP // Saves 404 bytes
// #define WITH_DALLAS_TEMP // Saves 292 bytes
// #define #define WITH_EXT_TEMP
// #define WITH_GPS // Saves 1508 bytes
// #define WITH_RANGE // Saves 292 bytes
// #define WITH_BME68X // Saves 644 bytes
Expand Down Expand Up @@ -244,7 +248,7 @@ enum SensorType
SENSOR_DALLAS_TEMP,
#endif

#ifdef WITH_URBAN
#ifdef WITH_EXT_TEMP
SENSOR_SHT31_TEMP,
SENSOR_SHT31_HUM,
SENSOR_SHT35_TEMP,
Expand Down Expand Up @@ -523,7 +527,7 @@ class AllSensors
OneSensor { BOARD_AUX, 0, SENSOR_DALLAS_TEMP, "DALLAS_TEMP", "Direct Dallas Temperature", 96, true, 1, "C" },
#endif

#ifdef WITH_URBAN
#ifdef WITH_EXT_TEMP
OneSensor { BOARD_AUX, 0, SENSOR_SHT31_TEMP, "EXT_TEMP", "Ext Temperature", 79, true, 1, "C" },
OneSensor { BOARD_AUX, 0, SENSOR_SHT31_HUM, "EXT_HUM", "Ext Humidity", 80, true, 1, "%" },
OneSensor { BOARD_AUX, 0, SENSOR_SHT35_TEMP, "EXT_TEMP_SHT35", "Ext SHT35 Temperature", 224, true, 1, "C" },
Expand Down
8 changes: 4 additions & 4 deletions sam/src/SckAux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PMsensor pmSensorB = PMsensor(SLOT_B);
PM_DallasTemp pmDallasTemp;
Sck_DallasTemp dallasTemp;
#endif
#ifdef WITH_URBAN
#ifdef WITH_EXT_TEMP
Sck_SHT31 sht31 = Sck_SHT31(&auxWire);
Sck_SHT31 sht35 = Sck_SHT31(&auxWire, 0x45);
#endif
Expand Down Expand Up @@ -148,7 +148,7 @@ bool AuxBoards::start(SckBase *base, SensorType wichSensor)
case SENSOR_PM_DALLAS_TEMP: return pmDallasTemp.start();
case SENSOR_DALLAS_TEMP: return dallasTemp.start();
#endif
#ifdef WITH_URBAN
#ifdef WITH_EXT_TEMP
case SENSOR_SHT31_TEMP:
case SENSOR_SHT31_HUM:
#ifdef WITH_GASES_BOARD
Expand Down Expand Up @@ -275,7 +275,7 @@ bool AuxBoards::stop(SensorType wichSensor)
case SENSOR_PM_DALLAS_TEMP: return pmDallasTemp.stop();
case SENSOR_DALLAS_TEMP: return dallasTemp.stop();
#endif
#ifdef WITH_URBAN
#ifdef WITH_EXT_TEMP
case SENSOR_SHT31_TEMP:
case SENSOR_SHT31_HUM: return sht31.stop();
case SENSOR_SHT35_TEMP:
Expand Down Expand Up @@ -397,7 +397,7 @@ void AuxBoards::getReading(SckBase *base, OneSensor *wichSensor)
case SENSOR_PM_DALLAS_TEMP: wichSensor->reading = String(pmDallasTemp.getReading()); return;
case SENSOR_DALLAS_TEMP: if (dallasTemp.getReading()) { wichSensor->reading = String(dallasTemp.reading); return; } break;
#endif
#ifdef WITH_URBAN
#ifdef WITH_EXT_TEMP
case SENSOR_SHT31_TEMP: if (sht31.getReading()) { wichSensor->reading = String(sht31.temperature); return; } break;
case SENSOR_SHT31_HUM: if (sht31.getReading()) { wichSensor->reading = String(sht31.humidity); return; } break;
case SENSOR_SHT35_TEMP: if (sht35.getReading()) { wichSensor->reading = String(sht35.temperature); return; } break;
Expand Down
Loading