Allow overriding of DCDC settings per target

Allow custom targets to override the DCDC settings by defining EMU_DCDCINIT_STK_DEFAULT to target-specific initialization values.
pull/5855/head
Steven Cooreman 2018-01-15 16:13:15 +01:00
parent b59005154b
commit 18c973f132
6 changed files with 31 additions and 2 deletions

View File

@ -54,4 +54,9 @@
cmuOscMode_Crystal, \
}
#endif
/* DCDC settings */
#if !defined(EMU_DCDCINIT_STK_DEFAULT)
#define EMU_DCDCINIT_STK_DEFAULT EMU_DCDCINIT_DEFAULT
#endif
#endif

View File

@ -54,4 +54,9 @@
cmuOscMode_Crystal, \
}
#endif
/* DCDC settings */
#if !defined(EMU_DCDCINIT_STK_DEFAULT)
#define EMU_DCDCINIT_STK_DEFAULT EMU_DCDCINIT_DEFAULT
#endif
#endif

View File

@ -54,4 +54,9 @@
cmuOscMode_Crystal, \
}
#endif
/* DCDC settings */
#if !defined(EMU_DCDCINIT_STK_DEFAULT)
#define EMU_DCDCINIT_STK_DEFAULT EMU_DCDCINIT_DEFAULT
#endif
#endif

View File

@ -54,4 +54,9 @@
cmuOscMode_Crystal, \
}
#endif
/* DCDC settings */
#if !defined(EMU_DCDCINIT_STK_DEFAULT)
#define EMU_DCDCINIT_STK_DEFAULT EMU_DCDCINIT_DEFAULT
#endif
#endif

View File

@ -54,4 +54,9 @@
cmuOscMode_Crystal, \
}
#endif
/* DCDC settings */
#if !defined(EMU_DCDCINIT_STK_DEFAULT)
#define EMU_DCDCINIT_STK_DEFAULT EMU_DCDCINIT_DEFAULT
#endif
#endif

View File

@ -39,9 +39,13 @@ void mbed_sdk_init()
CHIP_Init();
#if defined(_SILICON_LABS_32B_SERIES_1)
EMU_DCDCInit_TypeDef dcdcInit = EMU_DCDCINIT_DEFAULT;
#if defined(EMU_NO_DCDC)
EMU_DCDCPowerOff();
#else
EMU_DCDCInit_TypeDef dcdcInit = EMU_DCDCINIT_STK_DEFAULT;
EMU_DCDCInit(&dcdcInit);
#endif
#if (CORE_CLOCK_SOURCE == HFXO)
// Only init HFXO if not already done (e.g. by bootloader)
if (CMU_ClockSelectGet(cmuClock_HF) != cmuSelect_HFXO) {