ErichStyger / mcuoneclipse

McuOnEclipse Processor Expert components and example projects
Other
731 stars 1.29k forks source link

Kinetis low power timer defines not identical for all processor defs #12

Closed dvelde closed 10 years ago

dvelde commented 10 years ago

When enabling the low power time as the tick timer in low power mode. The port.c file shows the following code:

if configSYSTICK_USE_LOW_POWER_TIMER

SIM_SCGC5 |= SIM_SCGC5_LPTMR_MASK; /* enable clock: SIM_SCGC5: LPTMR=1 */

Some processors (like MK20D5.h) have SIM_SCGC5_LPTIMER_MASK defined (not LPTMR). Some headers even contain both...

dvelde commented 10 years ago

The same define is used in Cpu.c:

if configSYSTICK_USE_LOW_POWER_TIMER

/* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash _/ SIM_SCGC5 |= SIM_SCGC5_LPTMRMASK; / SIM_SCGC5: LPTMR=1 */

ErichStyger commented 10 years ago

Indeed, that stuff is only for the Cortex-M0+ (e.g. KL25Z). Looking into it now how I can make it more generic. Thanks for reporting!

ErichStyger commented 10 years ago

I have now implemented low power timer for M4, see https://github.com/ErichStyger/mcuoneclipse/commit/0e856a0144e8c7b03a382c81b3786bee163064eb I have tested it with my FRDM-K20 board, and that works now. thanks again for reporting!