cpu: efm32_common: use board defined EMU/CMU settings#8165
cpu: efm32_common: use board defined EMU/CMU settings#8165haukepetersen merged 1 commit intoRIOT-OS:masterfrom
Conversation
| * @{ | ||
| */ | ||
| #ifndef CMU_HFXOINIT | ||
| #define CMU_HFXOINIT CMU_HFXOINIT_DEFAULT |
There was a problem hiding this comment.
here and below: why define the default values for each board? Wouldn't it be much cleaner (and better scalable) to define the default values in cpu/efm32_common/cpu.c:
#ifndef CMU_xx
#define CMU_xx CMU_xx_DEFAULT
#endifThis way a board would only need to define these values if the board actually does not use the default values...
There was a problem hiding this comment.
I can also place them inline, for instance:
#ifdef _SILICON_LABS_32B_SERIES_1
static void dcdc_init(void)
{
#ifdef EMU_DCDCINIT
EMU_DCDCInit_TypeDef init_dcdc = EMU_DCDCINIT;
#else
EMU_DCDCInit_TypeDef init_dcdc = EMU_DCDCINIT_DEFAULT;
#endif
EMU_DCDCInit(&init_dcdc);
}
#endifAdded benefit: cpu.c is more to the point. What would be your preference?
There was a problem hiding this comment.
I personally prefer not to inline these things and have ifdef blocks in the beginning of the file. This makes the code much more readable.
1565949 to
5a675a0
Compare
|
Fixed comments + rebase. |
|
please squash and trigger Murdock |
5a675a0 to
2950300
Compare
2950300 to
be24c66
Compare
|
Rebased to include #8175 (no changes to PR). |
|
ACK holds, Murdock is happy -> go |
This is split-off #8139.
This PR allows one to define differen Energy Management Unit (EMU) and Clock Management Unit (CMU) settings on a per-board basis.
The defaults are good enough in most cases, but you need other values for radio support.