summaryrefslogtreecommitdiff
path: root/platforms/chibios/_wait.h
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2022-11-08 17:14:27 -0800
committerDrashna Jael're <drashna@live.com>2022-11-08 17:14:27 -0800
commit64f04b30c2f48fc0e7c49ca043443f03dc56df94 (patch)
treee0f374d3b92bacefd22c31e7bda8ee1c6fcb37de /platforms/chibios/_wait.h
parentd9f575fa86ca10b990958d4e677c6a0a387dc7c3 (diff)
parent96c48a5f4aa461ed31fd4ee61151ac206e16fb5f (diff)
Merge tag '0.18.16' into firmware22
Diffstat (limited to 'platforms/chibios/_wait.h')
-rw-r--r--platforms/chibios/_wait.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/platforms/chibios/_wait.h b/platforms/chibios/_wait.h
index 2f36c64a2e..c0ccbc5569 100644
--- a/platforms/chibios/_wait.h
+++ b/platforms/chibios/_wait.h
@@ -17,6 +17,7 @@
#include <ch.h>
#include <hal.h>
+#include "chibios_config.h"
/* chThdSleepX of zero maps to infinite - so we map to a tiny delay to still yield */
#define wait_ms(ms) \
@@ -30,6 +31,11 @@
#ifdef WAIT_US_TIMER
void wait_us(uint16_t duration);
+#elif PORT_SUPPORTS_RT == TRUE
+# define wait_us(us) \
+ do { \
+ chSysPolledDelayX(US2RTC(REALTIME_COUNTER_CLOCK, us)); \
+ } while (0)
#else
# define wait_us(us) \
do { \