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

📄 os_cpu_c.lst

📁 基于51单片机UCOS移植
💻 LST
📖 第 1 页 / 共 2 页
字号:
 145          *
 146          * Note(s)    : 1) Interrupts are disabled during this call.
 147          *********************************************************************************************************
 148          */
 149          void OSTaskCreateHook (OS_TCB *ptcb) REENTRANT
 150          {
 151   1          ptcb = ptcb;                       /* Prevent compiler warning                                     */
 152   1      }
 153          
 154          /*
 155          *********************************************************************************************************
 156          *                                           TASK DELETION HOOK
 157          *
 158          * Description: This function is called when a task is deleted.
 159          *
 160          * Arguments  : ptcb   is a pointer to the task control block of the task being deleted.
 161          *
 162          * Note(s)    : 1) Interrupts are disabled during this call.
 163          *********************************************************************************************************
 164          */
 165          void OSTaskDelHook (OS_TCB *ptcb) REENTRANT
 166          {
 167   1          ptcb = ptcb;                       /* Prevent compiler warning                                     */
 168   1      }
 169          
 170          /*
 171          *********************************************************************************************************
 172          *                                           TASK SWITCH HOOK
 173          *
 174          * Description: This function is called when a task switch is performed.  This allows you to perform other
 175          *              operations during a context switch.
 176          *
 177          * Arguments  : none
 178          *
C51 COMPILER V9.01   OS_CPU_C                                                              10/31/2012 17:19:07 PAGE 4   

 179          * Note(s)    : 1) Interrupts are disabled during this call.
 180          *              2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
 181          *                 will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the 
 182          *                 task being switched out (i.e. the preempted task).
 183          *********************************************************************************************************
 184          */
 185          void OSTaskSwHook (void) REENTRANT
 186          { 
 187   1       /* P1=0xfe;
 188   1              Delay();
 189   1              P1=0x7f;
 190   1              Delay();
 191   1                                 */
 192   1      }
 193          
 194          /*
 195          *********************************************************************************************************
 196          *                                           STATISTIC TASK HOOK
 197          *
 198          * Description: This function is called every second by uC/OS-II's statistics task.  This allows your 
 199          *              application to add functionality to the statistics task.
 200          *
 201          * Arguments  : none
 202          *********************************************************************************************************
 203          */
 204          void OSTaskStatHook (void) REENTRANT
 205          {
 206   1      }
 207          
 208          /*
 209          *********************************************************************************************************
 210          *                                           OSTCBInit() HOOK
 211          *
 212          * Description: This function is called by OSTCBInit() after setting up most of the TCB.
 213          *
 214          * Arguments  : ptcb    is a pointer to the TCB of the task being created.
 215          *
 216          * Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
 217          *********************************************************************************************************
 218          */
 219          #if OS_VERSION > 203
 220          void OSTCBInitHook (OS_TCB *ptcb) REENTRANT
 221          {
 222   1          ptcb = ptcb;                                           /* Prevent Compiler warning                 */
 223   1      }
 224          #endif
 225          
 226          /*
 227          *********************************************************************************************************
 228          *                                               TICK HOOK
 229          *
 230          * Description: This function is called every tick.
 231          *
 232          * Arguments  : none
 233          *
 234          * Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
 235          *********************************************************************************************************
 236          */
 237          void OSTimeTickHook (void) REENTRANT
 238          {
 239   1      /*      P1=0xfe;
 240   1              Delay();
C51 COMPILER V9.01   OS_CPU_C                                                              10/31/2012 17:19:07 PAGE 5   

 241   1              P1=0x7f;
 242   1              Delay();        */
 243   1      }
 244          
 245          /*
 246          *********************************************************************************************************
 247          *                                             IDLE TASK HOOK
 248          *
 249          * Description: This function is called by the idle task.  This hook has been added to allow you to do  
 250          *              such things as STOP the CPU to conserve power.
 251          *
 252          * Arguments  : none
 253          *
 254          * Note(s)    : 1) Interrupts are enabled during this call.
 255          *********************************************************************************************************
 256          */
 257          #if OS_VERSION >= 251
 258          void OSTaskIdleHook (void) REENTRANT
 259          {
 260   1      /*      P1=0;
 261   1              P1=0xfe;
 262   1              Delay();
 263   1              P1=0x7f;
 264   1              Delay(); */
 265   1      }
 266          #endif
 267          
 268          #endif
 269          
 270          /********************************************************************************************************/
 271          
 272          /* 初始化定时器0,用于产生时钟节拍 */
 273          void InitTimer0(void) REENTRANT
 274          {
 275   1          TMOD=TMOD&0xF0;
 276   1          TMOD=TMOD|0x01;     /* 模式1(16位定时器),仅受TR0控制 */
 277   1              TH0=TIMER_20MS_TH0;
 278   1              TL0=TIMER_20MS_TL0;
 279   1              EA=0; /* EA和ET0,51上电缺省值为0,EA将在OSStartHighRdy()中打开 */
 280   1              ET0=0; /* 满足在OSStart()前不产生时钟中断的要求,系统启动后第一时间开定时器T0中断 */    
 281   1              TR0=1;   
 282   1      }
 283          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    759    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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