Use the RTC only as the main timer.

This is a major change to how the main tick interrupt is handled on
the mc1322x platforms. Instead of using two timer resources, TMR0 and
RTC, this patch unifies all the timers to use the RTC. This is enabled by
implementing etimers as scheduled rtimers. The main advantage (aside
from freeing TMR0 for general use) is have the Contiki timebase come
from the same source that will be used for sleeping and wakeup.
This commit is contained in:
Mariano Alvira 2013-02-03 14:50:30 -05:00
parent ad55ccdec4
commit fb8bbf37cf
9 changed files with 128 additions and 233 deletions

View file

@ -72,7 +72,7 @@ void rtc_init_osc(int use_32khz)
continue;
/* RTC has started up */
rtc_freq = 32000;
rtc_freq = 32768;
}
else
{
@ -168,7 +168,7 @@ void rtc_calibrate(void)
uint32_t count;
if (__use_32khz) {
rtc_freq = 32000;
rtc_freq = 32768;
return;
}