Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wait.h 480B

123456789101112131415161718192021222324
  1. #ifndef WAIT_H
  2. #define WAIT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #if defined(__AVR__)
  7. # include <util/delay.h>
  8. # define wait_ms(ms) _delay_ms(ms)
  9. # define wait_us(us) _delay_us(us)
  10. #elif defined(PROTOCOL_CHIBIOS) /* __AVR__ */
  11. # include "ch.h"
  12. # define wait_ms(ms) chThdSleepMilliseconds(ms)
  13. # define wait_us(us) chThdSleepMicroseconds(us)
  14. #elif defined(__arm__) /* __AVR__ */
  15. # include "wait_api.h"
  16. #endif /* __AVR__ */
  17. #ifdef __cplusplus
  18. }
  19. #endif
  20. #endif