diff options
author | Kaleb Elwert <belak@coded.io> | 2017-11-04 10:41:06 -0700 |
---|---|---|
committer | Kaleb Elwert <belak@coded.io> | 2017-11-04 10:41:06 -0700 |
commit | 96413f3767eeae21534946e4fb8b732cc1074039 (patch) | |
tree | d667c2ec338da6757085eca88670f0652f740d2f | |
parent | e1311c4db6cd366cf760673f769e925741ac0ad3 (diff) | |
download | ChibiOS-Contrib-96413f3767eeae21534946e4fb8b732cc1074039.tar.gz ChibiOS-Contrib-96413f3767eeae21534946e4fb8b732cc1074039.tar.bz2 ChibiOS-Contrib-96413f3767eeae21534946e4fb8b732cc1074039.zip |
Fix for K20x startup
-rw-r--r-- | os/hal/ports/KINETIS/K20x/hal_lld.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/os/hal/ports/KINETIS/K20x/hal_lld.c b/os/hal/ports/KINETIS/K20x/hal_lld.c index e6eeed8..594f7af 100644 --- a/os/hal/ports/KINETIS/K20x/hal_lld.c +++ b/os/hal/ports/KINETIS/K20x/hal_lld.c @@ -148,11 +148,10 @@ void k20x_clock_init(void) { * frequency, which would required other registers to be modified.
*/
/* Enable OSC, low power mode */
- MCG->C2 = MCG_C2_LOCRE0 | MCG_C2_EREFS0;
if (KINETIS_XTAL_FREQUENCY > 8000000UL)
- MCG->C2 |= MCG_C2_RANGE0(2);
+ MCG->C2 = MCG_C2_LOCRE0 | MCG_C2_EREFS0 | MCG_C2_RANGE0(2);
else
- MCG->C2 |= MCG_C2_RANGE0(1);
+ MCG->C2 = MCG_C2_LOCRE0 | MCG_C2_EREFS0 | MCG_C2_RANGE0(1);
frdiv = 7;
ratio = KINETIS_XTAL_FREQUENCY / 31250UL;
|