diff options
author | skullY <skullydazed@gmail.com> | 2019-08-30 11:19:03 -0700 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-08-30 15:01:52 -0700 |
commit | b624f32f944acdc59dcb130674c09090c5c404cb (patch) | |
tree | bc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /tmk_core/common/wait.h | |
parent | 61af76a10d00aba185b8338604171de490a13e3b (diff) | |
download | qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.tar.gz |
clang-format changes
Diffstat (limited to 'tmk_core/common/wait.h')
-rw-r--r-- | tmk_core/common/wait.h | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h index 9aed372b7..cb1f386a6 100644 --- a/tmk_core/common/wait.h +++ b/tmk_core/common/wait.h @@ -8,22 +8,36 @@ extern "C" { #endif #if defined(__AVR__) -# include <util/delay.h> -# define wait_ms(ms) _delay_ms(ms) -# define wait_us(us) _delay_us(us) +# include <util/delay.h> +# define wait_ms(ms) _delay_ms(ms) +# define wait_us(us) _delay_us(us) #elif defined PROTOCOL_CHIBIOS -# include "ch.h" -# define wait_ms(ms) do { if (ms != 0) { chThdSleepMilliseconds(ms); } else { chThdSleepMicroseconds(1); } } while (0) -# define wait_us(us) do { if (us != 0) { chThdSleepMicroseconds(us); } else { chThdSleepMicroseconds(1); } } while (0) +# include "ch.h" +# define wait_ms(ms) \ + do { \ + if (ms != 0) { \ + chThdSleepMilliseconds(ms); \ + } else { \ + chThdSleepMicroseconds(1); \ + } \ + } while (0) +# define wait_us(us) \ + do { \ + if (us != 0) { \ + chThdSleepMicroseconds(us); \ + } else { \ + chThdSleepMicroseconds(1); \ + } \ + } while (0) #elif defined PROTOCOL_ARM_ATSAM -# include "clks.h" -# define wait_ms(ms) CLK_delay_ms(ms) -# define wait_us(us) CLK_delay_us(us) +# include "clks.h" +# define wait_ms(ms) CLK_delay_ms(ms) +# define wait_us(us) CLK_delay_us(us) #elif defined(__arm__) -# include "wait_api.h" +# include "wait_api.h" #else // Unit tests void wait_ms(uint32_t ms); -#define wait_us(us) wait_ms(us / 1000) +# define wait_us(us) wait_ms(us / 1000) #endif #ifdef __cplusplus |