HAL_ChibiOS: added micros16() method

This commit is contained in:
Andrew Tridgell 2021-10-02 15:39:30 +10:00
parent 1283d42fbf
commit 5714ee113f

View File

@ -267,6 +267,17 @@ uint32_t micros()
#endif
}
uint16_t micros16()
{
#if CH_CFG_ST_RESOLUTION == 32 && CH_CFG_ST_FREQUENCY==1000000U
return st_lld_get_counter() & 0xFFFF;
#elif CH_CFG_ST_RESOLUTION == 16 && CH_CFG_ST_FREQUENCY==1000000U
return st_lld_get_counter();
#else
return hrt_micros32() & 0xFFFF;
#endif
}
uint32_t millis()
{
return hrt_millis32();