Skip to content
Snippets Groups Projects
Commit 172af17a authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

kinetis: Conditionally enable MCG

parent 4b7f85de
No related branches found
No related tags found
No related merge requests found
FEATURES_PROVIDED += periph_cpuid FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_hwrng FEATURES_PROVIDED += periph_hwrng
FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_mcg
include $(RIOTCPU)/cortexm_common/Makefile.features include $(RIOTCPU)/cortexm_common/Makefile.features
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
#include "cpu.h" #include "cpu.h"
#include "periph/init.h" #include "periph/init.h"
#ifdef MODULE_PERIPH_MCG
#include "mcg.h" #include "mcg.h"
#endif
/** /**
* @brief Initialize the CPU, set IRQ priorities * @brief Initialize the CPU, set IRQ priorities
...@@ -33,8 +35,10 @@ void cpu_init(void) ...@@ -33,8 +35,10 @@ void cpu_init(void)
/* Note: This register can only be written once after each reset, so we must /* Note: This register can only be written once after each reset, so we must
* enable all power modes that we wish to use. */ * enable all power modes that we wish to use. */
SMC->PMPROT |= SMC_PMPROT_ALLS_MASK | SMC_PMPROT_AVLP_MASK; SMC->PMPROT |= SMC_PMPROT_ALLS_MASK | SMC_PMPROT_AVLP_MASK;
#ifdef MODULE_PERIPH_MCG
/* initialize the CPU clocking provided by the MCG module */ /* initialize the CPU clocking provided by the MCG module */
kinetis_mcg_init(); kinetis_mcg_init();
#endif
/* trigger static peripheral initialization */ /* trigger static peripheral initialization */
periph_init(); periph_init();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment