mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-14 00:40:29 +00:00
has issue with metro m0 clock init
This commit is contained in:
parent
a46b42a54e
commit
eadcba75a2
@ -41,6 +41,9 @@
|
||||
#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 "peripheral_clk_config.h"
|
||||
|
||||
|
||||
@ -49,9 +52,25 @@
|
||||
//--------------------------------------------------------------------+
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
/* Referenced GCLKs, should be initialized firstly */
|
||||
#define _GCLK_INIT_1ST (1 << 0 | 1 << 1)
|
||||
|
||||
/* Not referenced GCLKs, initialized last */
|
||||
#define _GCLK_INIT_LAST (~_GCLK_INIT_1ST)
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
//init_mcu();
|
||||
// Clock init ( follow hpl_init.c )
|
||||
|
||||
// hri_nvmctrl_set_CTRLA_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE);
|
||||
|
||||
_pm_init();
|
||||
_sysctrl_init_sources();
|
||||
#if _GCLK_INIT_1ST
|
||||
_gclk_init_generators_by_fref(_GCLK_INIT_1ST);
|
||||
#endif
|
||||
_sysctrl_init_referenced_generators();
|
||||
_gclk_init_generators_by_fref(_GCLK_INIT_LAST);
|
||||
|
||||
gpio_set_pin_direction(BOARD_LED0, GPIO_DIRECTION_OUT);
|
||||
gpio_set_pin_level(BOARD_LED0, 1-LED_STATE_ON);
|
||||
@ -103,4 +122,4 @@ uint32_t tusb_hal_millis(void)
|
||||
{
|
||||
return board_tick2ms(system_ticks);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -60,7 +60,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_CTRLA_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE);
|
||||
|
||||
_osc32kctrl_init_sources();
|
||||
_oscctrl_init_sources();
|
||||
|
Loading…
x
Reference in New Issue
Block a user