From a8c8ffc10a47ba9a0430d64eb78a1e9a5c76c08a Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Fri, 27 Mar 2020 11:22:35 +0100 Subject: [PATCH] Add platform independent delay abstraction --- Makefile | 1 + include/delay.h | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 include/delay.h diff --git a/Makefile b/Makefile index a54fe04..6283f02 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ OPT = 3 C_FLAGS += -O$(OPT) -g$(OPT) C_FLAGS += -Wall -Werror C_FLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing +C_FLAGS += -DPLATFORM_$(PLATFORM) LIBS += c nosys m diff --git a/include/delay.h b/include/delay.h new file mode 100644 index 0000000..3dc2836 --- /dev/null +++ b/include/delay.h @@ -0,0 +1,10 @@ +#ifndef __DELAY_H__ +#define __DELAY_H__ + +#if defined(PLATFORM_nrf52) + #include "nrf_delay.h" + + #define delay_ms nrf_delay_ms +#endif + +#endif