⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_probe.h

📁 官方的UCOSii的移植文件
💻 H
字号:
/*
*********************************************************************************************************
*                                     uC/Probe uC/OS-II Plug-in
*
*                          (c) Copyright 2003-2006; Micrium, Inc.; Weston, FL
*
*               All rights reserved.  Protected by international copyright laws.
*               Knowledge of the source code may NOT be used to develop a similar product.
*               Please help us continue to provide the Embedded community with the finest
*               software available.  Your honesty is greatly appreciated.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*
*                                              uC/Probe
*
*                                         Plug-in for uC/OS-II
*
* Filename      : os_probe.h
* Version       : V1.30
* Programmer(s) : BAN
*********************************************************************************************************
*/

#ifndef  __OS_PROBE_H__
#define  __OS_PROBE_H__

/*
*********************************************************************************************************
*                                               EXTERNS
*********************************************************************************************************
*/

#ifdef   OS_PROBE_GLOBALS
#define  OS_PROBE_EXT
#else
#define  OS_PROBE_EXT  extern
#endif


/*
*********************************************************************************************************
*                                               DEFINES
*
* Note(s)     : (1) If OS_PROBE_USE_FP is defined as 0 in user header file, then the task CPU usages
*                   and task stack usages stored in OSProbe_TaskCPUUsage[] and OSProbe_TaskStkUsage[]
*                   will be 8-bit integers. This option removes the usage of floating-point types
*                   in this code, thereby eliminating the need for a floating-point library.  If
*                   OS_PROBE_USE_FP is not defined in user header file, the value defaults to 1.
*********************************************************************************************************
*/

#ifndef OS_PROBE_USE_FP
#define OS_PROBE_USE_FP   1
#endif


/*
*********************************************************************************************************
*                                          GLOBAL VARIABLES
*********************************************************************************************************
*/

OS_PROBE_EXT  void    (*OSProbe_CallbackFnct)(void);
OS_PROBE_EXT  INT16U    OSProbe_Delay;

#if OS_PROBE_TASK > 0
#if OS_PROBE_USE_FP > 0
OS_PROBE_EXT  FP32      OSProbe_TaskCPUUsage[OS_MAX_TASKS];
OS_PROBE_EXT  FP32      OSProbe_TaskStkUsage[OS_MAX_TASKS];
#else
OS_PROBE_EXT  INT8U     OSProbe_TaskCPUUsage[OS_MAX_TASKS];
OS_PROBE_EXT  INT8U     OSProbe_TaskStkUsage[OS_MAX_TASKS];
#endif
#endif

#if OS_PROBE_HOOKS_EN > 0
OS_PROBE_EXT  INT32U    OSProbe_CyclesCtr;
#if OS_PROBE_TMR_32_BITS > 0
OS_PROBE_EXT  INT32U    OSProbe_TmrCntsPrev;
#else
OS_PROBE_EXT  INT16U    OSProbe_TmrCntsPrev;
#endif
#endif


/*
*********************************************************************************************************
*                                               MACRO'S
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*********************************************************************************************************
*/

void    OSProbe_Init          (void);                               /* Initialize uC/Probe uC/OS-II Plug-In                 */

#if OS_PROBE_TASK > 0
void    OSProbe_SetCallback   (void (*call_back)(void));
void    OSProbe_SetDelay      (INT16U  delay);
#endif


/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*                              HOOKS CALLED FROM USER'S APPLICATION CODE
*********************************************************************************************************
*/

#if OS_PROBE_HOOKS_EN > 0
void    OSProbe_TaskSwHook    (void);                               /* MUST be called by App_TaskSwHook()                   */
void    OSProbe_TaskCreateHook(OS_TCB *ptcb);                       /* MUST be called by App_TaskCreateHook()               */
void    OSProbe_TickHook      (void);                               /* MUST be called by App_TimeTickHook()                 */

INT32U  OSProbe_TimeGetCycles (void);
#endif


/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*                                          DEFINED IN bsp.c
*********************************************************************************************************
*/

#if OS_PROBE_HOOKS_EN > 0
void    OSProbe_TmrInit       (void);
INT32U  OSProbe_TmrRd         (void);
#endif


/*
*********************************************************************************************************
*                                        CONFIGURATION ERRORS
*********************************************************************************************************
*/

#if       (OS_TASK_PROFILE_EN == 0 )
  #error  "OS_TASK_PROFILE_EN     illegally #define'd in 'os_cfg.h'              "
  #error  "             [MUST be  1   Variables included in OS_TCB for profiling]"
#endif



#ifndef    OS_PROBE_TASK
  #error  "OS_PROBE_TASK        not #define'd in 'app_cfg.h'                              "
  #error  "                [MUST be  0  Task created to calculate CPU usage for each task]"
  #error  "                [     ||  1  No task created                                  ]"

#elif    ((OS_PROBE_TASK != 0 ) && \
          (OS_PROBE_TASK != 1))
  #error  "OS_PROBE_TASK        illegally #define'd in 'app_cfg.h'                        "
  #error  "                [MUST be  0  Task created to calculate CPU usage for each task]"
  #error  "                [     ||  1  No task created                                  ]"
#endif



#if  defined(OS_PROBE_TASK) && \
            (OS_PROBE_TASK == 1)

#ifndef    OS_PROBE_TASK_PRIO
  #error  "OS_PROBE_TASK_PRIO       not #define'd in 'app_cfg.h'                      "
  #error  "         [This will be the priority for the uC/Probe uC/OS-II Plug-in Task]"
#endif

#ifndef    OS_PROBE_TASK_ID
  #error  "OS_PROBE_TASK_ID         not #define'd in 'app_cfg.h'                      "
  #error  "         [This will be the ID for the uC/Probe uC/OS-II Plug-in Task]      "
#endif

#ifndef    OS_PROBE_TASK_STK_SIZE
  #error  "OS_PROBE_TASK_STK_SIZE   not #define'd in 'app_cfg.h'                      "
  #error  "         [This will be the ID for the uC/Probe uC/OS-II Plug-in Task]      "
#endif

#endif



#ifndef    OS_PROBE_HOOKS_EN
  #error  "OS_PROBE_HOOKS_EN        not #define'd in 'app_cfg.h'                 "
  #error  "                [MUST be  0  uC/OS-II Plug-in hooks code     included]"
  #error  "                [     ||  1  uC/OS-II Plug-in hooks code NOT included]"

#elif    ((OS_PROBE_HOOKS_EN != 0 ) && \
          (OS_PROBE_HOOKS_EN != 1))
  #error  "OS_PROBE_HOOKS_EN        illegally #define'd in 'app_cfg.h'           "
  #error  "                [MUST be  0  uC/OS-II Plug-in hooks code     included]"
  #error  "                [     ||  1  uC/OS-II Plug-in hooks code NOT included]"
#endif



#if  ((defined(OS_PROBE_HOOKS_EN)) && \
              (OS_PROBE_HOOKS_EN == 1))

#ifndef    OS_PROBE_TMR_32_BITS
  #error  "OS_PROBE_TMR_32_BITS     not #define'd in 'app_cfg.h'      "
  #error  "             [MUST be  1   Timer is 32-bit timer]          "
  #error  "             [     ||  0   Timer is 16-bit timer]          "

#elif    ((OS_PROBE_TMR_32_BITS != 0 ) && \
          (OS_PROBE_TMR_32_BITS != 1))
  #error  "OS_PROBE_TMR_32_BITS     illegally #define'd in 'app_cfg.h'"
  #error  "             [MUST be  1   Timer is 32-bit timer]          "
  #error  "             [     ||  0   Timer is 16-bit timer]          "
#endif

#endif



/*
*********************************************************************************************************
*                                             MODULE END
*********************************************************************************************************
*/

#endif                                                          /* End of module include.                               */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -