25 #include "../INC/heartbeatTask.h"
31 OS_FLAGS heartbeatFlag;
38 OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, 10, &err);
39 if (OS_NO_ERR != err && OS_TIMEOUT != err) {
40 error(
"There was an error while waiting for the event!");
57 switch (*heartbeatStatePtr) {
61 *heartbeatStatePtr = SECOND;
66 *heartbeatStatePtr = THIRD;
71 *heartbeatStatePtr = FOURTH;
76 *heartbeatStatePtr = FIRST;
81 OSTimeDlyHMSM(0, 0, 1, 0);
86 uint8_t stepCounter = 0;
88 while (stepCounter < 4) {
#define CTRL_REG_LR_MSK
Left (0) or Right (1)-Bit.
enum heartbeatState heartbeatState_t
The state-machine for the heartbeat.
static __inline__ void stepsRegSet(uint32_t newStepCount)
Sets the given steps for the Stepper-Motor-Control VHDL-component.
heartbeatState
The state-machine for the heartbeat.
#define error(...)
Prints the Error-messages in the terminal.
#define LED_ON
turn the led on
static __inline__ void ctrlRegBitSet(uint8_t bitsToSet)
Sets the CtrlReg bitwise.
#define DEBUG_OFF_EVENT
deactivates the debug-mode via sw_9
#define UPPER_O
represents the letter o in the upper HEX-segments
#define CTRL_REG_IR_MSK
Interrupt-Request Bit.
static __inline__ void PIO_HEX3_Set(uint32_t segmentValues)
Function to set segments on hex3 display.
static __inline__ void PIO_LED9_Set(uint32_t ledValue)
Function to set led9 for heartbeat.
#define debug(...)
Prints Debug-messages in the terminal.
#define LOWER_O
represents the letter o in the lower HEX-segments
#define DEBUG_ON_EVENT
activates the debug-mode via sw_9
#define CTRL_REG_RS_MSK
Run (1) or Stop (0)-Bit.
static __inline__ uint32_t stepsRegGet(void)
Returns the actual content of the steps-register.
void HeartbeatTask(void *pdata)
The task for the hearbeat and the debug-mode.
#define LINE
represents a centered bar in the HEX-segments
OS_FLAG_GRP * heartbeatTaskFlagsGrp
The flags group used in the heartbeat-task and user-input-task.
void nextHeartbeatStep(heartbeatState_t *heartbeatStatePtr)
State machine for the heartbeat.
#define LED_OFF
turn the led off
static __inline__ uint8_t ctrlRegGet(void)
Returns the actual content of the control-register.
void debugAndHeartbeat(heartbeatState_t *heartbeatStatePtr)
This function implements the debug-logic.