Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: clock.txt
- Revision:
- 40:53666b1a5848
- Parent:
- 39:5b594b1b6a0a
--- a/clock.txt Mon Dec 03 12:50:10 2018 +0000 +++ b/clock.txt Tue Dec 04 12:26:27 2018 +0000 @@ -1,28 +1,34 @@ The clock library provides a number of separate functions: -* "timer" A high resolution timer which wraps around after 44 seconds from which all the time is derived. -* "ticks" A low resolution timer to use for elapsed time (configurable but currently set up at 20ms with wrap around every year -* "scan" Calculates the max, min and average scan times. -* "rtc" A real time clock to provide backup -* "tm" Routines to manipulate struct tm local and utc times -* "clock" A clock which is synchronised to an external source +* "hrtimer" An unsigned 32bit high resolution timer which wraps around every 44 seconds from which all the time is derived. +* "mstimer" An unsigned 32bit low resolution timer which wraps around every 49 days +* "clktimer" A signed 64bit utc linked timer which doesn't wrap (or not until 2242 when clock time breaks) +* "scan" Calculates the max, min and average scan times. +* "rtc" A real time clock to provide backup +* "tm" Routines to manipulate struct tm local and utc times +* "clock" A clock which is synchronised to an external source High resolution timer ===================== -timer.c uses TIM0 as a 32bit timer which counts at the cpu frequency 96MHz and rolls over after about 44s. +hrtimer.c uses TIM0 as a 32bit timer which counts at the cpu frequency 96MHz and rolls over after about 44s. It has an init routine called from ClockInit to start it, thereafter it free runs. No dependancies. -Low resolution elapsed time -=========================== +Millisecond timer +================= mstimer.c uses the high resolution timer to count the number of ms since power up. Its unsigned 32bit count rolls over after about 49 days. It has a main routine called from ClockMain. Depends on timer. +Clock timer +=========== +clktimer.h uses the signed 64 bit clock time. +Depends on clock and hence hrtimer. + Scan times ========== scan.c uses the high resolution timer to calculate the max, min and average scan times. It has a main routine called from ClockMain. -Depends on timer. +Depends on hrtimer. Real time clock ===============