-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e160a67
Showing
557 changed files
with
170,883 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
********************************************************************************************************* | ||
* EXAMPLE CODE | ||
* | ||
* This file is provided as an example on how to use Micrium products. | ||
* | ||
* Please feel free to use any application code labeled as 'EXAMPLE CODE' in | ||
* your application products. Example code may be used as is, in whole or in | ||
* part, or may be used as a reference only. This file can be modified as | ||
* required to meet the end-product requirements. | ||
* | ||
********************************************************************************************************* | ||
*/ | ||
|
||
/* | ||
********************************************************************************************************* | ||
* | ||
* APPLICATION CONFIGURATION | ||
* | ||
* EXAMPLE CODE | ||
* | ||
* Filename : app_cfg.h | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#ifndef _APP_CFG_H_ | ||
#define _APP_CFG_H_ | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* INCLUDE FILES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#include <stdarg.h> | ||
#include <stdio.h> | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* MODULE ENABLE / DISABLE | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* TASK PRIORITIES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#define APP_CFG_STARTUP_TASK_PRIO 3u | ||
|
||
#define OS_TASK_TMR_PRIO (OS_LOWEST_PRIO - 2u) | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* TASK STACK SIZES | ||
* Size of the task stacks (# of OS_STK entries) | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#define APP_CFG_STARTUP_TASK_STK_SIZE 128u | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* TRACE / DEBUG CONFIGURATION | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#ifndef TRACE_LEVEL_OFF | ||
#define TRACE_LEVEL_OFF 0u | ||
#endif | ||
|
||
#ifndef TRACE_LEVEL_INFO | ||
#define TRACE_LEVEL_INFO 1u | ||
#endif | ||
|
||
#ifndef TRACE_LEVEL_DBG | ||
#define TRACE_LEVEL_DBG 2u | ||
#endif | ||
|
||
#define APP_TRACE_LEVEL TRACE_LEVEL_OFF | ||
#define APP_TRACE printf | ||
|
||
#define APP_TRACE_INFO(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO) ? (void)(APP_TRACE x) : (void)0) | ||
#define APP_TRACE_DBG(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_DBG) ? (void)(APP_TRACE x) : (void)0) | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* MODULE END | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#endif /* End of module include. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,253 @@ | ||
/* | ||
********************************************************************************************************* | ||
* EXAMPLE CODE | ||
* | ||
* This file is provided as an example on how to use Micrium products. | ||
* | ||
* Please feel free to use any application code labeled as 'EXAMPLE CODE' in | ||
* your application products. Example code may be used as is, in whole or in | ||
* part, or may be used as a reference only. This file can be modified as | ||
* required to meet the end-product requirements. | ||
* | ||
********************************************************************************************************* | ||
*/ | ||
|
||
/* | ||
********************************************************************************************************* | ||
* | ||
* uC/OS-II | ||
* Application Hooks | ||
* | ||
* Filename : app_hooks.c | ||
* Version : V2.93.00 | ||
********************************************************************************************************* | ||
*/ | ||
|
||
/* | ||
********************************************************************************************************* | ||
* INCLUDE FILES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#include <os.h> | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* EXTERN GLOBAL VARIABLES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* LOCAL CONSTANTS | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* LOCAL DATA TYPES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
/* | ||
********************************************************************************************************* | ||
* LOCAL TABLES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* LOCAL GLOBAL VARIABLES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* LOCAL FUNCTION PROTOTYPES | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
********************************************************************************************************* | ||
** GLOBAL FUNCTIONS | ||
********************************************************************************************************* | ||
********************************************************************************************************* | ||
*/ | ||
|
||
/* | ||
********************************************************************************************************* | ||
********************************************************************************************************* | ||
** uC/OS-II APP HOOKS | ||
********************************************************************************************************* | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#if (OS_APP_HOOKS_EN > 0) | ||
|
||
/* | ||
********************************************************************************************************* | ||
* TASK CREATION HOOK (APPLICATION) | ||
* | ||
* Description : This function is called when a task is created. | ||
* | ||
* Argument(s) : ptcb is a pointer to the task control block of the task being created. | ||
* | ||
* Note(s) : (1) Interrupts are disabled during this call. | ||
********************************************************************************************************* | ||
*/ | ||
|
||
void App_TaskCreateHook (OS_TCB *ptcb) | ||
{ | ||
(void)ptcb; | ||
} | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* TASK DELETION HOOK (APPLICATION) | ||
* | ||
* Description : This function is called when a task is deleted. | ||
* | ||
* Argument(s) : ptcb is a pointer to the task control block of the task being deleted. | ||
* | ||
* Note(s) : (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(s) : none. | ||
* | ||
* Note(s) : (1) Interrupts are enabled during this call. | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#if OS_VERSION >= 251 | ||
void App_TaskIdleHook (void) | ||
{ | ||
} | ||
#endif | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* 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(s) : none. | ||
********************************************************************************************************* | ||
*/ | ||
|
||
void App_TaskStatHook (void) | ||
{ | ||
} | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* TASK RETURN HOOK (APPLICATION) | ||
* | ||
* Description: This function is called if a task accidentally returns. In other words, a task should | ||
* either be an infinite loop or delete itself when done. | ||
* | ||
* Arguments : ptcb is a pointer to the task control block of the task that is returning. | ||
* | ||
* Note(s) : none | ||
********************************************************************************************************* | ||
*/ | ||
|
||
|
||
#if OS_VERSION >= 289 | ||
void App_TaskReturnHook (OS_TCB *ptcb) | ||
{ | ||
(void)ptcb; | ||
} | ||
#endif | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* 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(s) : 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). | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#if OS_TASK_SW_HOOK_EN > 0 | ||
void App_TaskSwHook (void) | ||
{ | ||
|
||
} | ||
#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(s) : 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_VERSION >= 204 | ||
void App_TCBInitHook (OS_TCB *ptcb) | ||
{ | ||
(void)ptcb; | ||
} | ||
#endif | ||
|
||
|
||
/* | ||
********************************************************************************************************* | ||
* TICK HOOK (APPLICATION) | ||
* | ||
* Description : This function is called every tick. | ||
* | ||
* Argument(s) : none. | ||
* | ||
* Note(s) : (1) Interrupts may or may not be ENABLED during this call. | ||
********************************************************************************************************* | ||
*/ | ||
|
||
#if OS_TIME_TICK_HOOK_EN > 0 | ||
void App_TimeTickHook (void) | ||
{ | ||
|
||
} | ||
#endif | ||
#endif |
Oops, something went wrong.