Defines | Functions | Variables

timer.c File Reference

Contains system timer ISR for exact time base. More...

#include <avr/io.h>
#include <avr/interrupt.h>
#include "xtypes.h"
#include "global.h"
#include "leds.h"
#include "speed.h"
#include "safety.h"
#include "speaker.h"
#include "timer.h"
Include dependency graph for timer.c:

Go to the source code of this file.

Defines

#define EXPORT
#define OCR_VALUE   ((F_CPU / 64U) / 1000U) - 1U
 Preload value for system timer.

Functions

 ISR (SIG_OUTPUT_COMPARE2A)
 Service routine for timer interrupt.
void timer_Init (void)
 Timer module init function.
UINT8 timer_GetTicks (void)
 Get method for mg_u8TicksOut.
void timer_LockTicks (void)
 Function to create a copy of the time flags.
UINT32 timer_GetSystemTime (void)
 Get method for mg_u32SystemTime.

Variables

static volatile UINT32 mg_u32SystemTime = 0U
 Variable to hold the system time in ms.
static volatile UINT8 mg_u8Ticks = NO_TICK
 Variable to keep time flags.
static UINT8 mg_u8TicksOut = NO_TICK
 Variable used to share time flags with other modules.

Detailed Description

Author:
Philipp Bank
Copyright:
Creative Commons by-nc-sa 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)

This module provides an exact time base for time relevant calculations (revolutions per minute, distance, timeouts) and some flags to execute specific operations at regular intervals.

Definition in file timer.c.