UCOS_TI_LM3S_Keil
首页
相关页面
结构体
文件
文件列表
全局定义
全部
结构体
文件
函数
变量
类型定义
宏定义
页
os_app_hooks.c
浏览该文件的文档.
1
/*
2
*********************************************************************************************************
3
* uC/OS-II
4
* The Real-Time Kernel
5
*
6
*
7
* (c) Copyright 2006, Micrium, Weston, FL
8
* All Rights Reserved
9
*
10
* APPLICATION HOOKS
11
*
12
* File : OS_APP_HOOKS.C
13
* By : JJL
14
* Version : V2.89
15
*********************************************************************************************************
16
*/
17
18
#include <
bsp.h
>
19
20
#include <
cpu.h
>
21
#include <
cpu_core.h
>
22
23
#include <
ucos_ii.h
>
24
25
#if (OS_APP_HOOKS_EN > 0)
26
/*
27
*********************************************************************************************************
28
* TASK CREATION HOOK (APPLICATION)
29
*
30
* Description : This function is called when a task is created.
31
*
32
* Argument(s) : ptcb is a pointer to the task control block of the task being created.
33
*
34
* Note(s) : (1) Interrupts are disabled during this call.
35
*********************************************************************************************************
36
*/
37
38
void
App_TaskCreateHook
(
OS_TCB
*ptcb)
39
{
40
41
}
42
43
/*
44
*********************************************************************************************************
45
* TASK DELETION HOOK (APPLICATION)
46
*
47
* Description : This function is called when a task is deleted.
48
*
49
* Argument(s) : ptcb is a pointer to the task control block of the task being deleted.
50
*
51
* Note(s) : (1) Interrupts are disabled during this call.
52
*********************************************************************************************************
53
*/
54
55
void
App_TaskDelHook
(
OS_TCB
*ptcb)
56
{
57
(void)ptcb;
58
}
59
60
/*
61
*********************************************************************************************************
62
* IDLE TASK HOOK (APPLICATION)
63
*
64
* Description : This function is called by OSTaskIdleHook(), which is called by the idle task. This hook
65
* has been added to allow you to do such things as STOP the CPU to conserve power.
66
*
67
* Argument(s) : none.
68
*
69
* Note(s) : (1) Interrupts are enabled during this call.
70
*********************************************************************************************************
71
*/
72
73
void
App_TaskIdleHook
(
void
)
74
{
75
76
}
77
78
/*
79
*********************************************************************************************************
80
* TASK RETURN HOOK (APPLICATION)
81
*
82
* Description: This function is called if a task accidentally returns. In other words, a task should
83
* either be an infinite loop or delete itself when done.
84
*
85
* Arguments : ptcb is a pointer to the task control block of the task that is returning.
86
*
87
* Note(s) : none
88
*********************************************************************************************************
89
*/
90
91
void
App_TaskReturnHook
(
OS_TCB
*ptcb)
92
{
93
94
}
95
96
/*
97
*********************************************************************************************************
98
* STATISTIC TASK HOOK (APPLICATION)
99
*
100
* Description : This function is called by OSTaskStatHook(), which is called every second by uC/OS-II's
101
* statistics task. This allows your application to add functionality to the statistics task.
102
*
103
* Argument(s) : none.
104
*********************************************************************************************************
105
*/
106
107
void
App_TaskStatHook
(
void
)
108
{
109
110
}
111
112
/*
113
*********************************************************************************************************
114
* TASK SWITCH HOOK (APPLICATION)
115
*
116
* Description : This function is called when a task switch is performed. This allows you to perform other
117
* operations during a context switch.
118
*
119
* Argument(s) : none.
120
*
121
* Note(s) : (1) Interrupts are disabled during this call.
122
*
123
* (2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
124
* will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the
125
* task being switched out (i.e. the preempted task).
126
*********************************************************************************************************
127
*/
128
129
#if OS_TASK_SW_HOOK_EN > 0
130
void
App_TaskSwHook
(
void
)
131
{
132
133
}
134
#endif
135
136
/*
137
*********************************************************************************************************
138
* OS_TCBInit() HOOK (APPLICATION)
139
*
140
* Description : This function is called by OSTCBInitHook(), which is called by OS_TCBInit() after setting
141
* up most of the TCB.
142
*
143
* Argument(s) : ptcb is a pointer to the TCB of the task being created.
144
*
145
* Note(s) : (1) Interrupts may or may not be ENABLED during this call.
146
*********************************************************************************************************
147
*/
148
149
void
App_TCBInitHook
(
OS_TCB
*ptcb)
150
{
151
(void)ptcb;
152
}
153
154
/*
155
*********************************************************************************************************
156
* TICK HOOK (APPLICATION)
157
*
158
* Description : This function is called every tick.
159
*
160
* Argument(s) : none.
161
*
162
* Note(s) : (1) Interrupts may or may not be ENABLED during this call.
163
*********************************************************************************************************
164
*/
165
166
#if OS_TIME_TICK_HOOK_EN > 0
167
void
App_TimeTickHook
(
void
)
168
{
169
#if (CPU_CFG_TS_EN == DEF_ENABLED)
170
CPU_TS_Update
();
171
#endif
172
}
173
#endif
174
#endif
UCOS_TI_LM3S_Keil
APP
os_app_hooks.c
生成于 2013年 十月 1日 星期二 12:18:39 , 为 UCOS_TI_LM3S_Keil使用
1.8.4