mirror of https://github.com/ARMmbed/mbed-os.git
modify system_nrf51822.c for fix HRM1017 and mbed_overrides.c for 32MHz setting
parent
9f80c90477
commit
2ffec3246f
|
@ -21,12 +21,7 @@
|
|||
#include "nrf51822.h"
|
||||
#include "system_nrf51822.h"
|
||||
|
||||
#ifdef TARGET_DELTA_DFCM_NNN40
|
||||
|
||||
#define __SYSTEM_CLOCK (32000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 32MHz */
|
||||
#else
|
||||
#define __SYSTEM_CLOCK (16000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
|
||||
#endif
|
||||
#define __SYSTEM_CLOCK (16000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
|
||||
|
||||
static bool is_manual_peripheral_setup_needed(void);
|
||||
static bool is_disabled_in_debug_needed(void);
|
||||
|
@ -71,7 +66,7 @@ void SystemInit(void)
|
|||
|
||||
// Start the external 32khz crystal oscillator.
|
||||
|
||||
#ifdef TARGET_DELTA_DFCM_NNN40 || TARGET_HRM1017
|
||||
#if defined(TARGET_HRM1017) | defined(TARGET_DELTA_DFCM_NNN40)
|
||||
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
|
||||
#else
|
||||
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
|
||||
|
|
|
@ -15,6 +15,14 @@ void mbed_sdk_init()
|
|||
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
|
||||
|
||||
NRF_GPIO->OUTCLR = (GPIO_OUTCLR_PIN19_Clear << GPIO_OUTCLR_PIN19_Pos);
|
||||
|
||||
// Config External Crystal to 32MHz
|
||||
NRF_CLOCK->XTALFREQ = 0x00;
|
||||
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
|
||||
NRF_CLOCK->TASKS_HFCLKSTART = 1;
|
||||
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
|
||||
{// Do nothing.
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue