piti Guest
|
rtos and rtc |
Posted: Tue Mar 03, 2009 11:40 am |
|
|
Hi, I'd like to implement following: rtc via timer1 interrupt (i will increment a "second" int32 variable to have a simple rtc implementation, e.g.:
Code: | #int_TIMER1
void TIMER1_isr()
Ticker -= 65536; // Decrement ticker by clocks per interrupt
if ( Ticker < 65536 ) // If second has expired
{ Ticker += TIMER1_FREQUENCY; // Increment ticker by clocks per second
Seconds++; // Increment number of seconds
// ONE-SECOND TICK) .....) |
and to use rtos in parallel as well. Now, how to combine these two routines as I am not sure the rtos tasks e.g.:
#task(rate=1000ms,max=100ms)
void Incr_seconds_rtos_task ( );
will do the timing in a precise manner. Thnx. |
|