Pedal ISR and methods to get pedaling frequency. More...
#include <avr/io.h>
#include <avr/interrupt.h>
#include "xtypes.h"
#include "global.h"
#include "timer.h"
#include "memory.h"
#include "pedal.h"
Go to the source code of this file.
Defines | |
#define | EXPORT |
#define | PEDAL_INT_ENABLE() EIMSK |= (1<<INT1); |
This macro enables the pedal interrupt. | |
#define | PEDAL_INT_DISABLE() EIMSK &= ~(1<<INT1); |
This macro enables the pedal interrupt. | |
Functions | |
ISR (SIG_INTERRUPT1) | |
Service routine for pedal sensor interrupt. | |
void | pedal_Init (void) |
Init function of the pedal module. | |
UINT32 | pedal_GetTimeout (void) |
Check and get method for pedal timeout. | |
UINT32 | pedal_GetRpm (void) |
Get method for mg_u32Rpm. | |
Variables | |
static volatile UINT32 | mg_u32TickTime |
Variable to keep a timestamp of the last pedal interrupt. | |
static volatile UINT32 | mg_u32Rpm |
This variable holds the value of pedal revolutions per minute. | |
static UINT8 | mg_u8NumMagnetsPedal = DEFAULT_MAGNET_NUMBER_PEDAL |
UINT8 variable to keep the number of pedal reed switch magnets. |
This module contains an interrupt service routine for the pedal sensor signal and methods to calculate the pedaling frequency.
Definition in file pedal.c.