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"
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. |
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.