diff options
| author | hathach <[email protected]> | 2018-11-21 00:32:17 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-11-21 00:32:17 +0700 |
| commit | c5d9a477c0aa7fcf1fdf3cbd5526518d557e115e (patch) | |
| tree | 03a83dd36fd68196315311d829eeaf7469adf331 | |
| parent | eadcba75a2e3f9787923d4330fb9e89c08d4651f (diff) | |
samd21 metro m0 blink too fast, still have issue with clock init
| -rw-r--r-- | hw/bsp/metro_m0_express/board_metro_m0_express.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/bsp/metro_m0_express/board_metro_m0_express.c b/hw/bsp/metro_m0_express/board_metro_m0_express.c index 3b0edb400..598d0658d 100644 --- a/hw/bsp/metro_m0_express/board_metro_m0_express.c +++ b/hw/bsp/metro_m0_express/board_metro_m0_express.c @@ -41,9 +41,11 @@ #include "sam.h" #include "hal/include/hal_gpio.h" #include "hal/include/hal_init.h" -#include <hpl_gclk_base.h> -#include <hpl_pm_config.h> -#include <hpl_pm_base.h> +#include "hri/hri_nvmctrl_d21.h" + +#include "hpl/gclk/hpl_gclk_base.h" +#include "hpl_pm_config.h" +#include "hpl/pm/hpl_pm_base.h" #include "peripheral_clk_config.h" @@ -61,8 +63,7 @@ void board_init(void) { // Clock init ( follow hpl_init.c ) - - // hri_nvmctrl_set_CTRLA_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE); + hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, 2); _pm_init(); _sysctrl_init_sources(); @@ -72,6 +73,7 @@ void board_init(void) _sysctrl_init_referenced_generators(); _gclk_init_generators_by_fref(_GCLK_INIT_LAST); + // Led init gpio_set_pin_direction(BOARD_LED0, GPIO_DIRECTION_OUT); gpio_set_pin_level(BOARD_LED0, 1-LED_STATE_ON); |
