fremoclock  1_3A01
FREMO Clock - Software for UTG
SysHwTimer.c File Reference

Hardware dependent timer module for Atmel AVR. More...

Go to the source code of this file.

Macros

#define USE_TIMER_0
 
#define TIMER_INT_VECT_COMP   TIMER0_COMP_vect
 

Functions

void HwTimerInit (void)
 Initialize the hardware time. More...
 
uint32_t HwTimerGetValue (void)
 Get the value of globalTimer variable guarded by disable/enable interrupts. More...
 
 ISR (TIMER_INT_VECT_COMP)
 Interrupt service routine for timer interrupt. More...
 

Variables

static uint32_t ulGlobalTimer = 0
 Gets incremented every TIMER_RESOLUTION_MS milliseconds by interrupt. More...
 

Detailed Description

Hardware dependent timer module for Atmel AVR.

Supplies a tick count.

History:

  • 2002-12-14 sb:Stolen idea and prototypes from TD. and implemented Atmel AVR version.
  • 2002-01-01 sb:Another version that now supports either Timer 0 or Timer 2 (ATmega only!)
  • 2002-01-05 sb:Make HwTimerGetValue() atomic.
  • 2007-01-01 ba: Copied from sb HwTimer and modified to get a timertick of 1mS as precise as possible. For a first step we use Timer0 in outputcapture- mode. The function names have not been changed for ease of use with sb timer.h
  • 2007-01-20 ba: Added declarations and functions for FREMOClock
  • 2007-02-11 ba: Added code for generation of pulses for clock line
  • 2007-02-25 ba: Removed all specific functions and code. Only PushButton and SysTimerUserInterupt are called. All user specific code should be added in
  • 2008-03-16 ba: Fixed error in Timercomparevalue 250->249
  • 2015-04-24 StS: Remove unnecessary whitespace and change to unified format
Version
$Id: SysHwTimer.c 159 2016-09-03 06:51:47Z pischky $
Author
Stefan Bormann
Bernd Wisotzki

Definition in file SysHwTimer.c.

Macro Definition Documentation

#define TIMER_INT_VECT_COMP   TIMER0_COMP_vect

Definition at line 78 of file SysHwTimer.c.

#define USE_TIMER_0

Definition at line 55 of file SysHwTimer.c.

Function Documentation

uint32_t HwTimerGetValue ( void  )

Get the value of globalTimer variable guarded by disable/enable interrupts.

Returns
the value of globalTimer

Definition at line 210 of file SysHwTimer.c.

void HwTimerInit ( void  )

Initialize the hardware time.

Called from main before interrupts are enabled .

Definition at line 115 of file SysHwTimer.c.

Interrupt service routine for timer interrupt.

Runs with global interrupts disabled.

Definition at line 223 of file SysHwTimer.c.

Here is the call graph for this function:

Variable Documentation

uint32_t ulGlobalTimer = 0
static

Gets incremented every TIMER_RESOLUTION_MS milliseconds by interrupt.

Read by other parts of the program with HwTimerGetValue.

Definition at line 89 of file SysHwTimer.c.