nes-proj/cpu/cc2538/dev
Benoît Thébaudeau 5261bb861d cc2538: lpm: Fix RTIMER_NOW() upon wake-up
When returning from PM1/2, the sleep timer value (used by RTIMER_NOW()) is not
up-to-date until a positive edge on the 32-kHz clock has been detected after the
system clock restarted. To ensure an updated value is read, wait for a positive
transition on the 32-kHz clock by polling the SYS_CTRL_CLOCK_STA.SYNC_32K bit,
before reading the sleep timer value.

Because of this RTIMER_NOW() fixup, lpm_exit() has to be called at the very
beginning of ISRs waking up the SoC. This also ensures that all clocks and
timers are enabled at the correct frequency and updated before using them
following wake-up.

Without this fix, etimers could sometimes (randomly, depending on timings)
become ultra slow (observed from 10x to 40x slower than normal) if the system
exited PM1/2 very often. This issue occurred more often with PM1.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-12-05 20:23:29 +01:00
..
ana-regs.h
cc2538-rf.c Added a function for setting promiscous mode on the CC2538 RF core 2013-11-23 15:05:15 +01:00
cc2538-rf.h Added missing argument declaration 2013-11-23 15:05:16 +01:00
flash-cca.h cc2538: Add header file for flash CCA page and use it 2013-12-05 18:45:51 +01:00
gpio.c cc2538: lpm: Fix RTIMER_NOW() upon wake-up 2013-12-05 20:23:29 +01:00
gpio.h cc2538: gpio: Add macros to use GPIO power-up interrupts 2013-11-26 22:10:47 +01:00
gptimer.h
ioc.c
ioc.h
mpu.h
nvic.c
nvic.h
random.c
rfcore-ffsm.h
rfcore-sfr.h
rfcore-xreg.h
rfcore.h
rom-util.h cc2538: Add driver for the rom utility function library 2013-11-18 12:38:06 +01:00
scb.h
smwdthrosc.h
soc-adc.h
spi.c cc2538: Clean up port and pin definitions 2013-11-25 15:00:41 +01:00
ssi.h Added SPI driver for CC2538 2013-09-27 17:46:15 -04:00
sys-ctrl.c cc2538: sys_ctrl: Make it possible to use the 32-kHz crystal 2013-11-15 15:52:10 +01:00
sys-ctrl.h cc2538: sys_ctrl: Make it possible to use the 32-kHz crystal 2013-11-15 15:52:10 +01:00
systick.h
uart1.h
uart.c cc2538: Clean up port and pin definitions 2013-11-25 15:00:41 +01:00
uart.h Make the CC2538 UART driver more configurable 2013-08-09 12:20:25 +01:00
udma.c
udma.h
usb-regs.h
watchdog.c