Bar Logo Dual Active Bridge Development Board (Part-No. )
 
Content
     
Loading...
Searching...
No Matches
main_tasks.c
1
2//=======================================================================================================
3// @file main_tasks.c
4// @ingroup sched-layer
5// @brief Contains the application specific tasks that are called regularly by the os_scheduler
6// @details Contains the application specific tasks that are called regularly by the os_scheduler
7// two different timings priorities are available:
8// 1. 1ms Tasks called from the os_scheduler interrupt
9// the jitter that you will have in the 1ms realtime tasks called by the interrupt depends
10// on other interrupts that have a higher interrupt priority
11// 2. 1ms, 10ms, 100ms, 1s Tasks called from the main loop
12// these tasks are for soft realtime and not for hard realtime
13// so in average they are called with the required timing but the jitter can be very huge,
14// depending on the calls before.
15// use this for your non-timing critical application state machines
16//
17// @note you might consider to implement a watchdog and put the watchdog triggering into some Task
18//
19// @version v1.0
20// @date 2019-08-09
21// @author M52409
22//
23//=======================================================================================================
24
25#include <stdint.h>
26#include <stddef.h>
27#include <xc.h>
28
29#include "os/os_config.h"
30#include "os/os_sys_time.h"
31#include "os/os_scheduler.h"
32
34#include "comm/PBV_interface.h"
35#include "device/dev_fan.h"
36#include "device/dev_led.h"
37#include "device/dev_temp.h"
39#include "pwrctrl/pwrctrl.h"
40#include "fault/fault.h"
41
42#include "system/pins.h"
43
44//=======================================================================================================
45//
46// put your application specific code in the following functions:
47// choose wisely between real-time and non-realtime!
48//
49// Interrupt Realtime Functions:
50// Tasks_Realtime_1ms : is called by the interrupt every ms - for time critical low jitter stuff
51//
52//
53// Mainloop Non-Realtime Functions:
54// Tasks_1ms : function is called by the main loop in average every 1ms
55// Tasks_10ms : function is called by the main loop in average every 10ms
56// Tasks_100ms : function is called by the main loop in average every 100ms
57// Tasks_1s : function is called by the main loop in average every second
58//
59// @note there could be some jitter here because it is not called directly by a timer interrupt
60// the timing in average is exact (keep in mind: in average), the jitter depends on the
61// called functions before
62//=======================================================================================================
63
64#if defined (OS_USE_SCHEDULER_100us) && (OS_USE_SCHEDULER_100us == true)
65//=======================================================================================================
70//=======================================================================================================
71/* The task functions would be written by the user who uses this scheduler in
72 the application. Hence 65 D is being excluded. */
73/* LDRA_EXCLUDE 65 D */
74void Tasks_Realtime_100us(void)
75{
76 // Execute the power control state machine
78
79}
80#endif /* OS_USE_SCHEDULER_100us */
81//=======================================================================================================
86//=======================================================================================================
87/* The task functions would be written by the user who uses this scheduler in
88 the application. Hence 65 D is being excluded. */
89/* LDRA_EXCLUDE 65 D */
91{
92
93}
94
95#if defined (OS_USE_SCHEDULER_100us) && (OS_USE_SCHEDULER_100us == true)
96//=======================================================================================================
101//=======================================================================================================
102/* LDRA_EXCLUDE 65 D */
103void Tasks_100us(void)
104{
106}
107#endif /* OS_USE_SCHEDULER_100us */
108//=======================================================================================================
113//=======================================================================================================
114/* LDRA_EXCLUDE 65 D */
115void Tasks_1ms(void)
116{
117
118}
119
120//=======================================================================================================
125//=======================================================================================================
126/* LDRA_EXCLUDE 65 D */
127void Tasks_10ms(void)
128{
131
132}
133
134extern uint16_t os_resetCause;
135//=======================================================================================================
140//=======================================================================================================
148
149//=======================================================================================================
154//=======================================================================================================
155void Tasks_1s(void)
156{
159}
160
161//=======================================================================================================
168//=======================================================================================================
169/* LDRA_EXCLUDE 65 D */
171{
172
173}
app PBV DAB Frame map file Example
Contains current sensor public functions.
fan device driver
led device driver
Contains temperature initialization and execution functions.
Contains public fault functions.
void App_PBV_Task_100us()
Task to be executed every 100 us.
void App_PBV_Task_10ms()
task to be executed every 10ms
void App_PBV_DAB_Task_10ms(void)
10ms PBV task to be execution
void App_PBV_DAB_Task_1s(void)
1 second PBV task to be execution
void Dev_Fan_Task_100ms(void)
this function needs to be called every 100ms it contains the code to update the status of the fan
Definition dev_fan.c:76
void Dev_Fan_Task_1s(void)
This function needs to be called every 1s to keep the temperature of the board at a certain temperatu...
Definition dev_fan.c:110
void Dev_LED_Task_100ms()
This function needs to be called every 100ms and contains the code to update the status of the LEDs.
Definition dev_led.c:224
void Dev_Temp_Task_100ms(void)
Executes the Temperature reading every 100ms.
Definition dev_temp.c:60
void PwrCtrl_Execute(void)
Executes the power control state machine.
Definition pwrctrl.c:88
void Fault_Execute_100ms(void)
Fault evaluation for Temperature and other slow fault detection executed every 100ms.
Definition fault.c:311
void Tasks_10ms(void)
Tasks_10ms gets called every 10ms, put your things in it that need to be called regularly.
Definition main_tasks.c:127
void Tasks_1ms(void)
Tasks_1ms gets called every millisecond, put your things in it that need to be called regularly.
Definition main_tasks.c:115
void Tasks_Realtime_1ms(void)
Tasks_Realtime_1ms gets called directly from the timer interrupt every millisecond.
Definition main_tasks.c:90
void Tasks_100ms(void)
Tasks_100ms gets called every 100 ms, put your things in it that need to be called regularly.
Definition main_tasks.c:141
void Tasks_Background(void)
Tasks_Background gets called all the time when no other of the above tasks are being called.
Definition main_tasks.c:170
void Tasks_1s(void)
Tasks_1s gets called every second, put your things in it that need to be called regularly.
Definition main_tasks.c:155