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

📄 ucos_ii.h

📁 这是一个ucosII小系统的源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
                                     INT8U            seconds,
                                     INT16U           milli);
#endif

#if OS_TIME_DLY_RESUME_EN > 0
INT8U         OSTimeDlyResume       (INT8U            prio);
#endif

#if OS_TIME_GET_SET_EN > 0
INT32U        OSTimeGet             (void);
void          OSTimeSet             (INT32U           ticks);
#endif

void          OSTimeTick            (void);

/*
*********************************************************************************************************
*                                            TIMER MANAGEMENT
*********************************************************************************************************
*/

#if OS_TMR_EN > 0
OS_TMR      *OSTmrCreate            (INT32U           dly,
                                     INT32U           period,
                                     INT8U            opt,
                                     OS_TMR_CALLBACK  callback,
                                     void            *callback_arg,
                                     INT8U           *pname,
                                     INT8U           *perr);

BOOLEAN      OSTmrDel               (OS_TMR          *ptmr,
                                     INT8U           *perr);

#if OS_TMR_CFG_NAME_SIZE > 0
INT8U        OSTmrNameGet           (OS_TMR          *ptmr,
                                     INT8U           *pdest,
                                     INT8U           *perr);
#endif
INT32U       OSTmrRemainGet         (OS_TMR          *ptmr,
                                     INT8U           *perr);

INT8U        OSTmrStateGet          (OS_TMR          *ptmr,
                                     INT8U           *perr);

BOOLEAN      OSTmrStart             (OS_TMR          *ptmr,
                                     INT8U           *perr);

BOOLEAN      OSTmrStop              (OS_TMR          *ptmr,
                                     INT8U            opt,
                                     void            *callback_arg,
                                     INT8U           *perr);

INT8U        OSTmrSignal            (void);
#endif

/*
*********************************************************************************************************
*                                             MISCELLANEOUS
*********************************************************************************************************
*/

void          OSInit                (void);

void          OSIntEnter            (void);
void          OSIntExit             (void);

#if OS_SCHED_LOCK_EN > 0
void          OSSchedLock           (void);
void          OSSchedUnlock         (void);
#endif

void          OSStart               (void);

void          OSStatInit            (void);

INT16U        OSVersion             (void);

/*$PAGE*/
/*
*********************************************************************************************************
*                                      INTERNAL FUNCTION PROTOTYPES
*                            (Your application MUST NOT call these functions)
*********************************************************************************************************
*/

#if OS_TASK_DEL_EN > 0
void          OS_Dummy              (void);
#endif

#if OS_EVENT_EN
INT8U         OS_EventTaskRdy       (OS_EVENT        *pevent,
                                     void            *pmsg,
                                     INT8U            msk,
                                     INT8U            pend_stat);

void          OS_EventTaskWait      (OS_EVENT        *pevent);

void          OS_EventTOAbort       (OS_EVENT        *pevent);

void          OS_EventWaitListInit  (OS_EVENT        *pevent);
#endif

#if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
void          OS_FlagInit           (void);
void          OS_FlagUnlink         (OS_FLAG_NODE    *pnode);
#endif

void          OS_MemClr             (INT8U           *pdest,
                                     INT16U           size);

void          OS_MemCopy            (INT8U           *pdest,
                                     INT8U           *psrc,
                                     INT16U           size);

#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
void          OS_MemInit            (void);
#endif

#if OS_Q_EN > 0
void          OS_QInit              (void);
#endif

void          OS_Sched              (void);

#if (OS_EVENT_NAME_SIZE > 1) || (OS_FLAG_NAME_SIZE > 1) || (OS_MEM_NAME_SIZE > 1) || (OS_TASK_NAME_SIZE > 1)
INT8U         OS_StrCopy            (INT8U           *pdest,
                                     INT8U           *psrc);

INT8U         OS_StrLen             (INT8U           *psrc);
#endif

void          OS_TaskIdle           (void            *p_arg);

#if OS_TASK_STAT_EN > 0
void          OS_TaskStat           (void            *p_arg);
#endif

#if OS_TASK_CREATE_EXT_EN > 0
void          OS_TaskStkClr         (OS_STK          *pbos,
                                     INT32U           size,
                                     INT16U           opt);
#endif

#if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
void          OS_TaskStatStkChk     (void);
#endif

INT8U         OS_TCBInit            (INT8U            prio,
                                     OS_STK          *ptos,
                                     OS_STK          *pbos,
                                     INT16U           id,
                                     INT32U           stk_size,
                                     void            *pext,
                                     INT16U           opt);

#if OS_TMR_EN > 0
void          OSTmr_Init(void);
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                          FUNCTION PROTOTYPES
*                                      (Target Specific Functions)
*********************************************************************************************************
*/

#if OS_DEBUG_EN > 0
void          OSDebugInit           (void);
#endif

void          OSInitHookBegin       (void);
void          OSInitHookEnd         (void);

void          OSTaskCreateHook      (OS_TCB          *ptcb);
void          OSTaskDelHook         (OS_TCB          *ptcb);

void          OSTaskIdleHook        (void);

void          OSTaskStatHook        (void);
OS_STK       *OSTaskStkInit         (void           (*task)(void *p_arg),
                                     void            *p_arg,
                                     OS_STK          *ptos,
                                     INT16U           opt);

#if OS_TASK_SW_HOOK_EN > 0
void          OSTaskSwHook          (void);
#endif

void          OSTCBInitHook         (OS_TCB          *ptcb);

#if OS_TIME_TICK_HOOK_EN > 0
void          OSTimeTickHook        (void);
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                          FUNCTION PROTOTYPES
*                                   (Application Specific Functions)
*********************************************************************************************************
*/

#if OS_APP_HOOKS_EN > 0
void          App_TaskCreateHook    (OS_TCB          *ptcb);
void          App_TaskDelHook       (OS_TCB          *ptcb);
void          App_TaskIdleHook      (void);

void          App_TaskStatHook      (void);

#if OS_TASK_SW_HOOK_EN > 0
void          App_TaskSwHook        (void);
#endif

void          App_TCBInitHook       (OS_TCB          *ptcb);

#if OS_TIME_TICK_HOOK_EN > 0
void          App_TimeTickHook      (void);
#endif
#endif

/*
*********************************************************************************************************
*                                          FUNCTION PROTOTYPES
*
* IMPORTANT: These prototypes MUST be placed in OS_CPU.H
*********************************************************************************************************
*/

#if 0
void          OSStartHighRdy        (void);
void          OSIntCtxSw            (void);
void          OSCtxSw               (void);
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                   LOOK FOR MISSING #define CONSTANTS
*
* This section is used to generate ERROR messages at compile time if certain #define constants are
* MISSING in OS_CFG.H.  This allows you to quickly determine the source of the error.
*
* You SHOULD NOT change this section UNLESS you would like to add more comments as to the source of the
* compile time error.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*                                            EVENT FLAGS
*********************************************************************************************************
*/

#ifndef OS_FLAG_EN
#error  "OS_CFG.H, Missing OS_FLAG_EN: Enable (1) or Disable (0) code generation for Event Flags"
#else
    #ifndef OS_MAX_FLAGS
    #error  "OS_CFG.H, Missing OS_MAX_FLAGS: Max. number of Event Flag Groups in your application"
    #else
        #if     OS_MAX_FLAGS > 65500u
        #error  "OS_CFG.H, OS_MAX_FLAGS must be <= 65500"
        #endif
    #endif

    #ifndef OS_FLAGS_NBITS
    #error  "OS_CFG.H, Missing OS_FLAGS_NBITS: Determine #bits used for event flags, MUST be either 8, 16 or 32"
    #endif

    #ifndef OS_FLAG_WAIT_CLR_EN
    #error  "OS_CFG.H, Missing OS_FLAG_WAIT_CLR_EN: Include code for Wait on Clear EVENT FLAGS"
    #endif

    #ifndef OS_FLAG_ACCEPT_EN
    #error  "OS_CFG.H, Missing OS_FLAG_ACCEPT_EN: Include code for OSFlagAccept()"
    #endif

    #ifndef OS_FLAG_DEL_EN
    #error  "OS_CFG.H, Missing OS_FLAG_DEL_EN: Include code for OSFlagDel()"
    #endif

    #ifndef OS_FLAG_NAME_SIZE
    #error  "OS_CFG.H, Missing OS_FLAG_NAME_SIZE: Determines the size of flag group names"
    #endif

    #ifndef OS_FLAG_QUERY_EN
    #error  "OS_CFG.H, Missing OS_FLAG_QUERY_EN: Include code for OSFlagQuery()"
    #endif

⌨️ 快捷键说明

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