mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 17:22:24 +08:00
15ee981d5b
date: 2022-05-24T01:48:37 master commit: 71901c94dbbaa2f9f156a80c14cc7ea65219fc7c
6 lines
230 B
C
6 lines
230 B
C
// compute the time elapsed (in microseconds) from 2 counter samples
|
|
// case where ts < ts_last is ok: overflow is properly re-casted into uint32_t
|
|
uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) {
|
|
return ts - ts_last;
|
|
}
|