SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
Heartbeat Namespace Reference

A module used to both ensure a connection to both ECUs using CAN and to periodically run callbacks. More...

Typedefs

typedef void(* beatFunc) (void)
 Function called each time the heart beats.
 

Functions

void beginBeating ()
 begin sending a beat signal at a set interval
 
void beginReceiving ()
 Set callback to receive beats over CAN.
 
int checkBeat ()
 Poll if a beat has been received.
 
void addCallback (beatFunc func)
 Add a callback to be run at each haertbeat.
 

Detailed Description

A module used to both ensure a connection to both ECUs using CAN and to periodically run callbacks.

Currently, Heartbeat::beginBeating() is run on the back ECU and Heartbeat::beginReceiving() is run on the front ECU.

Heartbeat::checkBeat() must be polled on the front ECU to log whether or not a heart beat is being detected

See also
Heartbeat.def for configuration of this module

Typedef Documentation

◆ beatFunc

typedef void(* Heartbeat::beatFunc) (void)

Function called each time the heart beats.

Definition at line 35 of file Heartbeat.h.

Function Documentation

◆ addCallback()

void Heartbeat::addCallback ( beatFunc  func)

Add a callback to be run at each haertbeat.

Parameters
funcCallback function

◆ checkBeat()

int Heartbeat::checkBeat ( )

Poll if a beat has been received.

Returns
1 if the last beat is within allowed delay, 0 otherwise