kinetis: Conditionally enable MCG
This commit is contained in:
parent
4b7f85de75
commit
172af17ae4
@ -1,5 +1,6 @@
|
|||||||
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 @@
|
|||||||
|
|
||||||
#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)
|
|||||||
/* 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();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user