diff --git a/lambda/command.c b/lambda/command.c index 205f33e..a862d0b 100644 --- a/lambda/command.c +++ b/lambda/command.c @@ -96,7 +96,7 @@ } beep(1, length, tone); } - else if (strcmp_P(fields[4], PSTR("!")) == 0 && simulation) { + else if (simulation) { // add one second per measurement to the timebase, // assuming one measurement was logged per second addInts(INTS_PER_SEC); @@ -106,7 +106,8 @@ updateMeas(meas); } reason(meas); - updateDisplayIfPending(); } + + updateDisplayIfPending(); } diff --git a/lambda/lambda.c b/lambda/lambda.c index 31204eb..9fec629 100644 --- a/lambda/lambda.c +++ b/lambda/lambda.c @@ -54,12 +54,14 @@ setHeatingOn(true); _delay_ms(1000); + uint32_t ints = 0; Measurement meas; // main loop while (true) { - if (getInts() % INTS_PER_SEC == 0 && ! isSimulation() && + if (! isSimulation() && getInts() >= ints + INTS_PER_SEC && getHeatingState() != HEATING_FAULT) { + ints = getInts(); meas = measure(); if (isLogging()) { logMeas(meas);