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

📄 zdapp.lst

📁 用IAR开发的ZIGBEE网络路由例子
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00001E   90....       MOV     DPTR,#(NLME_GetExtAddr & 0xffff)
   \   000021   74..         MOV     A,#((NLME_GetExtAddr >> 16) & 0xff)
   \   000023   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    291          
    292            // Check for manual "Hold Auto Start"
    293            ZDAppCheckForHoldKey();
    294          
    295            // Initialize ZDO items and setup the device - type of device to create.
    296            ZDO_Init();
   \   000026                ; Setup parameters for call to function ZDO_Init
   \   000026   90....       MOV     DPTR,#(ZDO_Init & 0xffff)
   \   000029   74..         MOV     A,#((ZDO_Init >> 16) & 0xff)
   \   00002B   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    297          
    298            // Register the endpoint description with the AF
    299            // This task doesn't have a Simple description, but we still need
    300            // to register the endpoint.
    301            afRegister( (endPointDesc_t *)&ZDApp_epDesc );
   \   00002E                ; Setup parameters for call to function afRegister
   \   00002E   7A..         MOV     R2,#(ZDApp_epDesc & 0xff)
   \   000030   7B..         MOV     R3,#((ZDApp_epDesc >> 8) & 0xff)
   \   000032   90....       MOV     DPTR,#(afRegister & 0xffff)
   \   000035   74..         MOV     A,#((afRegister >> 16) & 0xff)
   \   000037   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    302          
    303          #if defined( ZDO_USERDESC_RESPONSE )
    304            ZDApp_InitUserDesc();
    305          #endif // ZDO_USERDESC_RESPONSE
    306          
    307          #if defined( ZDO_CACHE )
    308            ZDCacheInit();
    309          #endif
    310          
    311            // Setup the Zigbee Network Protocol Version
    312            ZDAppSetupProtoVersion();
   \   00003A                ; Setup parameters for call to function ZDAppSetupProtoVersion
   \   00003A   90....       MOV     DPTR,#(ZDAppSetupProtoVersion & 0xffff)
   \   00003D   74..         MOV     A,#((ZDAppSetupProtoVersion >> 16) & 0xff)
   \   00003F   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    313          
    314            // set broadcast address mask to support broadcast filtering
    315            NLME_GetRequest(nwkCapabilityInfo, 0, &capabilities);
   \   000042                ; Setup parameters for call to function NLME_GetRequest
   \   000042   85..82       MOV     DPL,?XSP + 0
   \   000045   85..83       MOV     DPH,?XSP + 1
   \   000048   AC82         MOV     R4,DPL
   \   00004A   AD83         MOV     R5,DPH
   \   00004C   7A00         MOV     R2,#0x0
   \   00004E   7B00         MOV     R3,#0x0
   \   000050   798F         MOV     R1,#-0x71
   \   000052   90....       MOV     DPTR,#(NLME_GetRequest & 0xffff)
   \   000055   74..         MOV     A,#((NLME_GetRequest >> 16) & 0xff)
   \   000057   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    316            NLME_SetBroadcastFilter( capabilities );
   \   00005A                ; Setup parameters for call to function NLME_SetBroadcastFilter
   \   00005A   85..82       MOV     DPL,?XSP + 0
   \   00005D   85..83       MOV     DPH,?XSP + 1
   \   000060   E0           MOVX    A,@DPTR
   \   000061   F9           MOV     R1,A
   \   000062   90....       MOV     DPTR,#(NLME_SetBroadcastFilter & 0xffff)
   \   000065   74..         MOV     A,#((NLME_SetBroadcastFilter >> 16) & 0xff)
   \   000067   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    317          
    318            // Start the device?
    319            if ( devState != DEV_HOLD )
   \   00006A   90....       MOV     DPTR,#devState
   \   00006D   E0           MOVX    A,@DPTR
   \   00006E   600B         JZ      ??ZDApp_Init_0
    320            {
    321              ZDOInitDevice( 0 );
   \   000070                ; Setup parameters for call to function ZDOInitDevice
   \   000070   7A00         MOV     R2,#0x0
   \   000072   7B00         MOV     R3,#0x0
   \   000074   90....       MOV     DPTR,#(ZDOInitDevice & 0xffff)
   \   000077   74..         MOV     A,#((ZDOInitDevice >> 16) & 0xff)
   \   000079   800F         SJMP    ??ZDApp_Init_1
    322            }
    323            else
    324            {
    325              // Blink LED to indicate HOLD_START
    326              HalLedBlink ( HAL_LED_4, 0, 50, 500 );
   \                     ??ZDApp_Init_0:
   \   00007B                ; Setup parameters for call to function HalLedBlink
   \   00007B   7CF4         MOV     R4,#-0xc
   \   00007D   7D01         MOV     R5,#0x1
   \   00007F   7B32         MOV     R3,#0x32
   \   000081   7A00         MOV     R2,#0x0
   \   000083   7908         MOV     R1,#0x8
   \   000085   90....       MOV     DPTR,#(HalLedBlink & 0xffff)
   \   000088   74..         MOV     A,#((HalLedBlink >> 16) & 0xff)
   \                     ??ZDApp_Init_1:
   \   00008A   02....       LJMP    ?Subroutine27 & 0xFFFF
    327            }
    328          } /* ZDO_Init() */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine27:
   \   000000   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   000003   7401         MOV     A,#0x1
   \   000005   12....       LCALL   ?DEALLOC_XSTACK8
   \                     ??Subroutine27_0:
   \   000008   D083         POP     DPH
   \   00000A   D082         POP     DPL
   \   00000C   02....       LJMP    ?BRET
    329          
    330          /*********************************************************************
    331           * @fn      ZDApp_event_loop()
    332           *
    333           * @brief   Main event loop for Zigbee device objects task. This function
    334           *          should be called at periodic intervals.
    335           *
    336           * @param   task_id - Task ID
    337           * @param   events  - Bitmap of events
    338           *
    339           * @return  none
    340           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    341          UINT16 ZDApp_event_loop( byte task_id, UINT16 events )
   \                     ZDApp_event_loop:
    342          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
    343            uint8 *msg_ptr;
    344          
    345            if ( events & SYS_EVENT_MSG )
   \   000009   7480         MOV     A,#-0x80
   \   00000B   5F           ANL     A,R7
   \   00000C   F9           MOV     R1,A
   \   00000D   E4           CLR     A
   \   00000E   7001         JNZ     ??ZDApp_event_loop_0
   \   000010   E9           MOV     A,R1
   \                     ??ZDApp_event_loop_0:
   \   000011   7040         JNZ     ??ZDApp_event_loop_1
    346            {
    347              while ( (msg_ptr = osal_msg_receive( ZDAppTaskID )) )
    348              {
    349                ZDApp_ProcessOSALMsg( (osal_event_hdr_t *)msg_ptr );
    350          
    351                // Release the memory
    352                osal_msg_deallocate( msg_ptr );
    353              }
    354          
    355              // Return unprocessed events
    356              return (events ^ SYS_EVENT_MSG);
    357            }
    358          
    359            if ( events & ZDO_NETWORK_INIT )
   \   000013   EE           MOV     A,R6
   \   000014   A2E0         MOV     C,0xE0 /* A   */.0
   \   000016   5059         JNC     ??ZDApp_event_loop_2
    360            {
    361              // Initialize apps and start the network
    362              devState = DEV_INIT;
   \   000018   7401         MOV     A,#0x1
   \   00001A   90....       MOV     DPTR,#devState
   \   00001D   F0           MOVX    @DPTR,A
    363              ZDO_StartDevice( (uint8)ZDO_Config_Node_Descriptor.LogicalType, devStartMode,
    364                               DEFAULT_BEACON_ORDER, DEFAULT_SUPERFRAME_ORDER );
   \   00001E                ; Setup parameters for call to function ZDO_StartDevice
   \   00001E   7C0F         MOV     R4,#0xf
   \   000020   7B0F         MOV     R3,#0xf
   \   000022   90....       MOV     DPTR,#devStartMode
   \   000025   E0           MOVX    A,@DPTR
   \   000026   FA           MOV     R2,A
   \   000027   90....       MOV     DPTR,#ZDO_Config_Node_Descriptor
   \   00002A   E0           MOVX    A,@DPTR
   \   00002B   5407         ANL     A,#0x7
   \   00002D   F9           MOV     R1,A
   \   00002E   90....       MOV     DPTR,#(ZDO_StartDevice & 0xffff)
   \   000031   74..         MOV     A,#((ZDO_StartDevice >> 16) & 0xff)
   \   000033   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    365          
    366              // Return unprocessed events
    367              return (events ^ ZDO_NETWORK_INIT);
   \   000036   7401         MOV     A,#0x1
   \                     ??ZDApp_event_loop_3:
   \   000038   6E           XRL     A,R6
   \   000039   FA           MOV     R2,A
   \   00003A   EF           MOV     A,R7
   \                     ??ZDApp_event_loop_4:
   \   00003B   FB           MOV     R3,A
   \   00003C   02....       LJMP    ??ZDApp_event_loop_5 & 0xFFFF
    368            }
   \                     ??ZDApp_event_loop_6:
   \   00003F                ; Setup parameters for call to function ZDApp_ProcessOSALMsg
   \   00003F   90....       MOV     DPTR,#(ZDApp_ProcessOSALMsg & 0xffff)
   \   000042   74..         MOV     A,#((ZDApp_ProcessOSALMsg >> 16) & 0xff)
   \   000044   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   000047                ; Setup parameters for call to function osal_msg_deallocate
   \   000047   AA..         MOV     R2,?V0 + 0
   \   000049   AB..         MOV     R3,?V0 + 1
   \   00004B   90....       MOV     DPTR,#(osal_msg_deallocate & 0xffff)
   \   00004E   74..         MOV     A,#((osal_msg_deallocate >> 16) & 0xff)
   \   000050   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \                     ??ZDApp_event_loop_1:
   \   000053                ; Setup parameters for call to function osal_msg_receive
   \   000053   90....       MOV     DPTR,#ZDAppTaskID
   \   000056   E0           MOVX    A,@DPTR
   \   000057   F9           MOV     R1,A
   \   000058   90....       MOV     DPTR,#(osal_msg_receive & 0xffff)
   \   00005B   74..         MOV     A,#((osal_msg_receive >> 16) & 0xff)
   \   00005D   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   000060   8A..         MOV     ?V0 + 0,R2
   \   000062   8B..         MOV     ?V0 + 1,R3
   \   000064   EA           MOV     A,R2
   \   000065   7001         JNZ     ??ZDApp_event_loop_7
   \   000067   EB           MOV     A,R3
   \                     ??ZDApp_event_loop_7:
   \   000068   70D5         JNZ     ??ZDApp_event_loop_6
   \   00006A   EE           MOV     A,R6
   \   00006B   FA           MOV     R2,A
   \   00006C   7480         MOV     A,#-0x80
   \                     ??ZDApp_event_loop_8:
   \   00006E   6F           XRL     A,R7
   \   00006F   80CA         SJMP    ??ZDApp_event_loop_4
    369          
    370          #if defined (RTR_NWK)
    371            if ( events & ZDO_NETWORK_START )
   \                     ??ZDApp_event_loop_2:
   \   000071   5402         ANL     A,#0x2
   \   000073   600C         JZ      ??ZDApp_event_loop_9
    372            {
    373              ZDApp_NetworkStartEvt();
   \   000075                ; Setup parameters for call to function ZDApp_NetworkStartEvt
   \   000075   90....       MOV     DPTR,#(ZDApp_NetworkStartEvt & 0xffff)
   \   000078   74..         MOV     A,#((ZDApp_NetworkStartEvt >> 16) & 0xff)
   \   00007A   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    374          
    375              // Return unprocessed events
    376              return (events ^ ZDO_NETWORK_START);
   \   00007D   7402         MOV     A,#0x2
   \                     ??ZDApp_event_loop_10:
   \   00007F   80B7         SJMP    ??ZDApp_event_loop_3
    377            }
    378          #endif  //RTR_NWK
    379          
    380          #if defined ( RTR_NWK )
    381            if ( events & ZDO_ROUTER_START )
   \                     ??ZDApp_event_loop_9:
   \   000081   EE           MOV     A,R6
   \   000082   5420         ANL     A,#0x20
   \   000084   6025         JZ      ??ZDApp_event_loop_11
    382            {
    383              if ( nwkStatus == ZSuccess )
   \   000086   90....       MOV     DPTR,#nwkStatus
   \   000089   E0           MOVX    A,@DPTR
   \   00008A   7015         JNZ     ??ZDApp_event_loop_12

⌨️ 快捷键说明

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