diff options
Diffstat (limited to 'tmk_core/common/wait.h')
-rw-r--r-- | tmk_core/common/wait.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h index bdcb3f2a4..553f5243f 100644 --- a/tmk_core/common/wait.h +++ b/tmk_core/common/wait.h | |||
@@ -11,10 +11,15 @@ extern "C" { | |||
11 | # include <util/delay.h> | 11 | # include <util/delay.h> |
12 | # define wait_ms(ms) _delay_ms(ms) | 12 | # define wait_ms(ms) _delay_ms(ms) |
13 | # define wait_us(us) _delay_us(us) | 13 | # define wait_us(us) _delay_us(us) |
14 | #elif defined(PROTOCOL_CHIBIOS) | 14 | #elif defined PROTOCOL_CHIBIOS |
15 | # include "ch.h" | 15 | # include "ch.h" |
16 | # define wait_ms(ms) chThdSleepMilliseconds(ms) | 16 | # if defined(STM32F3xx_MCUCONF) |
17 | # define wait_us(us) chThdSleepMicroseconds(us) | 17 | # define wait_ms(ms) chSysPolledDelayX(MS2RTC(STM32_HCLK, (ms))) |
18 | # define wait_us(us) chSysPolledDelayX(US2RTC(STM32_HCLK, (us))) | ||
19 | # else | ||
20 | # define wait_ms(ms) chThdSleepMilliseconds(ms) | ||
21 | # define wait_us(us) chThdSleepMicroseconds(us) | ||
22 | # endif | ||
18 | #elif defined(__arm__) | 23 | #elif defined(__arm__) |
19 | # include "wait_api.h" | 24 | # include "wait_api.h" |
20 | #else // Unit tests | 25 | #else // Unit tests |