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

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

?? scu_bs.lst

?? 時間觸發嵌入式系統設計模式源碼
?? LST
?? 第 1 頁 / 共 2 頁
字號:
 253   2               {
 254   3               Message_byte_G = 1;
 255   3               }
 256   2            else
 257   2               {
 258   3               Message_byte_G = 0;
 259   3               }
 260   2      
 261   2            // Check tick data - send ack if necessary
 262   2            // NOTE: 'START' message will only be sent after a 'time out'
 263   2            if (SCU_B_SLAVE_Process_Tick_Message() == SLAVE_ID)
 264   2               {
 265   3               SCU_B_SLAVE_Send_Ack_Message_To_Master();
 266   3      
 267   3               // Feed the watchdog ONLY when a *relevant* message is received
 268   3               // (noise on the bus, etc, will not stop the watchdog...)
 269   3               //
 270   3               // START messages will NOT refresh the slave
 271   3               // - Must talk to every slave at regular intervals 
 272   3               SCU_B_SLAVE_Watchdog_Refresh();
 273   3               }
 274   2      
 275   2            // NOTE: calculations are in *TICKS* (not milliseconds)
 276   2            for (Index = 0; Index < SCH_MAX_TASKS; Index++)
 277   2               {
 278   3               // Check if there is a task at this location
 279   3               if (SCH_tasks_G[Index].pTask)
 280   3                  {
 281   4                  if (SCH_tasks_G[Index].Delay == 0)
 282   4                     {
 283   5                     // The task is due to run
 284   5                     SCH_tasks_G[Index].RunMe = 1;  // Set the run flag
 285   5         
 286   5                     if (SCH_tasks_G[Index].Period)
 287   5                        {
 288   6                        // Schedule periodic tasks to run again
 289   6                        SCH_tasks_G[Index].Delay = SCH_tasks_G[Index].Period;
 290   6                        }
 291   5                     }
 292   4                  else
 293   4                     {
 294   5                     // Not yet ready to run: just decrement the delay 
 295   5                     SCH_tasks_G[Index].Delay -= 1;
 296   5                     }
 297   4                  }         
 298   3               }
 299   2            RI = 0;  // Reset the RI flag   
 300   2            }
 301   1         else
 302   1            {
 303   2            // ISR call was triggered by TI flag, after last character was sent
C51 COMPILER V6.10  SCU_BS                                                                 04/19/2001 14:00:19 PAGE 6   

 304   2      
 305   2            // RS485_Tx_Enable flag is reset here 
 306   2            RS485_Tx_Enable = 0;
 307   2      
 308   2            // Must clear the TI flag
 309   2            TI = 0;
 310   2            }
 311   1         }   
 312          
 313          /*------------------------------------------------------------------*-
 314          
 315            SCU_B_SLAVE_Send_Ack_Message_To_Master()
 316          
 317            Slave must send and 'Acknowledge' message to the master, after
 318            tick messages are received.  NOTE: Only tick messages specifically
 319            addressed to this slave should be acknowledged.
 320          
 321            The acknowledge message serves two purposes:
 322            [1] It confirms to the master that this slave is alive & well.
 323            [2] It provides a means of sending data to the master and - hence
 324                - to other slaves.
 325          
 326            NOTE: Direct data transfer between slaves is NOT possible.
 327          
 328          -*------------------------------------------------------------------*/
 329          void SCU_B_SLAVE_Send_Ack_Message_To_Master(void)
 330             {
 331   1         // Enable the slave RS-485 hardware (Tx)
 332   1         // NOTE: This flag will be reset in the 'Update' ISR
 333   1         RS485_Tx_Enable = 1;
 334   1      
 335   1         // Sending one byte of data at a time, depending on index value
 336   1         // If Message_byte_G is 0, send first byte (the slave ID)
 337   1         if (Message_byte_G == 0)
 338   1            {
 339   2            TI = 0;                                            
 340   2            TB8 = 1;  // Set 'Command' bit
 341   2            SBUF = SLAVE_ID;
 342   2            }
 343   1         else
 344   1            {
 345   2            // Message_byte_G is 1, send the data byte 
 346   2            TI = 0;
 347   2            TB8 = 0;
 348   2            SBUF = Ack_message_data_G;
 349   2            }
 350   1       
 351   1         // Data sent - return    
 352   1         }
 353          
 354          /*------------------------------------------------------------------*-
 355          
 356            SCU_B_SLAVE_Process_Tick_Message()
 357          
 358            The ticks messages are crucial to the operation of this shared-clock
 359            scheduler: the arrival of a tick message (at regular intervals) 
 360            invokes the 'Update' ISR, that drives the scheduler.
 361          
 362            The tick messages themselves may contain data.  These data are 
 363            extracted in this function. 
 364          
 365          -*------------------------------------------------------------------*/
C51 COMPILER V6.10  SCU_BS                                                                 04/19/2001 14:00:19 PAGE 7   

 366          tByte SCU_B_SLAVE_Process_Tick_Message(void)
 367             {
 368   1         tByte Data;
 369   1      
 370   1         // Try to get data byte
 371   1         if (RI == 0)
 372   1            {
 373   2            // No data - something is wrong
 374   2      
 375   2            // Set the error flag bit
 376   2            Network_error_pin = NETWORK_ERROR;
 377   2      
 378   2            // Return slave ID 0
 379   2            return 0x00;
 380   2            } 
 381   1       
 382   1         // There *ARE* data available
 383   1         Data = (tByte) SBUF;
 384   1         RI = 0;  // Clear RI flag
 385   1      
 386   1         // What we do with this message depends if it a first or second byte
 387   1         if (Message_byte_G == 0)
 388   1            {
 389   2            // This is (should be) an ID byte
 390   2            Message_ID_G = Data;   
 391   2      
 392   2            if (RB8 == 0)
 393   2               {
 394   3               Message_ID_G = 0;  // Command bit should be set
 395   3               }
 396   2            }
 397   1         else
 398   1            {
 399   2            // This is (should be) a data byte
 400   2            // - Command bit should not be set
 401   2            if ((Message_ID_G == SLAVE_ID) && (RB8 == 0))
 402   2               {
 403   3               Tick_message_data_G = Data;
 404   3               }
 405   2            else
 406   2               {
 407   3               // Something is wrong - set Message_ID to 0
 408   3               Message_ID_G = 0; 
 409   3      
 410   3               // Set the error flag bit
 411   3               Network_error_pin = NETWORK_ERROR;
 412   3               }
 413   2            }
 414   1      
 415   1         return Message_ID_G;
 416   1         }
 417          
 418          
 419          /*------------------------------------------------------------------*-
 420          
 421            SCU_B_SLAVE_Watchdog_Init()
 422          
 423            This function sets up the watchdog timer.
 424          
 425            If the Master fails (or other error develop), 
 426            no tick messages will arrive, and the scheduler
 427            will stop.  
C51 COMPILER V6.10  SCU_BS                                                                 04/19/2001 14:00:19 PAGE 8   

 428          
 429            To detect this situation, we have a (hardware) watchdog
 430            running in the slave.  This watchdog - which should be set to
 431            overflow at around 100ms - is used to set the system into a
 432            known (safe) state.  The slave will then wait (indefinitely)
 433            for the problem to be resolved.
 434          
 435            NOTE: The slave will not be generating Ack messages in these 
 436            circumstances.  The Master (if running) will therefore be aware
 437            that there is a problem.  
 438          
 439          -*------------------------------------------------------------------*/
 440          void SCU_B_SLAVE_Watchdog_Init(void)   
 441             {
 442   1         // INIT NOT REQUIRED FOR 1232 EXTERNAL WATCHDOG
 443   1         // - May be required wwith different watchdog hardware
 444   1         //
 445   1         // Edit as required
 446   1         }
 447          
 448          
 449          /*------------------------------------------------------------------*-
 450          
 451            SCU_B_SLAVE_Watchdog_Refresh()
 452          
 453            Feed the external (1232) watchdog.
 454          
 455            Timeout is between ~60 and 250 ms (hardware dependent)
 456          
 457            Assumes external 1232 watchdog
 458          
 459          -*------------------------------------------------------------------*/
 460          void SCU_B_SLAVE_Watchdog_Refresh(void) reentrant
 461             {
 462   1         // Change the state of the watchdog pin
 463   1         if (WATCHDOG_state_G == 1)
 464   1            {
 465   2            WATCHDOG_state_G = 0;
 466   2            WATCHDOG_pin = 0;
 467   2            }
 468   1         else
 469   1            {
 470   2            WATCHDOG_state_G = 1;
 471   2            WATCHDOG_pin = 1;
 472   2            } 
 473   1         }    
 474          
 475          /*------------------------------------------------------------------*-
 476          
 477            SCU_B_SLAVE_Enter_Safe_State()
 478          
 479            This is the state enterted by the system when:
 480            (1) The node is powered up or reset
 481            (2) The Master node fails, and no working backup is available
 482            (3) The network has an error
 483            (4) Tick messages are delayed for any other reason
 484          
 485            Try to ensure that the system is in a 'safe' state in these 
 486            circumstances.
 487          
 488          -*------------------------------------------------------------------*/
 489          void SCU_B_SLAVE_Enter_Safe_State(void)
C51 COMPILER V6.10  SCU_BS                                                                 04/19/2001 14:00:19 PAGE 9   

 490             {
 491   1         // USER DEFINED - Edit as required
 492   1         TRAFFIC_LIGHTS_Display_Safe_Output();
 493   1         }  
 494          
 495          /*------------------------------------------------------------------*-
 496            ---- END OF FILE -------------------------------------------------
 497          -*------------------------------------------------------------------*/
 498          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    427    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      3       5
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      2       1
END OF MODULE INFORMATION.


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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩不卡免费视频| 国产精品99久久久久久有的能看| 日本欧美加勒比视频| 国产精品亚洲成人| 91麻豆精品国产91久久久久久久久| 国产日韩欧美一区二区三区综合| 亚洲一二三区视频在线观看| 国产在线精品视频| 91精品国产综合久久福利软件 | 欧美日韩国产影片| 国产女主播一区| 精品一区二区综合| 欧美二区乱c少妇| 亚洲免费大片在线观看| 成人小视频在线| 26uuu国产在线精品一区二区| 五月激情六月综合| 91久久一区二区| 日韩伦理av电影| 国产成人亚洲综合色影视| 日韩欧美aaaaaa| 欧美三级视频在线播放| 日本一区二区三区在线观看| 久久国产精品色婷婷| 欧美丰满嫩嫩电影| 日韩中文字幕区一区有砖一区| 91视频一区二区| 中文字幕日韩精品一区| 成人av中文字幕| 中文字幕一区在线观看| 不卡免费追剧大全电视剧网站| 久久精品视频一区| 国产成人鲁色资源国产91色综 | 91精品免费在线| 婷婷综合五月天| 欧美另类变人与禽xxxxx| 午夜精品影院在线观看| 国产日韩欧美在线一区| 国产成人在线观看免费网站| 久久精品人人做人人综合| 国产麻豆精品theporn| 精品国产91久久久久久久妲己| 麻豆精品在线视频| 久久久久久亚洲综合影院红桃| 精品在线观看免费| 中文字幕电影一区| 97国产一区二区| 亚洲电影激情视频网站| 91精品一区二区三区在线观看| 日本不卡不码高清免费观看| 久久嫩草精品久久久久| 成人一区二区三区视频在线观看| 国产精品国产三级国产专播品爱网 | 中文无字幕一区二区三区 | 激情六月婷婷久久| 欧美国产精品久久| 欧美亚洲综合色| 久久91精品久久久久久秒播| 久久久精品免费网站| 9i看片成人免费高清| 亚洲第一综合色| 精品久久久久久久久久久久久久久| 国产乱码精品一区二区三| 亚洲欧美日韩在线| 日韩视频一区在线观看| 成人在线综合网站| 亚洲一区二区欧美激情| 久久综合九色综合久久久精品综合 | 欧美视频一区二区三区在线观看| 日韩激情av在线| 国产精品天天看| 91精品欧美久久久久久动漫| 成人午夜电影久久影院| 亚洲第一av色| 国产精品美女视频| 欧美一区二区观看视频| 91网页版在线| 狠狠色丁香久久婷婷综合_中| 亚洲欧美偷拍三级| 精品成人佐山爱一区二区| 日本电影亚洲天堂一区| 国产盗摄视频一区二区三区| 五月婷婷综合网| 国产精品第13页| 欧美精品一区二区三区一线天视频| 色婷婷综合激情| 欧美精品在线观看一区二区| 国产成人av网站| 欧美aa在线视频| 亚洲在线中文字幕| 中文字幕精品在线不卡| 欧美一区永久视频免费观看| 色综合天天视频在线观看| 国产一区二区三区久久久| 日本午夜精品视频在线观看| 亚洲伦理在线免费看| 亚洲国产精品99久久久久久久久| 日韩欧美国产麻豆| 欧美日韩高清一区二区不卡| 91丨九色丨尤物| 成人激情小说乱人伦| 久久精品国产99久久6| 亚洲国产欧美另类丝袜| 亚洲麻豆国产自偷在线| 国产精品久久综合| 国产欧美一区二区精品性| 欧美sm美女调教| 欧美一二三四区在线| 91精品黄色片免费大全| 欧美日韩黄色影视| 欧美三级日韩在线| 在线观看欧美黄色| 色爱区综合激月婷婷| 91在线视频观看| 99精品视频在线观看| 99久久精品免费看国产免费软件| 国产成人精品一区二区三区网站观看| 经典三级在线一区| 麻豆91免费观看| 国产一区亚洲一区| 国产精品一区二区在线观看不卡| 制服丝袜亚洲精品中文字幕| 在线播放91灌醉迷j高跟美女| 欧美日韩视频在线一区二区| 欧美区一区二区三区| 日韩一区二区三| www激情久久| 国产精品区一区二区三区| 国产精品高清亚洲| 亚洲一区二区三区视频在线播放| 亚洲综合视频在线观看| 日韩国产欧美在线观看| 国产综合色产在线精品| 成人激情图片网| 在线观看av不卡| 日韩一区二区三区高清免费看看| 精品av综合导航| 国产精品国产三级国产普通话99| 一区二区三区产品免费精品久久75| 亚洲综合一区二区| 免费精品视频最新在线| 国产成人免费视频网站| 99久久国产免费看| 欧美日韩国产在线观看| 久久蜜桃av一区二区天堂| 亚洲色图欧洲色图| 美女尤物国产一区| 成人高清视频在线观看| 欧美伦理视频网站| 久久久久久综合| 一二三四社区欧美黄| 狠狠色狠狠色综合| 91黄色免费看| 精品久久久久久无| 成人免费一区二区三区在线观看| 午夜免费欧美电影| 国产不卡视频一区| 在线不卡的av| 中文字幕视频一区二区三区久| 日韩和欧美的一区| 99精品视频一区二区三区| 欧美喷潮久久久xxxxx| 中文字幕 久热精品 视频在线| 亚洲图片一区二区| 99视频一区二区| 26uuu亚洲| 偷拍亚洲欧洲综合| 色综合av在线| 国产喂奶挤奶一区二区三区| 日韩成人午夜精品| 日本高清无吗v一区| 久久久亚洲综合| 免费成人在线观看| 在线观看一区二区视频| 中文文精品字幕一区二区| 久久er精品视频| 欧美日韩免费视频| 日韩毛片在线免费观看| 国产成人在线免费观看| 26uuu久久天堂性欧美| 五月婷婷另类国产| 在线观看一区日韩| 亚洲欧美日本在线| 成人国产精品免费网站| 精品久久国产老人久久综合| 天天色天天操综合| 欧美另类z0zxhd电影| 一区二区三区四区蜜桃| 91视频在线观看| 亚洲女爱视频在线| 99精品欧美一区二区三区小说| 国产拍揄自揄精品视频麻豆| 国产最新精品精品你懂的| 日韩欧美一区二区在线视频| 亚州成人在线电影| 欧美精品一二三四| 日韩高清中文字幕一区| 欧美福利一区二区| 日韩高清电影一区| 91麻豆精品国产自产在线|