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

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

?? scu_bs.lst

?? 單片機串口RS485的讀寫操作,應用在多處理器中
?? 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:03:35 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:03:35 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:03:35 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:03:35 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一区二区三区免费野_久草精品视频
91麻豆精品在线观看| 另类小说色综合网站| 国产日产欧美一区二区视频| 精品国产sm最大网站免费看 | 久久久久久久久久久黄色| 欧美tickling挠脚心丨vk| 欧美一二三四区在线| 日韩视频一区二区| 日韩丝袜美女视频| 久久久午夜电影| 最新中文字幕一区二区三区| 亚洲综合色网站| 亚洲成人动漫av| 国模娜娜一区二区三区| 国产精品1024久久| 99这里只有久久精品视频| 一本大道久久精品懂色aⅴ| 欧美日韩精品一区二区在线播放 | 免费看欧美女人艹b| 蜜臀久久99精品久久久画质超高清 | 色婷婷av久久久久久久| 91精品国产黑色紧身裤美女| 久久新电视剧免费观看| 亚洲欧美在线高清| 亚洲图片欧美综合| 黑人精品欧美一区二区蜜桃| 成人av在线资源| 欧美日韩一区二区在线视频| 日韩欧美二区三区| 国产精品狼人久久影院观看方式| 一级特黄大欧美久久久| 久久se精品一区二区| 91视频国产观看| 欧美成人精精品一区二区频| 亚洲精选视频在线| 韩国精品在线观看| 欧美唯美清纯偷拍| 国产午夜精品在线观看| 亚洲成av人片一区二区梦乃| 国产伦精品一区二区三区视频青涩| 91在线丨porny丨国产| 日韩精品一区二区三区三区免费| 亚洲视频在线观看一区| 国产一区二区三区电影在线观看| 在线一区二区视频| 国产视频一区在线观看| 日韩电影在线看| 欧美亚州韩日在线看免费版国语版| 精品国产麻豆免费人成网站| 洋洋成人永久网站入口| 成人免费视频视频| 欧美zozozo| 午夜欧美在线一二页| 色综合色狠狠天天综合色| 国产夜色精品一区二区av| 日本不卡123| 欧美日韩一区二区三区四区五区 | 日韩欧美成人午夜| 午夜欧美在线一二页| 色综合久久久久网| 中文字幕不卡的av| 处破女av一区二区| 国产亚洲短视频| 国产一区二区三区四区五区美女| 欧美电影一区二区三区| 五月婷婷综合网| 欧美精品一二三四| 午夜婷婷国产麻豆精品| 欧美日韩国产在线观看| 一区二区三区在线看| 一本久久综合亚洲鲁鲁五月天| 国产精品国产三级国产普通话99| 国产suv精品一区二区6| 欧美高清在线一区| jizzjizzjizz欧美| 1000精品久久久久久久久| 91在线视频播放| 欧美一区二区日韩一区二区| 免费日韩伦理电影| 欧美一级理论片| 蜜桃视频在线一区| 久久蜜桃av一区精品变态类天堂| 国产乱人伦偷精品视频免下载 | 亚洲日本免费电影| 欧美综合久久久| 亚洲成人一区二区| 91精品午夜视频| 狠狠色丁香婷婷综合| 中文字幕精品—区二区四季| 色综合夜色一区| 亚洲成人一区在线| 欧美成人艳星乳罩| 成人午夜免费电影| 亚洲男人天堂av网| 91精品国产91久久久久久最新毛片| 日本欧美一区二区三区乱码 | 懂色av一区二区夜夜嗨| 国产精品久久久久久久久免费樱桃| 成人黄色小视频在线观看| 亚洲黄色性网站| 精品久久五月天| 91无套直看片红桃| 欧美aaa在线| 国产精品乱人伦| 欧美日韩国产一区| 国产精品亚洲视频| 中文字幕在线播放不卡一区| 欧美欧美午夜aⅴ在线观看| 国产真实乱对白精彩久久| 亚洲欧洲韩国日本视频| 欧美年轻男男videosbes| 国产乱一区二区| 亚洲国产aⅴ天堂久久| 国产亚洲一区二区三区四区| 在线观看日韩高清av| 久久99日本精品| 亚洲六月丁香色婷婷综合久久 | 欧美中文字幕不卡| 国产精品一二二区| 日韩国产欧美在线视频| 国产精品久久看| 精品少妇一区二区三区在线视频 | 日韩一区二区三区三四区视频在线观看| 国产精品一区2区| 日韩国产在线观看| 伊人夜夜躁av伊人久久| 中文字幕乱码亚洲精品一区 | 99视频国产精品| 蜜桃视频一区二区| 亚洲 欧美综合在线网络| 亚洲天堂精品视频| 国产亚洲视频系列| 日韩欧美国产一区二区三区| 欧美性videosxxxxx| 不卡av电影在线播放| 国产精品一区二区不卡| 久久国产剧场电影| 日本免费在线视频不卡一不卡二| 亚洲视频精选在线| 1区2区3区欧美| 国产精品―色哟哟| 国产天堂亚洲国产碰碰| 久久久亚洲午夜电影| 日韩精品在线看片z| 日韩精品一区二区三区蜜臀| 欧美一区二区三区思思人| 欧美影院一区二区三区| 色伊人久久综合中文字幕| www.日韩精品| 91日韩在线专区| av亚洲精华国产精华| heyzo一本久久综合| 不卡的av中国片| 色丁香久综合在线久综合在线观看| 不卡的av在线| 在线精品视频免费观看| 欧美最猛性xxxxx直播| 欧美日韩一区二区三区免费看| 欧美日韩亚洲另类| 欧美一区二区日韩一区二区| 精品国产一区久久| 久久久久99精品国产片| 国产精品私人影院| 亚洲色图视频网| 性久久久久久久| 老司机精品视频导航| 风流少妇一区二区| 91在线视频官网| 欧美男女性生活在线直播观看| 欧美一级午夜免费电影| 2023国产精华国产精品| 国产精品天美传媒沈樵| 亚洲欧美一区二区三区久本道91| 夜夜亚洲天天久久| 蜜臀av一区二区| 99免费精品视频| 欧美日韩和欧美的一区二区| 欧美一级午夜免费电影| 国产精品天干天干在观线| 亚洲电影视频在线| 精品一区二区久久久| 成人av综合在线| 欧美一区二区在线播放| 国产精品私人影院| 五月婷婷激情综合| 国产**成人网毛片九色| 91精品福利视频| 欧美成人性战久久| 亚洲精品高清视频在线观看| 久久精品理论片| 一本高清dvd不卡在线观看| 日韩丝袜情趣美女图片| 亚洲免费在线电影| 韩国精品主播一区二区在线观看| 日本高清视频一区二区| 久久婷婷久久一区二区三区| 亚洲成人动漫一区| 91美女视频网站| 亚洲精品一线二线三线无人区| 亚洲一区视频在线观看视频|