timer.c File Reference

#include "t89c51cc02.h"
#include "datatypes.h"
#include "timer.h"

Go to the source code of this file.

Functions

void Timer_init ()
 activate main timing interrupt to achieve a 1ms timing
void Timer_interrupt (void)
 keeps time frames for measurements and signals pending measurements in 62ms ticks

Variables

volatile bit measurement_task
 semaphore to signal a pending sensor measurement
BYTE timekeeper


Detailed Description

Definition in file timer.c.


Function Documentation

void Timer_init void   ) 
 

activate main timing interrupt to achieve a 1ms timing

Timer 0 of the T89C51CC02 is used to maintain the timing.

Definition at line 32 of file timer.c.

References measurement_task, timekeeper, TIMER_MILLISECONDS, TIMER_RELOAD_H, and TIMER_RELOAD_L.

Referenced by main().

void Timer_interrupt void   ) 
 

keeps time frames for measurements and signals pending measurements in 62ms ticks

measurement_task is set after the amount of ms specified in TIMER_MILLISECONDS have passed.
The timer keeps running for the whole duty cycle of the sensor measurement.

Definition at line 56 of file timer.c.

References measurement_task, timekeeper, TIMER_MILLISECONDS, TIMER_RELOAD_H, and TIMER_RELOAD_L.


Variable Documentation

volatile bit measurement_task
 

semaphore to signal a pending sensor measurement

The semaphore is to be set from the main Timer ISR exclusively.
It is cleared after sampling all sensors.

Definition at line 22 of file timer.c.

Referenced by main(), Timer_init(), and Timer_interrupt().

BYTE timekeeper
 

keeps the amount of milliseconds left until another sampling run has to be scheduled

Definition at line 25 of file timer.c.

Referenced by Timer_init(), and Timer_interrupt().


Generated on Wed Oct 24 12:57:24 2007 for SensorControl by  doxygen 1.4.6