]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common/wait.h
[Keyboard] fixed pins for numpad_5x4 layout (#6311)
[qmk_firmware.git] / tmk_core / common / wait.h
1 #ifndef WAIT_H
2 #define WAIT_H
3
4 #include <inttypes.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 #if defined(__AVR__)
11 #   include <util/delay.h>
12 #   define wait_ms(ms)  _delay_ms(ms)
13 #   define wait_us(us)  _delay_us(us)
14 #elif defined PROTOCOL_CHIBIOS
15 #   include "ch.h"
16 #   define wait_ms(ms) chThdSleepMilliseconds(ms)
17 #   define wait_us(us) chThdSleepMicroseconds(us)
18 #elif defined PROTOCOL_ARM_ATSAM
19 #   include "clks.h"
20 #   define wait_ms(ms) CLK_delay_ms(ms)
21 #   define wait_us(us) CLK_delay_us(us)
22 #elif defined(__arm__)
23 #   include "wait_api.h"
24 #else  // Unit tests
25 void wait_ms(uint32_t ms);
26 #define wait_us(us) wait_ms(us / 1000)
27 #endif
28
29 #ifdef __cplusplus
30 }
31 #endif
32
33 #endif