kinetis: Conditionally enable MCG

This commit is contained in:
Joakim Nohlgård 2018-06-30 19:12:47 +02:00
parent 4b7f85de75
commit 172af17ae4
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,6 @@
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_hwrng
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_mcg
include $(RIOTCPU)/cortexm_common/Makefile.features

View File

@ -19,7 +19,9 @@
#include "cpu.h"
#include "periph/init.h"
#ifdef MODULE_PERIPH_MCG
#include "mcg.h"
#endif
/**
* @brief Initialize the CPU, set IRQ priorities
@ -33,8 +35,10 @@ void cpu_init(void)
/* Note: This register can only be written once after each reset, so we must
* enable all power modes that we wish to use. */
SMC->PMPROT |= SMC_PMPROT_ALLS_MASK | SMC_PMPROT_AVLP_MASK;
#ifdef MODULE_PERIPH_MCG
/* initialize the CPU clocking provided by the MCG module */
kinetis_mcg_init();
#endif
/* trigger static peripheral initialization */
periph_init();
}