Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
43384d9277 | |||
19050fab18 |
2 changed files with 11 additions and 6 deletions
5
Makefile
5
Makefile
|
@ -16,8 +16,9 @@ src \
|
|||
|
||||
SOURCES := \
|
||||
src/BME68x-Sensor-API/bme68x.c \
|
||||
src/oled-driver/fonts/mono.cxx \
|
||||
src/oled-driver/src/Display.cxx \
|
||||
src/oled-driver/fonts/mono.cxx \
|
||||
src/oled-driver/src/SSD1305.cxx \
|
||||
src/oled-driver/src/SSD1306.cxx \
|
||||
src/oled-driver/src/Image.cxx \
|
||||
src/oled-driver/src/Renderer.cxx \
|
||||
src/bmeSPI.cxx \
|
||||
|
|
|
@ -259,7 +259,7 @@ void printBmeSensorData()
|
|||
renderer.drawVerticalLine(OledWidth - MaxTextWidth - 2, 0, OledPages - 1);
|
||||
|
||||
if (iaqAccuracy == 0)
|
||||
snprintf(buffer, MaximumChars, "IAQ:---\n---ppm\n");
|
||||
snprintf(buffer, MaximumChars, "IAQ:---\n----ppm\n");
|
||||
else
|
||||
snprintf(buffer, MaximumChars, "IAQ:%d\n%dppm\n",
|
||||
static_cast<int>(iaq), //
|
||||
|
@ -323,7 +323,11 @@ extern "C" void sensorTask(void *)
|
|||
bmeSensorInit();
|
||||
readStateFromEeprom();
|
||||
|
||||
uint16_t counter = 0;
|
||||
constexpr auto TaskDelay = 10;
|
||||
constexpr auto SaveContentDelay = 12 * 60 * 60 * 1000;
|
||||
constexpr auto SaveContentDelayCounts = SaveContentDelay / TaskDelay;
|
||||
|
||||
uint32_t counter = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -331,13 +335,13 @@ extern "C" void sensorTask(void *)
|
|||
bsecRun();
|
||||
printBmeSensorData();
|
||||
|
||||
if (counter++ >= 1000)
|
||||
if (counter++ >= SaveContentDelayCounts)
|
||||
{
|
||||
counter = 0;
|
||||
initDisplay();
|
||||
writeStateToEeprom();
|
||||
}
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
vTaskDelay(pdMS_TO_TICKS(TaskDelay));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue