Stepper-Motor-Control
v3.0.0
System on a Chip 2014 - Group 04
|
Source code of heartbeatTask which shows that scheduling is working. Also used for debuging. More...
#include "../INC/heartbeatTask.h"
Go to the source code of this file.
Functions | |
void | HeartbeatTask (void *pdata) |
The task for the hearbeat and the debug-mode. More... | |
void | nextHeartbeatStep (heartbeatState_t *heartbeatStatePtr) |
State machine for the heartbeat. More... | |
void | debugAndHeartbeat (heartbeatState_t *heartbeatStatePtr) |
This function implements the debug-logic. More... | |
Variables | |
OS_FLAG_GRP * | heartbeatTaskFlagsGrp |
The flags group used in the heartbeat-task and user-input-task. More... | |
Source code of heartbeatTask which shows that scheduling is working. Also used for debuging.
v0.1.0 30.10.2014 Riedel
v0.1.1 31.10.2014 Riedel
v0.1.2 31.10.2014 Riedel & Kossmann
v0.1.3 02.11.2014 Riedel
v1.0.0 11.11.2014 Riedel & Kossmann
Definition in file heartbeatTask.c.
void debugAndHeartbeat | ( | heartbeatState_t * | heartbeatStatePtr | ) |
This function implements the debug-logic.
In Debug-mode, the registers are read and set in predefined intervals. It automatically calls the nextHeartbeatStep()-function to change the states.
subfunction | state |
---|---|
next heartbeat-step | every |
check Run-Bit in ctrlReg | every |
check Dir-Bit in ctrlReg | every |
set stepsReg (+10 / -10) | every |
set IR-Bit in ctrlReg | FOURTH |
heartbeatStatePtr | Points to the state-structure containing the actual state. |
Definition at line 84 of file heartbeatTask.c.
void HeartbeatTask | ( | void * | pdata | ) |
The task for the hearbeat and the debug-mode.
This task is doing a heartbeat to show scheduling is working. Therefore changes its state every second via the nextHeartbeatStep()-function. When the UserInputTask detects, that the user activated the Debug-Mode, it sends the DEBUG_ON_EVENT. The task then calls the debugAndHeartbeat()-function.
pdata | : Pointer to parameter structure (not used) |
Definition at line 29 of file heartbeatTask.c.
void nextHeartbeatStep | ( | heartbeatState_t * | heartbeatStatePtr | ) |
State machine for the heartbeat.
The state machine activates and deactivates the red LED9 and shows the defined HEX-values (LOWER_O, UPPER_O and LINE) on HEX3 accordingly after 1 second.
heartbeatStatePtr | Points to the state-structure containing the actual state. |
Definition at line 56 of file heartbeatTask.c.