📄 os_hooks.h
字号:
/*************************************************************************** ** PROJECT : TMON (Transparent monitor) ** ** MODULE : OS_HOOK.h ** ** AUTHOR : Michael Anburaj ** URL : http://geocities.com/michaelanburaj/ ** EMAIL: michaelanburaj@hotmail.com ** ** PROCESSOR : MIPS 4Kc (32 bit RISC) - ATLAS board ** ** TOOL-CHAIN : GCC ** ** DESCRIPTION : ** uCOS-II OS Hooks. ** ***************************************************************************/#ifndef __OS_HOOK_H__#define __OS_HOOK_H__#include "consol.h"#include "led.h"#ifdef __cplusplusextern "C" {#endif/* ********************************************************************* *//* Module configuration *//* ********************************************************************* *//* Interface macro & data definition *//*********************************************************************************************************** OS INITIALIZATION HOOK* (BEGINNING)** Description: This function is called by OSInit() at the beginning of OSInit().** Arguments : none** Note(s) : 1) Interrupts should be disabled during this call.**********************************************************************************************************/#define OSHOOK_mInitBegin() \{ \}/*********************************************************************************************************** OS INITIALIZATION HOOK* (END)** Description: This function is called by OSInit() at the end of OSInit().** Arguments : none** Note(s) : 1) Interrupts should be disabled during this call.**********************************************************************************************************/#define OSHOOK_mInitEnd() \{ \}/*********************************************************************************************************** TASK CREATION HOOK** Description: This function is called when a task is created.** Arguments : ptcb is a pointer to the task control block of the task being created.** Note(s) : 1) Interrupts are disabled during this call.**********************************************************************************************************/#define OSHOOK_mTaskCreate(ptcb) \{ \ /* CONSOL_Printf("Task Create: %d\n", ptcb->OSTCBPrio); */ \}/*********************************************************************************************************** TASK DELETION HOOK** Description: This function is called when a task is deleted.** Arguments : ptcb is a pointer to the task control block of the task being deleted.** Note(s) : 1) Interrupts are disabled during this call.**********************************************************************************************************/#define OSHOOK_mTaskDel() \{ \}/*********************************************************************************************************** IDLE TASK HOOK** Description: This function is called by the idle task. This hook has been added to allow you to do * such things as STOP the CPU to conserve power.** Arguments : none** Note(s) : 1) Interrupts are enabled during this call.**********************************************************************************************************/#define OSHOOK_mTaskIdle() \{ \}/*********************************************************************************************************** STATISTIC TASK HOOK** Description: This function is called every second by uC/OS-II's statistics task. This allows your * application to add functionality to the statistics task.** Arguments : none**********************************************************************************************************/#define OSHOOK_mTaskStat() \{ \}/*********************************************************************************************************** TASK SWITCH HOOK** Description: This function is called when a task switch is performed. This allows you to perform other* operations during a context switch.** Arguments : none** Note(s) : 1) Interrupts are disabled during this call.* 2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that* will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the * task being switched out (i.e. the preempted task).**********************************************************************************************************/#define OSHOOK_mTaskSw() \{ \ /* CONSOL_Printf("Task Sw: %d -> %d \n", OSTCBCur->OSTCBPrio, OSTCBHighRdy->OSTCBPrio); */ \ /* LED_vPuti((OSTCBCur->OSTCBPrio|(OSTCBHighRdy->OSTCBPrio<<16))); */ \}/*********************************************************************************************************** OSTCBInit() HOOK** Description: This function is called by OS_TCBInit() after setting up most of the TCB.** Arguments : ptcb is a pointer to the TCB of the task being created.** Note(s) : 1) Interrupts may or may not be ENABLED during this call.**********************************************************************************************************/#define OSHOOK_mTCBInit() \{ \}/*********************************************************************************************************** TICK HOOK** Description: This function is called every tick.** Arguments : none** Note(s) : 1) Interrupts may or may not be ENABLED during this call.**********************************************************************************************************/#define OSHOOK_mTimeTick() \{ \}/* ********************************************************************* *//* Interface function definition *//* ********************************************************************* */#ifdef __cplusplus}#endif#endif /*__OS_HOOK_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -