The official git repository for OSD-Contiki, the open source OS for the Internet of Things
b7515004da
Whole elapsed seconds are added to secs first, so only the remaining subsecond ticks should then be subtracted from second_countdown in order to decide whether secs should be incremented again. Otherwise, secs is not correctly updated in some cases, typically if the bit 7 of ticks is 1. E.g., with ticks = 128 (i.e. exactly 1 s elapsed) and second_countdown = 128, secs was first incremented as expected, then 128 was subtracted from second_countdown, giving 0 and triggering an unwanted second increment of secs. Or with ticks = 129 (i.e. 1 s + 1 tick) and second_countdown = 1, secs was first incremented as expected, then 129 was subtracted from second_countdown, giving 128 and missing a second increment of secs that should have occurred because second_countdown wrapped around. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> |
||
---|---|---|
apps | ||
core | ||
cpu | ||
doc | ||
examples | ||
platform | ||
regression-tests | ||
tools | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
LICENSE | ||
Makefile.include | ||
README-BUILDING.md | ||
README-EXAMPLES.md | ||
README.md |
The Contiki Operating System
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: