1
0
Fork 0

add wait_cpuclock() macro for AVR and CPU_CLOCK macro (#12755)

This commit is contained in:
Takeshi ISHII 2021-08-24 22:34:24 +09:00 committed by GitHub
parent c4dbf4bf01
commit c9c60d227e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -37,6 +37,8 @@
} \
} \
} while (0)
#define wait_cpuclock(n) __builtin_avr_delay_cycles(n)
#define CPU_CLOCK F_CPU
/* The AVR series GPIOs have a one clock read delay for changes in the digital input signal.
* But here's more margin to make it two clocks. */
@ -44,4 +46,4 @@
# define GPIO_INPUT_PIN_DELAY 2
#endif
#define waitInputPinDelay() __builtin_avr_delay_cycles(GPIO_INPUT_PIN_DELAY)
#define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY)