| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- /*
- *********************************************************************************************************
- * uC/OS-II APP HOOKS
- *
- * (c) Copyright 2005-2009, Micrium, Weston, FL
- * All Rights Reserved
- *
- *
- * File : OS_AppHooks.c
- * By :
- * Version : V2.91
- *
- * LICENSING TERMS:
- * ---------------
- * uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.
- * If you plan on using uC/OS-II in a commercial product you need to contact Micriµm to properly license
- * its use in your product. We provide ALL the source code for your convenience and to help you experience
- * uC/OS-II. The fact that the source is provided does NOT mean that you can use it without paying a
- * licensing fee.
- *********************************************************************************************************
- */
- /*
- *********************************************************************************************************
- *********************************************************************************************************
- *
- *********************************************************************************************************
- *********************************************************************************************************
- */
- /*
- *********************************************************************************************************
- * INCLUDE FILES
- *********************************************************************************************************
- */
- #include <includes.h>
- /*
- *********************************************************************************************************
- * TASK RETURN HOOK (APPLICATION)
- *
- * Description :
- *
- * Argument : ptcb is a pointer to the task control block of the task being created.
- *
- * Note :
- *********************************************************************************************************
- */
- void OSTaskReturnHook(OS_TCB *ptcb)
- {
- }
- #if OS_APP_HOOKS_EN > 0u
- /*
- *********************************************************************************************************
- * TASK CREATION HOOK (APPLICATION)
- *
- * Description : This function is called when a task is created.
- *
- * Argument : ptcb is a pointer to the task control block of the task being created.
- *
- * Note : (1) Interrupts are disabled during this call.
- *********************************************************************************************************
- */
- void App_TaskCreateHook (OS_TCB *ptcb)
- {
- #if (OS_VIEW_MODULE == DEF_ENABLED)
- OSView_TaskCreateHook(ptcb);
- #endif
- }
- /*
- *********************************************************************************************************
- * TASK DELETION HOOK (APPLICATION)
- *
- * Description : This function is called when a task is deleted.
- *
- * Argument : ptcb is a pointer to the task control block of the task being deleted.
- *
- * Note : (1) Interrupts are disabled during this call.
- *********************************************************************************************************
- */
- void App_TaskDelHook (OS_TCB *ptcb)
- {
- (void)ptcb;
- }
- /*
- *********************************************************************************************************
- * IDLE TASK HOOK (APPLICATION)
- *
- * Description : This function is called by OSTaskIdleHook(), which 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.
- *
- * Argument : none.
- *
- * Note : (1) Interrupts are enabled during this call.
- *********************************************************************************************************
- */
- #if OS_VERSION >= 251
- void App_TaskIdleHook (void)
- {
- // static unsigned int sct=0;
- // if(++sct>10000){
- // sct=0;
- // printf("I\r\n");
- // }
- }
- #endif
- /*
- *********************************************************************************************************
- * TASK RETURN HOOK (APPLICATION)
- *
- * Description :
- *
- * Argument : none.
- *
- * Note :
- *********************************************************************************************************
- */
- void App_TaskReturnHook (OS_TCB *ptcb)
- {
- }
- /*
- *********************************************************************************************************
- * STATISTIC TASK HOOK (APPLICATION)
- *
- * Description : This function is called by OSTaskStatHook(), which is called every second by uC/OS-II's
- * statistics task. This allows your application to add functionality to the statistics task.
- *
- * Argument : none.
- *********************************************************************************************************
- */
- void App_TaskStatHook (void)
- {
- }
- /*
- *********************************************************************************************************
- * TASK SWITCH HOOK (APPLICATION)
- *
- * Description : This function is called when a task switch is performed. This allows you to perform other
- * operations during a context switch.
- *
- * Argument : none.
- *
- * Note : 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).
- *********************************************************************************************************
- */
- #if OS_TASK_SW_HOOK_EN > 0u
- void App_TaskSwHook (void)
- {
- #if (OS_VIEW_MODULE == DEF_ENABLED)
- OSView_TaskSwHook();
- #endif
- }
- #endif
- /*
- *********************************************************************************************************
- * OS_TCBInit() HOOK (APPLICATION)
- *
- * Description : This function is called by OSTCBInitHook(), which is called by OS_TCBInit() after setting
- * up most of the TCB.
- *
- * Argument : ptcb is a pointer to the TCB of the task being created.
- *
- * Note : (1) Interrupts may or may not be ENABLED during this call.
- *********************************************************************************************************
- */
- #if OS_VERSION >= 204
- void App_TCBInitHook (OS_TCB *ptcb)
- {
- (void)ptcb;
- }
- #endif
- /*
- *********************************************************************************************************
- * App_TimeTickHook() HOOK (APPLICATION)
- *
- * Description :
- *
- * Argument :
- *
- * Note :
- *********************************************************************************************************
- */
- #if OS_TIME_TICK_HOOK_EN > 0u
- void App_TimeTickHook (void)
- {
- #if (OS_VIEW_MODULE == DEF_ENABLED)
- OSView_TickHook();
- #endif
- }
- #endif
- #endif
-
- /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
|