diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/NRF5/NRF52832/hal_lld.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/os/hal/ports/NRF5/NRF52832/hal_lld.c b/os/hal/ports/NRF5/NRF52832/hal_lld.c index 0fc8c27..500de13 100644 --- a/os/hal/ports/NRF5/NRF52832/hal_lld.c +++ b/os/hal/ports/NRF5/NRF52832/hal_lld.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 Fabio Utzig + Copyright (C) 2016 Stephane D'Alu Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -56,15 +56,10 @@ void hal_lld_init(void) { /* High frequency clock initialisation - * (If NRF51_XTAL_VALUE is not defined assume its an RC oscillator) */ NRF_CLOCK->TASKS_HFCLKSTOP = 1; -#if defined(NRF51_XTAL_VALUE) -#if NRF51_XTAL_VALUE == 16000000 - NRF_CLOCK->XTALFREQ = 0xFF; -#elif NRF51_XTAL_VALUE == 32000000 - NRF_CLOCK->XTALFREQ = 0x00; -#endif +#if !defined(NRF5_XTAL_VALUE) && (NRF5_XTAL_VALUE != 32000000) +#error "A 32Mhz crystal is mandatory on nRF52 boards." #endif @@ -72,10 +67,10 @@ void hal_lld_init(void) * Clock is only started if st driver requires it */ NRF_CLOCK->TASKS_LFCLKSTOP = 1; - NRF_CLOCK->LFCLKSRC = NRF51_LFCLK_SOURCE; + NRF_CLOCK->LFCLKSRC = NRF5_LFCLK_SOURCE; #if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) && \ - (NRF51_SYSTEM_TICKS == NRF51_SYSTEM_TICKS_AS_RTC) + (NRF5_SYSTEM_TICKS == NRF5_SYSTEM_TICKS_AS_RTC) NRF_CLOCK->TASKS_LFCLKSTART = 1; #endif } |