Stepper-Motor-Control
v3.0.0
System on a Chip 2014 - Group 04
|
Header file for heartbeatTask.c. More...
#include <stdbool.h>
#include "includes.h"
#include "events.h"
#include "hardwareAccess.h"
#include "registerAccess.h"
#include "debugAndErrorOutput.h"
#include "dataTypes.h"
Go to the source code of this file.
Macros | |
#define | LOWER_O (0b1011100) |
represents the letter o in the lower HEX-segments | |
#define | UPPER_O (0b1100011) |
represents the letter o in the upper HEX-segments | |
#define | LINE (0b1000000) |
represents a centered bar in the HEX-segments | |
#define | LED_ON (0x1) |
turn the led on | |
#define | LED_OFF (0x0) |
turn the led off | |
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... | |
Header file for heartbeatTask.c.
Contains defines, includes, typedefs and declarations needed for this task.
v0.1.0 22.10.2014 Kossmann
v0.1.1 30.10.2014 Riedel
v0.1.2 31.10.2014 Riedel
v0.1.3 31.10.2014 Riedel & Kossmann
v0.1.4 02.11.2014 Riedel
v1.0.0 03.11.2014 Kossmann
v1.0.1 13.11. Kossmann
v2.0.0 18.11.2014 Riedel & Kossmann
Definition in file heartbeatTask.h.
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.