This repository has been archived on 2020-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
Jonas Holmberg fc5ca4330c Final adjustments
Added the and adjusted the final part to the scheduler. Added ability to
add task functionality that will run. Updated main file to its intended
state. Further added led functinality along with led warnings.
2016-09-26 08:53:50 +02:00

52 lines
2.2 KiB
C

/**************************************************************************
* NAME: tasks.h *
* *
* AUTHOR: Jonas Holmberg *
* *
* PURPOSE: Defining the the scheduler to be used in the system to *
* organize the runtime for the tasks in the system based on *
* priority. *
* *
* INFORMATION: Adds the initial task values for each task that can be in *
* the system, in the c file. In the h file functions that *
* when called will* perform the action of its corresponding *
* task. *
* *
* GLOBAL VARIABLES: *
* Variable Type Description *
* -------- ---- ----------- *
***************************************************************************/
#ifndef SCHEDULER_TASKS_H_
#define SCHEDULER_TASKS_H_
#include <stdint.h>
#define GetUpdateRateHz(x) (1000000 / x) //x is the desired hz value given in micro seconds
#define GetUpdateRateMs(x) (x*1000) //X is the desired ms value given as micro seconds
#define GetUpdateRateUs(x) (x) //X is the desired us value given as micro seconds (Its the same, used for clarification)
#define GetUpdateRateSeconds(x) (x * 1000000) //X is the desired second value given as micro seconds
//All the task functions in the system, one for each task
void systemTaskSystem(void);
void systemTaskGyroPid(void);
void systemTaskAccelerometer(void);
void systemTaskAttitude(void);
void systemTaskRx(void);
bool systemTaskRxCheck(uint32_t currentDeltaTime);
void systemTaskSerial(void);
void systemTaskBattery(void);
void systemTaskBaro(void);
void systemTaskCompass(void);
void systemTaskGps(void);
void systemTaskSonar(void);
void systemTaskAltitude(void);
void systemTaskBeeper(void);
//Tasks used only for testing purposes
void systemTaskDebug_1(void);
void systemTaskDebug_2(void);
void systemTaskDebug_3(void);
#endif /* SCHEDULER_TASKS_H_ */