implemented precision timestamps in report messages

This commit is contained in:
2018-01-27 20:27:33 +01:00
parent 94e87c74d3
commit 04e32860f7
14 changed files with 246 additions and 59 deletions
+2 -3
View File
@@ -16,7 +16,7 @@ static uint32_t effect_time = 0;
// counter of idle ticks since last indicator
// used to allow or disallow heartbeat blink (to avoid interference)
static uint32_t indicator_idle_ms = 0;
#define IDLE_FOR_HEARTBEAT_MS 3000
#define IDLE_FOR_HEARTBEAT_MS (3000-60)
#define HB_MAX_SAFE_IVAL 500
static uint32_t hb_elapsed = 0;
@@ -86,8 +86,7 @@ void Indicator_Tick(void)
if (active_effect == STATUS_NONE) {
indicator_idle_ms++;
if (hb_elapsed < HB_MAX_SAFE_IVAL && indicator_idle_ms > IDLE_FOR_HEARTBEAT_MS &&
(indicator_idle_ms % 10 == 0)) {
if (hb_elapsed < HB_MAX_SAFE_IVAL && indicator_idle_ms > IDLE_FOR_HEARTBEAT_MS && (indicator_idle_ms % 10 == 0)) {
Indicator_Effect(STATUS_HEARTBEAT);
}
}
+2
View File
@@ -11,6 +11,8 @@
#ifndef GEX_F072_TIMEBASE_H
#define GEX_F072_TIMEBASE_H
#include "platform.h"
/**
* Precision timer: get microtime as uint64_t
* This timestamp should be monotonously increasing with a precision of ±0.5µs