|
|
|
|
|
|
|
|
#elif F_CPU == 16000000 |
|
|
#elif F_CPU == 16000000 |
|
|
// config divisors: 16 MHz core, 16 MHz bus, 16 MHz flash |
|
|
// config divisors: 16 MHz core, 16 MHz bus, 16 MHz flash |
|
|
#if defined(KINETISK) |
|
|
#if defined(KINETISK) |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV2(0) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
|
|
|
|
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV2(0) | SIM_CLKDIV1_OUTDIV3(0) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
#elif defined(KINETISL) |
|
|
#elif defined(KINETISL) |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
#endif |
|
|
#endif |
|
|
#elif F_CPU == 8000000 |
|
|
#elif F_CPU == 8000000 |
|
|
// config divisors: 8 MHz core, 8 MHz bus, 8 MHz flash |
|
|
// config divisors: 8 MHz core, 8 MHz bus, 8 MHz flash |
|
|
#if defined(KINETISK) |
|
|
#if defined(KINETISK) |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(1) | SIM_CLKDIV1_OUTDIV2(1) | SIM_CLKDIV1_OUTDIV4(1); |
|
|
|
|
|
|
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(1) | SIM_CLKDIV1_OUTDIV2(1) | SIM_CLKDIV1_OUTDIV3(1) | SIM_CLKDIV1_OUTDIV4(1); |
|
|
#elif defined(KINETISL) |
|
|
#elif defined(KINETISL) |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(1) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(1) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
// here we can go into vlpr? |
|
|
// here we can go into vlpr? |
|
|
// config divisors: 4 MHz core, 4 MHz bus, 4 MHz flash |
|
|
// config divisors: 4 MHz core, 4 MHz bus, 4 MHz flash |
|
|
#if defined(KINETISK) |
|
|
#if defined(KINETISK) |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(3) | SIM_CLKDIV1_OUTDIV2(3) | SIM_CLKDIV1_OUTDIV4(3); |
|
|
|
|
|
|
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(3) | SIM_CLKDIV1_OUTDIV2(3) | SIM_CLKDIV1_OUTDIV3(3) | SIM_CLKDIV1_OUTDIV4(3); |
|
|
#elif defined(KINETISL) |
|
|
#elif defined(KINETISL) |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(3) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
SIM_CLKDIV1 = SIM_CLKDIV1_OUTDIV1(3) | SIM_CLKDIV1_OUTDIV4(0); |
|
|
#endif |
|
|
#endif |