Andrew Tridgell
4141dd5bbe
HAL_ChibiOS: support starting the clock at non-zero
...
for testing time wrap bugs
2023-03-24 08:31:25 +11:00
Ivannikov Kirill
3ab1b29397
AP_HAL_ChibiOS: error if system clock not 1mhz on 16 CH_CFG_ST_RESOLUTION. prevent variable overflow
...
if CH_CFG_ST_FREQUENCY not match 1000000U on 16 bit CH_CFG_ST_RESOLUTION
we try to multiply now *= 1000000U/CH_CFG_ST_FREQUENCY; it may overflow 16 bit value.
2020-04-26 19:58:54 +10:00
Andrew Tridgell
f732a482fe
HAL_ChibiOS: support wider range of clock frequencies
2019-12-20 16:50:48 +11:00
Andrew Tridgell
4f429e6c5a
HAL_ChibiOS: fixed handling of 16bit timer wrap
...
this fixes #12948
2019-12-09 12:43:39 +11:00
Andrew Tridgell
4674a1c68d
HAL_ChibiOS: fixed system time for clocks other than 1MHz
...
needed for IOMCU
2018-10-17 15:11:28 +11:00
Andrew Tridgell
33076be585
HAL_ChibiOS: fixed handling of 16 bit timers
...
when we have a 16 bit timer then systime_t is 16 bit, and we need to
handle wrap of get_systime_us32()
2018-08-26 18:34:26 +10:00
Andrew Tridgell
385f735799
HAL_ChibiOS: avoid 64 bit maths in AP_HAL::micros()
...
this saves a few cycles
2018-08-08 21:24:49 +10:00
Siddharth Purohit
395c48933c
HAL_ChibiOS: move tto using updated time conversion API
2018-08-03 13:44:59 +10:00
Andrew Tridgell
427e00dd41
HAL_ChibiOS: switched to system timer for AP_HAL::micros()
...
this uses the ChibiOS system timer instead of a separate GPT timer for
the core ChibiOS timer. The advantage is it saves us a timer, plus it
changes ChibiOS to use a 1MHz clock on its timer, which gives us
higher resolution for delays.
This has a remarkable effect on timing jitter, reducing it greatly
2018-02-14 18:27:00 +11:00
Andrew Tridgell
8b6bab7b17
HAL_Chibios: added ChibiOS HAL
...
this is based on initial work by Sid, reset here for easier merging
2018-01-15 11:46:02 +11:00