Contiki OS for 6502 based computers
Go to file
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
apps Merge pull request #474 from adamdunkels/push/cleanup-vnc 2013-11-29 05:07:53 -08:00
core Merge pull request #479 from adamdunkels/push/cleanup-xmac-and-lpp 2013-12-04 04:57:27 -08:00
cpu cc2538: lpm: Fix RTIMER_NOW() upon wake-up 2013-12-05 20:23:29 +01:00
doc Merge pull request #250 from karlp/kill-bad-docs 2013-05-22 06:52:50 -07:00
examples Merge pull request #140 from cetic/slip-radio-platforms 2013-12-02 09:23:10 -08:00
platform Merge pull request #478 from ADVANSEE/cc2538-startup-cleanup 2013-12-05 11:07:19 -08:00
regression-tests Remove Sensinode tests from travis 2013-12-03 14:13:40 +00:00
tools Merge pull request #386 from chrta/stm32w_flasher_udev 2013-12-02 09:21:39 -08:00
.gitignore Adjustments for the switch from 'atari' to 'atarixl'. 2013-10-03 23:54:33 +02:00
.gitmodules Added mspsim as a submodule instead of as a binary mspsim.jar file 2013-11-07 17:28:50 +01:00
.travis.yml Merge pull request #453 from adamdunkels/push/travis-fix 2013-11-22 02:36:09 -08:00
LICENSE Removed the explicit year 2012 to make it more generic 2012-10-25 23:08:54 +02:00
Makefile.include Merge pull request #474 from adamdunkels/push/cleanup-vnc 2013-11-29 05:07:53 -08:00
README-BUILDING.md Rename to md 2013-03-26 23:15:37 +01:00
README-EXAMPLES.md Several minor consistency improvements. 2013-07-31 00:55:31 +02:00
README.md Rename to md 2013-03-26 23:15:37 +01:00

The Contiki Operating System

Build Status

Contiki is an open source operating system that runs on tiny low-power microcontrollers and makes it possible to develop applications that make efficient use of the hardware while providing standardized low-power wireless communication for a range of hardware platforms.

Contiki is used in numerous commercial and non-commercial systems, such as city sound monitoring, street lights, networked electrical power meters, industrial monitoring, radiation monitoring, construction site monitoring, alarm systems, remote house monitoring, and so on.

For more information, see the Contiki website:

http://contiki-os.org