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

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

?? trqrucos.txt

?? ucos 在 Intel 196 單片機上的移植
?? TXT
字號:
This document gives an overview of the uCos.  To use uCos 4
files must be included, common.h (compiler specific and common
defines and typedefs), ucos.h (operating system files), 196.h
(or the processor specific include file) and apitsk.h (or the
application specific include file).  If OSReplce is not used the
196.h file is not needed.

#include "common.h" 
#include "ucos.h" 
#include "196.h" 
#include "jijitsk.h"

The following describes all the system calls available with some
examples.

Please Note: The routines marked with a (@) CAN NOT be used in
an ISR.


System Initialization
void OSInit(void); @--------	Initialize uCos
void OSStart(void); @-------	Start Multitasking

Example of  system initialization and starting:
int cmain(void) 
{ 
   DISABLE
   init_io();          /* hardware init */
   OSInit();           /* uCos init and also enables interrupts*/
   init_module1();     /* each module init and loads tasks needed */
   init_module2();     /* each module init and loads tasks needed */
   init_module3();     /* each module init and loads tasks needed */
   init_module4();     /* each module init and loads tasks needed */
   ENABLE   
   OSStart();          /* Starts uCos and never returns to main */ 
}



Task Management

BYTE OSTaskCreate(void(*task)(void *pd),void *pdata,void
*pstk,BYTE prio); @

task is the task to be created.

pdata is not used for T/Rs version and should be a zero.

pstk is the pointer to the stack area.

prio is the priority of the task to be created.

BYTE OSTaskDel(BYTE p); @------ Delete Task

p is the priority of the task to be deleted.

BYTE OSTaskChangePrio(BYTE oldp, BYTE newp); ------ Change Task
Priority

oldp is the old priority.

newp is the new priority.

void OSReplace(void ( *task)(void *pd), void *pstk );

task is the new task to be started.

pstk is the pointer to the top of the stack area.

void OSSchedLock(void); ----	Prevent Task Switching

void OSSchedUnlock(void); --	Allow Task Switching

Example:

void init_module1(void)

{
   OSTaskCreate((void *)TaskX,(void *)0,(void*)&Tsk1Stk[TSK1_STK_SIZE],TSK1_PRI);
   SSema1 = OSSemCreate(0);   
   SSema2 = OSSemCreate(0); 
   TSK1Mbox = OSMboxCreate((void *)0);
}
void TaskX(void)
{
   OSSchedLock();
   user_code();
   OSSchedUnlock();
   OSReplace((void *)TaskY,(void *)&TaskStk[STK_SIZE]);
}
void TaskY(void)
{
   user_code();
   if(z > y) 
      OSReplace((void *)TaskX,(void *)&TaskStk[STK_SIZE]);
   else
      OSTaskDel(TSK1_PRI);
}


Interrupt Management

void OSIntEnter(void); ------	Must be called on Interrupt entry.
 Keeps track of interrupt nesting.

void OSIntExit(void); -------	Must be called on Interrupt exit.
Does task switch if needed.

Time Management

void OSTimeDly(WORD ticks); @--- Delay task ticks number of system clock cycles. 
                      (if system tick=10msec and ticks=3, time of delay=30msec)

void OSTimeTick(void); ---------- System Clock routine.  This must be called 
                        to keep the system time clock.

void OSTimeSet(LONG ticks); --- Set system time to ticks.

LONG OSTimeGet(void); -------- Get current system time.

Example:

void stimer_irq( void )
{
   int_mask = gint_mask & ~(SWTIME);
   imask1 = gimask1 & ~(SER_RECV);
   OSIntEnter();
   ENABLE
   Mios1 |= ios1;
   if( (Mios1 & TIMER_0) ) /*  T I M E R 0  is system clock */
   {
	   Mios1 &= ~(TIMER_0);
      while( ios0 & HSO_HOLD_FULL ) {} /* wait for hso register to free*/
      sys_acc += TEN_MSEC;
      DISABLE
      hso_command = SWTIMER0;
      hso_time = sys_acc;
      ENABLE
      OSTimeTick();                         /* uCos system tick */
      if( Mios1 & (TIMER_1|TIMER_2|TIMER_3) )
         int_pending |= SWTIME;
   }
   OSIntExit();
}

Semaphore Management

OS_EVENT *OSSemCreate(SWORD value);@---- Create a Semaphore.

value is the initial value between 0 and 32767 of the semaphore.
 If a semaphore's initial value equals one then the first time
OSSemPend is called it will return immediately.  If however the
value equals zero then OSSemPend will wait for the first
occurrence of the semaphore.

BYTE OSSemPost(OS_EVENT *pevent);---- Signal a Semaphore. 
pevent is a pointer to a Semaphore.

void OSSemPend(OS_EVENT *pevent, WORD timeout, BYTE *err);@---- Wait for 
Semaphore.
pevent is a pointer to a Semaphore.
timeout is the value of system clock ticks before pending is
discontinued.
err  is the location for error information which is set by the
routine.

void OSSetSema(OS_EVENT *pevent, SWORD value);---- Set Semaphore
to value.
pevent is a pointer to a Semaphore.
value can be set between -32767 and 32767.  A negative number
means a task is waiting for this semaphore.  If the value equals
-3 then 3 task are pending on this semaphore.

Example:
void init_module1(void)
{
   OSTaskCreate((void *)Task1,(void *)0,(void*)&Tsk1Stk[TSK1_STK_SIZE],TSK1_PRI);
   OSTaskCreate((void *)Task2,(void *)0,(void*)&Tsk2Stk[TSK2_STK_SIZE],TSK1_PRI);
   SSema1 = OSSemCreate(0);   
   TSK2Mbox = OSMboxCreate((void *)0);
}
void Task1(void)
{
   while(1)
   {
      OSSemPost(SSema1);
      user_code();
      OSTimeDly(THIRTY_MSEC);
   }
}
void Task2(void)
{
   while(1)
   {
      user_code();
      OSSetSema(SSema1,-1);        /* sync to next SSema1 */
      OSSemPend(SSema1, 0, &err);
      user_code();
   }
}

Mail Management

OS_EVENT *OSMboxCreate(void *msg);@---- Create a mailbox.

void OSMboxPost(OS_EVENT *pmail, void *msg, BYTE p, BYTE
useAck);@---- Send message to a mailbox.  It will wait until the
mailbox is empty before sending the message and returning to the
sending task.
pmail is pointer to a mailbox.
msg is pointer to message to be sent.
p is priority of the sender ( this is only used when using ack ).
useAck is to indicate the use of acking a mail message.

void *OSMboxPend(OS_EVENT *pevent, WORD timeout, BYTE*err);@---- Waits for mail to be received.
pevent is pointer to a mailbox.
timeout is the value of system clock ticks before pending is
discontinued.
err  is the location for error information which is set by the
routine.

void *OSMboxAccept(OS_EVENT *pmail);@---- Checks the mailbox but
does not wait if it is empty.
pmail is pointer to a mailbox

void OSMailAck(OS_EVENT *pmail);@---- Wakes up task which is
waiting for message acknowledgment or does nothing if an ack is
not to be used.
pmail is pointer to a mailbox

Example:
CMD_MSG tsk2_mail_buf;

void init_module1(void)
{
   OSTaskCreate((void *)Task1,(void *)0,(void*)&Tsk1Stk[TSK1_STK_SIZE],TSK1_PRI);
   OSTaskCreate((void *)Task2,(void *)0,(void*)&Tsk2Stk[TSK2_STK_SIZE],TSK2_PRI);
   TSK1Mbox = OSMboxCreate((void *)0);
   TSK2Mbox = OSMboxCreate((void *)0);
}
void Task1(void)
{
   while(1)
   {
      tsk2_mail_buf.cmd = TEST1;
      OSMboxPost(Tsk2Mbox, &tsk2_mail_buf, TSK1_PRI, OS_USE_ACK);
      user_code();
      if( msg = OSMboxAccept(Tsk1Mbox) )
         switch(msg->cmd)
         {
            case CMD1:
               user_code();
            break;
         }
   }
}
void Task2(void)
{
BYTE err;
CMD_MSG *msg;

   while(1)
   {
      msg = OSMboxPend(Tsk2Mbox, 0, &err);
      decode_msg(msg);
      OSMailAck(Tsk2Mbox);
   }
}

Queue Management

OS_EVENT *OSQCreate(void **start, BYTE size);@---- Create a Queue.
start is the location of the first byte in the queue.
size is the number of bytes in the queue.

BYTE OSQPost(OS_EVENT *pevent, void *msg);---- Send message to queue.
pevent is a pointer to a Queue.
msg is message to be sent.

void *OSQPend(OS_EVENT *pevent, WORD timeout, BYTE *err);@---- Wait for 
message from queue.
pevent is a pointer to a Queue.
timeout is the value of system clock ticks before pending is discontinued.
err  is the location for error information which is set by the routine.

Multi-Event Management

void *OSEventPend(OS_EVENT *psema,OS_EVENT *pmail,WORD timeout,BYTE *err); 
@ Waits for either mail or a semaphore to occur before waking up the pending 
task.  It can also be used to pend on just a semaphore or mailbox.
psema is a pointer to a Semaphore.
pmail is pointer to a mailbox.
timeout is the value of system clock ticks before pending is discontinued.
err  is the location for error information which is set by the routine.
Example:

A) Mail Only
void Task(void)
{
BYTE err;
   msg = OSEventPend(0,Task1Mbox,0,&err);
   switch(msg->cmd)
   {
      case CMD1:
	break;
      case CMD2:
	break;
   }
}
	
B) Semaphore Only
void Task(void)
{
BYTE err;
   OSEventPend(Ssema1,0,0,&err);
   user_code_for_sema1();
}

C) Mail and Semaphore
void Task(void)
{
BYTE err;
   if(msg = OSEventPend(Ssema1,Task1Mbox,0,&err) == 0)
   {						/* semaphore occurred */
      user_code_for_sema1();
   } else					/* mail received */
   {
      switch(msg->cmd)
      {
         case CMD1:
	   break;
         case CMD2:
	   break;
      }
   }
}
The following file (ucoscfg.h) is to configure ucos to the users
application and reduce the RAM and ROM size.  The file as seen
below does not use queues, change priority routine and the debug
information.  It does uses the mail, semaphores and the multi
event routines.
/*==========================================================================*/
/*                U C O S C F G . H                                        */
/*==========================================================================*/
/* Changed < ucoscfg.h >  6-21-1994   4:56 PM   T/R Systems                */
/*==========================================================================*/
/* To comment out any of the following defines is to not use that section of*/
/* code described.                                                          */
/* Comment out              Aprox. Code Saving in bytes (on 80C196)         */
/* -----------              ---------------------------                     */
/*  USE_MAIL                   986                                          */
/*  USE_QUEUE                  848                                          */
/*  USE_SEMA                   572                                          */
/*  USE_CHG_PRIORITY           524                                          */
/*  USE_MULTI_EVENTS           350                                          */
/*  USE_DEBUG                   76                                          */
/*                                                                          */
/*                                                                          */
/* When USE_MULTI_EVENTS is set OSMboxPend and OSSemPend should not be used.*/
/* Instead use OSEventPend placing a 0 in place of the mailbox or semaphore.*/
/* Also note OSMboxPend and OSSemPend are not compilied which reduces the   */ 
/* code size by 378 and 292 bytes respectively.                             */
/*==========================================================================*/
/*==========================================================================*/
#define USE_MAIL 1                                       /* Use Mail system */
#define USE_SEMA 1                                        /* Use Semaphores */
#define USE_MULTI_EVENTS 1                  /* Use multi-event pend routine */
/*#define USE_QUEUE 1*/                                       /* Use Queues */
/*#define USE_CHG_PRIORITY 1*/               /* Use Change priority routine */
/*#define USE_DEBUG 1*/  /* Use for debug counters OSCtxSwCtr and OSIdleCtr */


#if USE_MULTI_EVENTS   /* mail and sema MUST be defined if multievents used */
#define USE_MAIL 1                                       /* Use Mail system */
#define USE_SEMA 1                                        /* Use Semaphores */
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线一区二区三区| 国产在线看一区| 国产清纯在线一区二区www| 欧美日韩国产综合一区二区| 中文字幕欧美一| 欧美激情一二三区| 久久久久久电影| eeuss国产一区二区三区| 国产乱子轮精品视频| 蜜桃视频在线一区| 久久精品国产免费| 亚洲桃色在线一区| 欧美一区二区视频网站| 欧美一级夜夜爽| 精品少妇一区二区三区免费观看 | av电影天堂一区二区在线| 国产精品一区二区无线| 成人午夜精品在线| 97精品久久久久中文字幕| 色呦呦国产精品| 这里只有精品视频在线观看| 精品久久久久久亚洲综合网| 久久综合久久鬼色| 国产精品家庭影院| 亚洲va欧美va国产va天堂影院| 久久久久久久久久久99999| 色诱视频网站一区| 国产又黄又大久久| 99视频国产精品| 欧美亚洲动漫另类| 精品国产1区二区| 中文字幕一区二区不卡| 天堂资源在线中文精品| 国产麻豆91精品| 91浏览器在线视频| 欧美一区二区三区公司| 亚洲国产成人自拍| 五月天精品一区二区三区| 国产精品一级黄| 在线观看av一区| 久久免费电影网| 一区二区日韩电影| 国产91在线观看丝袜| 欧洲在线/亚洲| 国产欧美日韩亚州综合| 精品999在线播放| 亚洲精品久久7777| 国产suv一区二区三区88区| 国产一区二区日韩精品| 欧美亚男人的天堂| 国产精品国产三级国产aⅴ原创| 国产日韩av一区| 丝袜国产日韩另类美女| 99国产精品久久久久久久久久久| 国产一区二区调教| 欧美自拍偷拍午夜视频| 中文字幕第一区综合| 久久电影网站中文字幕| 欧美日韩黄色一区二区| 亚洲天堂精品视频| 国产精品123| 在线不卡免费av| 亚洲同性gay激情无套| 亚洲精品国产a| 成人在线综合网| 久久女同精品一区二区| 国产午夜精品一区二区| 国产精品久久久久久久久免费桃花| 中国av一区二区三区| 韩国精品主播一区二区在线观看 | 韩国三级中文字幕hd久久精品| 久久99国产精品久久99| 九九在线精品视频| 日韩女优电影在线观看| 国产喂奶挤奶一区二区三区| 九九热在线视频观看这里只有精品| 国产91精品精华液一区二区三区| 99在线视频精品| 中文字幕中文在线不卡住| 国产福利精品一区二区| 国产偷v国产偷v亚洲高清| 国产成人综合精品三级| 日本高清不卡视频| 亚洲已满18点击进入久久| 色综合天天综合网天天狠天天| 69精品人人人人| 日韩av网站在线观看| 成人免费毛片app| 欧美美女一区二区在线观看| 精品国产1区2区3区| 国产在线不卡一卡二卡三卡四卡| 99精品久久免费看蜜臀剧情介绍 | 天堂av在线一区| 欧美一区二区免费视频| 精品亚洲国产成人av制服丝袜 | 成人av网址在线| 亚洲丝袜精品丝袜在线| 久久精品免费看| 国产午夜精品美女毛片视频| 白白色 亚洲乱淫| 亚洲午夜久久久久久久久电影网| 国产成人综合自拍| 国产精品丝袜91| 日本丶国产丶欧美色综合| 午夜精品久久久久久久| 精品久久久久久久久久久久久久久久久 | 精品国产一区二区三区不卡| 亚洲资源中文字幕| 日韩欧美综合在线| 成人在线视频一区二区| 一区二区三区四区蜜桃| 欧美一区二区三区人| 一区二区三区四区av| 日韩欧美一区中文| 亚洲福中文字幕伊人影院| 欧美成人bangbros| 91麻豆精东视频| 美女久久久精品| 亚洲精品一二三四区| www..com久久爱| 欧美aaa在线| 欧美电影在线免费观看| 亚洲综合视频网| 91极品视觉盛宴| 国产精品夜夜嗨| 亚洲成av人在线观看| 在线观看一区二区视频| 国产成人av自拍| 日韩精品免费视频人成| 1区2区3区欧美| 99re热视频这里只精品| 精品一区二区三区免费播放| 亚洲免费视频中文字幕| 欧美精品一区二区高清在线观看| 麻豆久久一区二区| 亚洲一区二区三区四区在线免费观看| 一本一道波多野结衣一区二区| 亚洲精品免费在线观看| 国产女主播在线一区二区| 91精品国产91综合久久蜜臀| 99re在线视频这里只有精品| 国产老女人精品毛片久久| 天堂影院一区二区| 一区二区三区四区高清精品免费观看| 色噜噜久久综合| 成人免费视频一区| 国产成人精品亚洲777人妖| 另类小说色综合网站| 亚洲一区二区影院| 欧美成人国产一区二区| 51精品视频一区二区三区| 色94色欧美sute亚洲13| 日本亚洲欧美天堂免费| 午夜精品一区二区三区免费视频| 欧美成人艳星乳罩| 不卡的电影网站| 成人午夜精品在线| 国产传媒一区在线| 国产精品不卡一区| 欧美精品成人一区二区三区四区| 亚洲一区二区在线免费观看视频 | 一级女性全黄久久生活片免费| 欧美日本在线看| 国产剧情一区二区三区| 国产麻豆精品视频| 国产精品1区二区.| 成人一区二区三区视频在线观看| 亚洲国产日韩一区二区| 亚洲国产欧美在线人成| 亚洲.国产.中文慕字在线| 久久网站热最新地址| 久久九九久精品国产免费直播| 色婷婷精品久久二区二区蜜臂av| 久久精品国产成人一区二区三区 | 日欧美一区二区| 亚洲色图在线播放| 亚洲精品一区二区精华| 一本大道久久精品懂色aⅴ| 欧美性大战久久久久久久蜜臀 | 国产成人亚洲综合a∨猫咪| 国产成人亚洲精品青草天美| 99久久婷婷国产综合精品电影 | 色婷婷精品大在线视频 | 亚洲欧美日韩一区二区| 亚洲国产精品欧美一二99| 天堂一区二区在线免费观看| 精品写真视频在线观看| 91网页版在线| 日韩一区二区影院| 国产精品丝袜91| 午夜视频久久久久久| 国产呦精品一区二区三区网站| 麻豆成人91精品二区三区| 亚洲精品亚洲人成人网| 免费在线视频一区| 99久久精品免费看国产| 91精品国产色综合久久| 亚洲色图19p| 激情欧美日韩一区二区| 91久久精品一区二区三区|