summaryrefslogtreecommitdiffstats
path: root/tmk_core/common/wait.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/wait.h')
-rw-r--r--tmk_core/common/wait.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h
index 40d00b0c7..82727be01 100644
--- a/tmk_core/common/wait.h
+++ b/tmk_core/common/wait.h
@@ -9,9 +9,13 @@ extern "C" {
# include <util/delay.h>
# define wait_ms(ms) _delay_ms(ms)
# define wait_us(us) _delay_us(us)
-#elif defined(__arm__)
+#elif defined(PROTOCOL_CHIBIOS) /* __AVR__ */
+# include "ch.h"
+# define wait_ms(ms) chThdSleepMilliseconds(ms)
+# define wait_us(us) chThdSleepMicroseconds(us)
+#elif defined(__arm__) /* __AVR__ */
# include "wait_api.h"
-#endif
+#endif /* __AVR__ */
#ifdef __cplusplus
}