From a1c71cd5a081de9573a184e2a9379d6b47f4fde8 Mon Sep 17 00:00:00 2001 From: Stephane D'Alu Date: Sun, 14 Feb 2016 16:09:37 +0100 Subject: st handle compile-tie error checking instead of gpt, as gpt is included first --- os/hal/ports/NRF51/NRF51822/gpt_lld.h | 5 ----- os/hal/ports/NRF51/NRF51822/st_lld.h | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/os/hal/ports/NRF51/NRF51822/gpt_lld.h b/os/hal/ports/NRF51/NRF51822/gpt_lld.h index 0e3b544..2c84d6c 100644 --- a/os/hal/ports/NRF51/NRF51822/gpt_lld.h +++ b/os/hal/ports/NRF51/NRF51822/gpt_lld.h @@ -97,11 +97,6 @@ #error "GPT driver activated but no TIMER peripheral assigned" #endif -#if (NRF51_GPT_USE_TIMER0 == TRUE) && \ - (NRF51_SYSTEM_TICKS == NRF51_SYSTEM_TICKS_AS_TIMER) -#error "GPT driver can't use TIMER0 as currently used by ST driver" -#endif - #if 0 #if NRF51_GPT_USE_TIMER0 && \ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_GPT_TIMER0_IRQ_PRIORITY) diff --git a/os/hal/ports/NRF51/NRF51822/st_lld.h b/os/hal/ports/NRF51/NRF51822/st_lld.h index c6cf201..54dabda 100644 --- a/os/hal/ports/NRF51/NRF51822/st_lld.h +++ b/os/hal/ports/NRF51/NRF51822/st_lld.h @@ -61,7 +61,14 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -#if ((NRF51_SYSTEM_TICKS != NRF51_SYSTEM_TICKS_AS_RTC) && \ +#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) +#if (NRF51_GPT_USE_TIMER0 == TRUE) && \ + (NRF51_SYSTEM_TICKS == NRF51_SYSTEM_TICKS_AS_TIMER) +#error "TIMER0 already used by GPT driver" +#endif +#endif + +#if ((NRF51_SYSTEM_TICKS != NRF51_SYSTEM_TICKS_AS_RTC) && \ (NRF51_SYSTEM_TICKS != NRF51_SYSTEM_TICKS_AS_TIMER)) #error "NRF51_SYSTEM_TICKS illegal value" #endif -- cgit v1.2.3