亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os_cpu_c.c

?? avr ucos 代碼 測試環境:source insight WINAVR 4個進程
?? C
字號:
/*
*********************************************************************************************************
*                                              uC/OS-II
*                                        The Real-Time Kernel
* 
*                                       ATmega128 Specific code for V2.8x
*
* File     : OS_CPU_C.C
* By       : Xiawei   <xiawei0311@gmail.com>
* AVR-GCC  version : 4.1.1 , WinAVR 20070122
* Date    : September 9th,2007
*********************************************************************************************************
*/

#define   OS_CPU_GLOBALS
#include <avr/io.h>
#include "os_cpu.h"
#include "os_cfg.h"
#include "ucos_ii.h"

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

#if OS_VERSION >= 281 && OS_TMR_EN > 0
static  INT16U  OSTmrCtr;
#endif

/*
*********************************************************************************************************
*                                       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.
*********************************************************************************************************
*/
#if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
void  OSInitHookBegin (void)
{
#if OS_VERSION >= 281 && OS_TMR_EN > 0
    OS_CPU_TmrCtr = 0;
#endif
}
#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 > 0 && OS_VERSION > 203
void  OSInitHookEnd (void)
{
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                          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 > 0 
void  OSTaskCreateHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}
#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 > 0 
void  OSTaskDelHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}
#endif

/*
*********************************************************************************************************
*                                             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 > 0 && OS_VERSION >= 251
void  OSTaskIdleHook (void)
{
}
#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 > 0 
void  OSTaskStatHook (void)
{
}
#endif

/*$PAGE*/
/*
**********************************************************************************************************
*                                       INITIALIZE A TASK'S STACK
*
* Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
*              stack frame of the task being created. This function is highly processor specific.
*
* Arguments  : task          is a pointer to the task code
*
*              p_arg         is a pointer to a user supplied data area that will be passed to the task
*                            when the task first executes.
*
*              ptos          is a pointer to the top of stack. It is assumed that 'ptos' points to the
*                            highest valid address on the stack.
*
*              opt           specifies options that can be used to alter the behavior of OSTaskStkInit().
*                            (see uCOS_II.H for OS_TASK_OPT_???).
*
* Returns    : Always returns the location of the new top-of-stack' once the processor registers have
*              been placed on the stack in the proper order.
*
* Note(s)    : Interrupts are enabled when your task starts executing. You can change this by setting the
*              SREG to 0x00 instead. In this case, interrupts would be disabled upon task startup. The
*              application code would be responsible for enabling interrupts at the beginning of the task
*              code. You will need to modify OSTaskIdle() and OSTaskStat() so that they enable interrupts.
*              Failure to do this will make your system crash!
*
*              The AVR return stack is placed OS_TASK_HARD_STK_SIZE bytes before the bottom of the task's
*              stack.
*
*              (1) IMPORTANT: The ICC compiler handles function pointers by actually passing the pointer
*                             to a location in Flash that actually contains the pointer to the function.
*
*              (2) IMPORTANT: You MUST set OSTaskStkSize and OSTaskStkSizeHard BEFORE calling OSInit()
*                             to initialize the Idle and statistic tasks stacks.
**********************************************************************************************************
*/

OS_STK  *OSTaskStkInit (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt)
{
    OS_STK* stk;
    opt=opt;/*廢物,防止編譯器報警*/
    stk=ptos;/*得到棧頂指針*/
    
    *stk-- = (INT8U)(((INT16U)task)&0xFF);
    *stk-- = (INT8U)(((INT16U)task)>>8);
    
    *stk-- = (INT8U)0x00;                   /* R0  = 0x00                                               */
    *stk-- = (INT8U)0x01;                   /* R1  = 0x00                                               */
    *stk-- = (INT8U)0x02;                   /* R2  = 0x00                                               */
    *stk-- = (INT8U)0x03;                   /* R3  = 0x00                                               */
    *stk-- = (INT8U)0x04;                   /* R4  = 0x00                                               */
    *stk-- = (INT8U)0x05;                   /* R5  = 0x00                                               */
    *stk-- = (INT8U)0x06;                   /* R6  = 0x00                                               */
    *stk-- = (INT8U)0x07;                   /* R7  = 0x00                                               */
    *stk-- = (INT8U)0x08;                   /* R8  = 0x00                                               */
    *stk-- = (INT8U)0x09;                   /* R9  = 0x00                                               */
    *stk-- = (INT8U)0x10;                   /* R10 = 0x00                                               */
    *stk-- = (INT8U)0x11;                   /* R11 = 0x00                                               */
    *stk-- = (INT8U)0x12;                   /* R12 = 0x00                                               */
    *stk-- = (INT8U)0x13;                   /* R13 = 0x00                                               */
    *stk-- = (INT8U)0x14;                   /* R14 = 0x00                                               */
    *stk-- = (INT8U)0x15;                   /* R15 = 0x00                                               */
    *stk-- = (INT8U)0x16;                   /* R16 = 0x00                                               */
    *stk-- = (INT8U)0x17;                   /* R17 = 0x00                                               */
    *stk-- = (INT8U)0x18;                   /* R18 = 0x00                                               */
    *stk-- = (INT8U)0x19;                   /* R19 = 0x00                                               */
    *stk-- = (INT8U)0x20;                   /* R20 = 0x00                                               */
    *stk-- = (INT8U)0x21;                   /* R21 = 0x00                                               */
    *stk-- = (INT8U)0x22;                   /* R22 = 0x00                                               */
    *stk-- = (INT8U)0x23;                   /* R23 = 0x00                                               */
    *stk-- = (INT8U)(((INT16U)pdata)&0xFF); /* Simulate call to function with argument     */
    *stk-- = (INT8U)(((INT16U)pdata)>>8);   /* R24, R25 contains argument pointer pdata */
    *stk-- = (INT8U)0x26;                   /* R26 = 0x00                                               */
    *stk-- = (INT8U)0x27;                   /* R27 = 0x00                                               */
    *stk-- = (INT8U)0x28;                   /* R28 = 0x00                                               */
    *stk-- = (INT8U)0x29;                   /* R29 = 0x00                                               */
    *stk-- = (INT8U)0x30;                   /* R30 = 0x00                                               */
    *stk-- = (INT8U)0x31;                   /* R31 = 0x00                                               */
    *stk-- = (INT8U)0x80;                   /* SREG = Interrupts enabled                                */
    return ((OS_STK *)stk);
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                           TASK SWITCH HOOK
*
* Description: This function is called when a task switch is performed.  This allows you to perform other
*              operations during a context switch.
*
* Arguments  : 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_CPU_HOOKS_EN > 0) && (OS_TASK_SW_HOOK_EN > 0)
void  OSTaskSwHook (void)
{
}
#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 > 0 && OS_VERSION > 203
void  OSTCBInitHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                                           /* Prevent Compiler warning                 */
}
#endif


/*
*********************************************************************************************************
*                                               TICK HOOK
*
* Description: This function is called every tick.
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
*********************************************************************************************************
*/
#if (OS_CPU_HOOKS_EN > 0) && (OS_TIME_TICK_HOOK_EN > 0)
void  OSTimeTickHook (void)
{
  #if OS_VERSION >= 281 && OS_TMR_EN > 0
    OSTmrCtr++;
    if (OSTmrCtr >= (OS_TICKS_PER_SEC / OS_TMR_CFG_TICKS_PER_SEC)) {
        OSTmrCtr = 0;
        OSTmrSignal();
    }
  #endif
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产岛国毛片在线| 日本乱码高清不卡字幕| 亚洲免费观看高清完整版在线观看熊| 免费观看在线综合| 精品一区二区三区影院在线午夜 | 国产麻豆精品久久一二三| 久久精品国产99| 一级精品视频在线观看宜春院| 成人免费在线视频观看| 欧美一区二区三区爱爱| 欧美少妇xxx| 欧美videos大乳护士334| 国产精品你懂的在线| 一区二区三区国产| 久久精品国产秦先生| 国产精品一区二区果冻传媒| 国产精品18久久久久久久久久久久| av在线播放不卡| 欧美日韩国产大片| 日韩欧美成人午夜| 91福利视频在线| 欧美精品一二三| 在线亚洲一区二区| 久久色在线观看| 一色桃子久久精品亚洲| 天天做天天摸天天爽国产一区 | 3atv在线一区二区三区| 久久这里只有精品首页| 欧美成人精品二区三区99精品| 亚洲国产激情av| 秋霞成人午夜伦在线观看| 成人av电影免费观看| 欧美日韩一二区| 成人欧美一区二区三区| 欧美国产一区视频在线观看| 亚洲成人av一区二区三区| 亚洲综合激情网| 日日夜夜一区二区| 亚洲国产中文字幕在线视频综合| 激情小说亚洲一区| 亚洲最大色网站| 国产九色精品成人porny| 欧美在线观看一二区| 国产精品色噜噜| 天天综合色天天| 色狠狠桃花综合| 在线播放中文字幕一区| 亚洲精品国产视频| 国产成人av一区二区三区在线| 欧美一区二区大片| 性久久久久久久久久久久| 91黄视频在线| 亚洲欧美电影院| 精品国产一区二区精华| 欧美嫩在线观看| 一区二区三区在线视频观看58 | 久久久影院官网| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧洲一区二区av| 综合欧美亚洲日本| 懂色av中文一区二区三区| 久久久久九九视频| 伦理电影国产精品| 成人免费毛片a| 中文字幕日韩av资源站| 青草国产精品久久久久久| 欧美日韩在线电影| 日韩电影在线看| 不卡一区二区中文字幕| 精品电影一区二区| 国产成人综合在线| 成人午夜私人影院| 欧美一区二区三区四区久久| 亚洲欧洲制服丝袜| 91麻豆国产精品久久| 一卡二卡欧美日韩| 色婷婷综合久久久久中文一区二区 | 国产专区综合网| 精品国产电影一区二区| 美女诱惑一区二区| 亚洲人一二三区| 久久亚洲一区二区三区明星换脸| 一区视频在线播放| 91麻豆精品国产综合久久久久久| 国产精品1区二区.| 奇米777欧美一区二区| 欧美日韩中文另类| 色香蕉成人二区免费| 麻豆成人91精品二区三区| 亚洲美女免费视频| 亚洲国产精品精华液2区45| 91福利在线看| 成人丝袜18视频在线观看| 强制捆绑调教一区二区| 成人欧美一区二区三区黑人麻豆 | 亚洲线精品一区二区三区 | 首页欧美精品中文字幕| 亚洲欧美一区二区三区久本道91| 日韩欧美国产系列| 欧美性猛交一区二区三区精品| 极品少妇xxxx精品少妇| 亚洲va中文字幕| 亚洲欧美日韩精品久久久久| 亚洲国产高清在线| 国产欧美一区二区三区网站| 日韩三级av在线播放| 日韩一级成人av| 日韩手机在线导航| 91精品国产日韩91久久久久久| 欧美视频三区在线播放| 欧洲日韩一区二区三区| 91精品办公室少妇高潮对白| 99精品热视频| 99精品欧美一区二区蜜桃免费 | 亚洲va欧美va天堂v国产综合| 亚洲精品国产一区二区三区四区在线| 国产日本欧美一区二区| 中文字幕乱码久久午夜不卡| 亚洲国产精品成人综合色在线婷婷| 久久婷婷成人综合色| 国产午夜精品久久| 成人欧美一区二区三区1314| 亚洲免费成人av| 亚洲一二三四在线| 午夜不卡av在线| 久久97超碰色| 国产91精品入口| 国产盗摄精品一区二区三区在线 | 成人欧美一区二区三区视频网页 | 亚洲成人激情综合网| 亚洲不卡在线观看| 久久久综合激的五月天| 日韩一区二区在线播放| 欧美日韩免费视频| 欧美日韩不卡一区二区| 日韩一区二区精品在线观看| 91精品国模一区二区三区| 亚洲码国产岛国毛片在线| 一区二区三区在线观看网站| 亚洲成人福利片| 蜜臀精品一区二区三区在线观看| 久久精品国产精品亚洲精品| 国产福利精品一区| 99精品桃花视频在线观看| 欧美在线一区二区| 欧美精品一区视频| 亚洲女同ⅹxx女同tv| 亚洲国产一区二区a毛片| 久久精品国产亚洲一区二区三区| 成人性生交大片免费看中文| 欧美色爱综合网| 久久久久高清精品| 亚洲国产成人av好男人在线观看| 久久国产精品区| 欧洲国内综合视频| 久久一区二区三区国产精品| 亚洲精品日韩一| 国产乱国产乱300精品| 日韩av一级片| 美日韩黄色大片| 99re66热这里只有精品3直播| 欧美手机在线视频| 中文乱码免费一区二区| 视频一区二区中文字幕| 高清成人在线观看| 欧美电影免费观看高清完整版在线| 国产精品久久久99| 精品无人码麻豆乱码1区2区| 成人h动漫精品一区二区| 国产精品免费视频网站| 婷婷激情综合网| 成人精品免费网站| 日韩精品一区二区三区视频在线观看 | 国产精品久久久久久一区二区三区 | 色婷婷综合视频在线观看| 国产一区二区不卡在线| 色网站国产精品| 99re热视频精品| 中文字幕免费不卡| 91精品国产综合久久久蜜臀粉嫩| 欧美日韩亚洲国产综合| 久久精品这里都是精品| 日本亚洲最大的色成网站www| 色综合久久中文综合久久牛| 欧美精品一区二区三区在线播放 | 99v久久综合狠狠综合久久| 精品国产一区二区三区久久影院| 亚洲国产一区在线观看| 一本久久a久久精品亚洲| 国产精品九色蝌蚪自拍| 成人影视亚洲图片在线| 精品少妇一区二区三区免费观看| 天天综合色天天综合色h| www.色精品| 日韩理论片网站| 色婷婷狠狠综合| 亚洲一区视频在线观看视频| 欧美日韩一区二区三区在线看| 国产精品免费视频一区| 久久国产精品色婷婷|