update code, remove nrf_drv_clock dependency

This commit is contained in:
hathach
2018-03-20 19:52:21 +07:00
parent 2f0fcf80e0
commit 9f5fcb64ed
5 changed files with 225 additions and 155 deletions

View File

@@ -36,7 +36,9 @@
#include "board_pca10056.h"
#include "nrf_gpio.h"
#include "nrf_drv_systick.h"
#include "nrf_drv_power.h"
/*------------------------------------------------------------------*/
/* MACRO TYPEDEF CONSTANT ENUM
@@ -55,6 +57,12 @@
*------------------------------------------------------------------*/
void board_init(void)
{
// Config clock source: XTAL or RC in sdk_config.h
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_CONFIG_LF_SRC << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
nrf_drv_power_init(NULL);
nrf_gpio_cfg_output(LED_1);
SysTick_Config(SystemCoreClock/1000);