Fix delay_us and delay_ns not showing up

This commit is contained in:
Jeremy Soller
2019-11-22 14:30:21 -07:00
parent 9cfd3a8d5a
commit da60fc9080
2 changed files with 11 additions and 10 deletions

View File

@@ -4,6 +4,17 @@
#include <stdint.h>
void delay_ticks(uint16_t ticks);
// 1 us * 9.2 MHz / 12 is 69/90
// Warning: this will round to the nearest tick
#define delay_us(X) \
delay_ticks((uint16_t)((((uint32_t)(X)) * 69UL + 89UL) / 90UL));
// 1 ns * 9.2 MHz / 12 is 69/90000
// Warning: this will round to the nearest tick
#define delay_ns(X) \
delay_ticks((uint16_t)((((uint32_t)(X)) * 69UL + 89999UL) / 90000UL));
void delay_ms(int ms);
#endif // _ARCH_DELAY_H