Stepper-Motor-Control  v3.0.0
System on a Chip 2014 - Group 04
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
heartbeatTask.c File Reference

Source code of heartbeatTask which shows that scheduling is working. Also used for debuging. More...

Include dependency graph for heartbeatTask.c:

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...
 

Detailed Description

Source code of heartbeatTask which shows that scheduling is working. Also used for debuging.

Author
Michael Riedel
Marc Kossmann
Version
v1.0.0
Date
11.11.2014
History:

v0.1.0 30.10.2014 Riedel

  • first draft for milestone 1b

v0.1.1 31.10.2014 Riedel

  • added hardware-access to heartbeat

v0.1.2 31.10.2014 Riedel & Kossmann

  • finilized heartbeat functionality

v0.1.3 02.11.2014 Riedel

  • finalized Debug functionality

v1.0.0 11.11.2014 Riedel & Kossmann

  • switched stepsReg-inc/dec in debug-mode

Definition in file heartbeatTask.c.

Function Documentation

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
Parameters
heartbeatStatePtrPoints to the state-structure containing the actual state.

Definition at line 84 of file heartbeatTask.c.

Here is the call graph for this function:

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.

Parameters
pdata: Pointer to parameter structure (not used)

Definition at line 29 of file heartbeatTask.c.

Here is the call graph for this function:

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.

Parameters
heartbeatStatePtrPoints to the state-structure containing the actual state.

Definition at line 56 of file heartbeatTask.c.

Here is the call graph for this function:

Variable Documentation

OS_FLAG_GRP* heartbeatTaskFlagsGrp

The flags group used in the heartbeat-task and user-input-task.

This group contains the debug-event that can be triggered via sw_9.

Definition at line 42 of file events.h.