Commit 96d095f8 authored by Eric Duminil's avatar Eric Duminil
Browse files

FIXME: use millis for durations, not timestamps

parent 86309b4a
......@@ -146,6 +146,7 @@ namespace led_effects {
static uint16_t wheel_offset = 0;
unsigned long t0 = millis();
pixels.setBrightness(config::max_brightness);
//FIXME: OVERFLOW!
while (millis() < t0 + duration_ms) {
for (int i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.ColorHSV(i * 65535 / NUMPIXELS + wheel_offset));
......
......@@ -184,6 +184,7 @@ namespace lorawan {
void preparePayloadIfTimeHasCome(const int16_t &co2, const float &temperature, const float &humidity) {
static unsigned long last_sent_at = 0;
unsigned long now = seconds();
//FIXME: OVERFLOW!
if (connected && (now > last_sent_at + config::lorawan_sending_interval)) {
last_sent_at = now;
preparePayload(co2, temperature, humidity);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment