| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- /*
- * Copyright (c) 2021, Meco Jianting Man <jiantingman@foxmail.com>
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2020-09-20 Meco Man first version
- */
- /*
- *********************************************************************************************************
- * uC/OS-II
- * The Real-Time Kernel
- *
- * Copyright 1992-2020 Silicon Laboratories Inc. www.silabs.com
- *
- * SPDX-License-Identifier: APACHE-2.0
- *
- * This software is subject to an open source license and is distributed by
- * Silicon Laboratories Inc. pursuant to the terms of the Apache License,
- * Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
- *
- *********************************************************************************************************
- */
- #define OS_CPU_GLOBALS
- /*
- *********************************************************************************************************
- * INCLUDE FILES
- *********************************************************************************************************
- */
- #include "ucos_ii.h"
- /*
- *********************************************************************************************************
- * 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.
- * 2) When using hardware floating point please do the following during the reset handler:
- * a) Set full access for CP10 & CP11 bits in CPACR register.
- * b) Set bits ASPEN and LSPEN in FPCCR register.
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSInitHookBegin (void)
- {
- }
- #endif
- /*
- *********************************************************************************************************
- * 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.
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSInitHookEnd (void)
- {
- }
- #endif
- /*
- *********************************************************************************************************
- * 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.
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSTaskCreateHook (OS_TCB *ptcb)
- {
- #if OS_APP_HOOKS_EN > 0u
- App_TaskCreateHook(ptcb);
- #else
- (void)ptcb; /* Prevent compiler warning */
- #endif
- }
- #endif
- /*
- *********************************************************************************************************
- * 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.
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSTaskDelHook (OS_TCB *ptcb)
- {
- #if OS_APP_HOOKS_EN > 0u
- App_TaskDelHook(ptcb);
- #else
- (void)ptcb; /* Prevent compiler warning */
- #endif
- }
- #endif
- #if OS_TASK_STAT_EN > 0u
- /*
- *********************************************************************************************************
- * 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.
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSTaskIdleHook (void)
- {
- #if OS_APP_HOOKS_EN > 0u
- App_TaskIdleHook();
- #endif
- }
- #endif
- /*
- *********************************************************************************************************
- * 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
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSTaskStatHook (void)
- {
- #if OS_APP_HOOKS_EN > 0u
- App_TaskStatHook();
- #endif
- }
- #endif
- #endif
- /*
- *********************************************************************************************************
- * OS_TCBInit() 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.
- *********************************************************************************************************
- */
- #if OS_CPU_HOOKS_EN > 0u
- void OSTCBInitHook (OS_TCB *ptcb)
- {
- #if OS_APP_HOOKS_EN > 0u
- App_TCBInitHook(ptcb);
- #else
- (void)ptcb; /* Prevent compiler warning */
- #endif
- }
- #endif
|