#include "project.h" static uint32_t high_tick; uint64_t abs_extend (uint32_t now) { static uint32_t then; uint64_t ret; if (now < then) high_tick++; then = now; ret = high_tick; ret <<= 32; ret |= now; return ret; } uint64_t abs_get (void) { uint32_t now = SCS_DWT_CYCCNT; return abs_extend (now); } void abs_slow_tick() { abs_get(); }