Closed lhstrh closed 2 years ago
Ugh. This could happen if lf_clock_gettime()
returns an unexpectedly large time, leading the system to believe that physical time is way ahead of logical time. Perhaps call this function when the LEDs are toggled? It should give the number of microseconds since start of execution.
On line 158 of lf_nrf52_support.c
is the only place I can see where physical time may be getting a big jump:
_lf_time_epoch_offset += (1LL << 32) * 1000;
Perhaps appending a printf to this line (or setting a gdb breakpoint) would reveal something? This line should not execute until 71 minutes into execution of the program. If it executes early, this could explain the problem.
This was solved in 78acdd20960b54299bcc18bd82a8579c416b7f06, but the implementation that had this flaw is subsumed by #11 which hasn't been tested on Linux yet. @tessxd: would you mind testing with an updated main
branch on Linux?
The exact same program and hardware yield expected behavior when compiled on macOS. My guess is that there is a data representation issue that causes this... The behavior can be observed via printed output via
make rtt
or through the LEDs (they blink so fast whenBlink.lf
is deployed that it appears as if they don't blink at all).