Skip to content

Commit

Permalink
Update SensorControl.c
Browse files Browse the repository at this point in the history
problem with roll-over, not sure why this is now occurring a lot.
  • Loading branch information
pwittich committed Apr 20, 2021
1 parent bd7616e commit c298f58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions projects/cm_mcu/commands/SensorControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,11 @@ BaseType_t fpga_ctl(int argc, char **argv, char* m)
if (whichfpga == 0) {
TickType_t now = pdTICKS_TO_MS(xTaskGetTickCount()) / 1000;
TickType_t last = pdTICKS_TO_MS(getFFupdateTick()) / 1000;
if ((now - last) > 60) {
if ((now > last) && (now - last) > 60) {
int mins = (now - last) / 60;
copied += snprintf(m + copied, SCRATCH_SIZE - copied,
"%s: stale data, last update %d minutes ago\r\n", argv[0], mins);
"%s: stale data, last update %d minutes ago (%x, %x)\r\n", argv[0], mins,
now, last);
}

copied += snprintf(m + copied, SCRATCH_SIZE - copied, "FPGA monitors\r\n");
Expand Down

0 comments on commit c298f58

Please sign in to comment.