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

📄 mac_beacon_handler.lst

📁 zigbee location examples
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00004B   90....       MOV     DPTR,#(mrxIncrOnCounter & 0xffff)
   \   00004E   74..         MOV     A,#((mrxIncrOnCounter >> 16) & 0xff)
   \   000050   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
     93          
     94                  // Update buffered PIB attributes
     95                  mbcnUpdateBufferedPibAttributes();
   \   000053                ; Setup parameters for call to function mbcnUpdateBufferedPibAttributes
   \   000053   90....       MOV     DPTR,#(mbcnUpdateBufferedPibAttributes & 0xffff)
   \   000056   74..         MOV     A,#((mbcnUpdateBufferedPibAttributes >> 16) & 0xff)
   \   000058   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
     96          
     97                  // Schedule the next beacon handler, including XTAL error margin (the startup margin is cumulative when missing beacons)
     98                  mtimSetCallback(mbcnRxPeriodicalBeacon, msupCalcBeaconInterval() - mbcnGetBeaconMargin());
   \   00005B                ; Setup parameters for call to function msupCalcBeaconInterval
   \   00005B   12....       LCALL   msupCalcBeaconInterval & 0xFFFF
   \   00005E   8A..         MOV     ?V0 + 4,R2
   \   000060   8B..         MOV     ?V0 + 5,R3
   \   000062   8C..         MOV     ?V0 + 6,R4
   \   000064   8D..         MOV     ?V0 + 7,R5
   \   000066                ; Setup parameters for call to function mtimSetCallback
   \   000066                ; Setup parameters for call to function mbcnGetBeaconMargin
   \   000066   90....       MOV     DPTR,#(mbcnGetBeaconMargin & 0xffff)
   \   000069   74..         MOV     A,#((mbcnGetBeaconMargin >> 16) & 0xff)
   \   00006B   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   00006E   E9           MOV     A,R1
   \   00006F   F5..         MOV     ?V0 + 0,A
   \   000071   75..00       MOV     ?V0 + 1,#0x0
   \   000074   75..00       MOV     ?V0 + 2,#0x0
   \   000077   75..00       MOV     ?V0 + 3,#0x0
   \   00007A   78..         MOV     R0,#?V0 + 4
   \   00007C   79..         MOV     R1,#?V0 + 0
   \   00007E   12....       LCALL   ?L_SUB
   \   000081   78..         MOV     R0,#?V0 + 4
   \   000083   12....       LCALL   ?PUSH_XSTACK_I_FOUR
   \   000086   79..         MOV     R1,#(mbcnRxPeriodicalBeacon & 0xff)
   \   000088   7A..         MOV     R2,#((mbcnRxPeriodicalBeacon >> 8) & 0xff)
   \   00008A   7B..         MOV     R3,#((mbcnRxPeriodicalBeacon >> 16) & 0xff)
   \   00008C   12....       LCALL   mtimSetCallback & 0xFFFF
   \   00008F   7404         MOV     A,#0x4
   \   000091   12....       LCALL   ?DEALLOC_XSTACK8
     99          
    100                  // Set the RF channel (but don't mess up scanning)
    101                  if (!(macInfo.state & MAC_STATE_SCAN_BM)) msupSetChannel(ppib.phyCurrentChannel, FALSE);
   \   000094   90....       MOV     DPTR,#macInfo
   \   000097   E0           MOVX    A,@DPTR
   \   000098   A2E6         MOV     C,0xE0 /* A   */.6
   \   00009A   400A         JC      ??mbcnRxPeriodicalBeaconTask_3
   \   00009C                ; Setup parameters for call to function msupSetChannel
   \   00009C   7A00         MOV     R2,#0x0
   \   00009E   90....       MOV     DPTR,#ppib
   \   0000A1   E0           MOVX    A,@DPTR
   \   0000A2   F9           MOV     R1,A
   \   0000A3   12....       LCALL   msupSetChannel & 0xFFFF
    102          
    103                  // Set the off-timer (the off-time is also cumulative)
    104                  mtimSetCallback(mbcnRxBeaconTimeout, (UINT16) 2 * ((UINT16) aMaxLostBeacons - (UINT16) mbcnInfo.noBcnCountdown + (UINT16) 1) * (UINT16) mbcnGetBeaconMargin() + (UINT16) MBCN_RX_STARTUP_OVERHEAD);
   \                     ??mbcnRxPeriodicalBeaconTask_3:
   \   0000A6                ; Setup parameters for call to function mtimSetCallback
   \   0000A6   90....       MOV     DPTR,#(mbcnInfo + 7)
   \   0000A9   E0           MOVX    A,@DPTR
   \   0000AA   F8           MOV     R0,A
   \   0000AB   7405         MOV     A,#0x5
   \   0000AD   C3           CLR     C
   \   0000AE   98           SUBB    A,R0
   \   0000AF   F5..         MOV     ?V0 + 0,A
   \   0000B1   E4           CLR     A
   \   0000B2   9400         SUBB    A,#0x0
   \   0000B4   F5..         MOV     ?V0 + 1,A
   \   0000B6                ; Setup parameters for call to function mbcnGetBeaconMargin
   \   0000B6   90....       MOV     DPTR,#(mbcnGetBeaconMargin & 0xffff)
   \   0000B9   74..         MOV     A,#((mbcnGetBeaconMargin >> 16) & 0xff)
   \   0000BB   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   0000BE   E5..         MOV     A,?V0 + 0
   \   0000C0   89F0         MOV     B,R1
   \   0000C2   A4           MUL     AB
   \   0000C3   F8           MOV     R0,A
   \   0000C4   AAF0         MOV     R2,B
   \   0000C6   89F0         MOV     B,R1
   \   0000C8   E5..         MOV     A,?V0 + 1
   \   0000CA   A4           MUL     AB
   \   0000CB   2A           ADD     A,R2
   \   0000CC   F9           MOV     R1,A
   \   0000CD   E8           MOV     A,R0
   \   0000CE   C3           CLR     C
   \   0000CF   33           RLC     A
   \   0000D0   F8           MOV     R0,A
   \   0000D1   E9           MOV     A,R1
   \   0000D2   33           RLC     A
   \   0000D3   F9           MOV     R1,A
   \   0000D4   7402         MOV     A,#0x2
   \   0000D6   28           ADD     A,R0
   \   0000D7   F5..         MOV     ?V0 + 0,A
   \   0000D9   E4           CLR     A
   \   0000DA   39           ADDC    A,R1
   \   0000DB   F5..         MOV     ?V0 + 1,A
   \   0000DD   78..         MOV     R0,#?V0 + 0
   \   0000DF   12....       LCALL   ?PUSH_XSTACK_I_FOUR
   \   0000E2   79..         MOV     R1,#(mbcnRxBeaconTimeout & 0xff)
   \   0000E4   7A..         MOV     R2,#((mbcnRxBeaconTimeout >> 8) & 0xff)
   \   0000E6   7B..         MOV     R3,#((mbcnRxBeaconTimeout >> 16) & 0xff)
   \   0000E8   12....       LCALL   mtimSetCallback & 0xFFFF
   \   0000EB   7404         MOV     A,#0x4
   \   0000ED   12....       LCALL   ?DEALLOC_XSTACK8
    105          
    106                  // Finish this task, but keep the reservation!
    107                  mschRemoveTask(pTask->priority, MSCH_KEEP_TASK_RESERVED_BM);
   \   0000F0                ; Setup parameters for call to function mschRemoveTask
   \   0000F0   7A01         MOV     R2,#0x1
   \   0000F2   8E82         MOV     DPL,R6
   \   0000F4   8F83         MOV     DPH,R7
   \   0000F6   E0           MOVX    A,@DPTR
   \   0000F7   F9           MOV     R1,A
   \   0000F8   12....       LCALL   mschRemoveTask & 0xFFFF
    108              }
    109          
    110          } // mbcnRxPeriodicalBeaconTask
   \                     ??mbcnRxPeriodicalBeaconTask_2:
   \   0000FB   80..         SJMP    ??Subroutine1_0

   \                                 In segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine1:
   \   000000   12....       LCALL   ?DEALLOC_XSTACK8
   \                     ??Subroutine1_0:
   \   000003   7F08         MOV     R7,#0x8
   \   000005   02....       LJMP    ?BANKED_LEAVE_XDATA
    111          
    112          
    113          
    114          
    115          //-------------------------------------------------------------------------------------------------------
    116          //  void mbcnRxBeaconTimeout(void)
    117          //
    118          //  DESCRIPTION:
    119          //      Called when no beacon has been received. Decrements the counter which will give "beacon loss"
    120          //      when it reaches zero. This timeout is set up in mbcnRxPeriodicalBeaconTask().
    121          //-------------------------------------------------------------------------------------------------------

   \                                 In segment NEAR_CODE, align 1, keep-with-next
    122          void mbcnRxBeaconTimeout(void) NEAR {
   \                     mbcnRxBeaconTimeout:
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    123          
    124              // The beacon reception interval is over (mbcnRxBeacon)
    125              mrxDecrOnCounter();
   \   000004                ; Setup parameters for call to function mrxDecrOnCounter
   \   000004   90....       MOV     DPTR,#(mrxDecrOnCounter & 0xffff)
   \   000007   74..         MOV     A,#((mrxDecrOnCounter >> 16) & 0xff)
   \   000009   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    126          
    127              // Update the tracking counter...
    128              mbcnInfo.noBcnCountdown--;
   \   00000C   90....       MOV     DPTR,#(mbcnInfo + 7)
   \   00000F   E0           MOVX    A,@DPTR
   \   000010   14           DEC     A
   \   000011   02....       LJMP    ?Subroutine2
    129          
    130          } // mbcnRxBeaconTimeout

   \                                 In segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   F0           MOVX    @DPTR,A
   \                     ??Subroutine2_0:
   \   000001   D083         POP     DPH
   \   000003   D082         POP     DPL
   \   000005   02....       LJMP    ?BRET
    131          
    132          
    133          
    134          
    135          /*******************************************************************************************************
    136           *******************************************************************************************************
    137           **************************                BEACON TRANSMISSION                **************************
    138           *******************************************************************************************************
    139           *******************************************************************************************************/
    140          
    141          
    142          #if MAC_OPT_FFD
    143          
    144          //-------------------------------------------------------------------------------------------------------
    145          //  void mbcnTxPeriodicalBeacon(void)
    146          //
    147          //  DESCRIPTION:
    148          //      Creates the task that handles transmission of periodical beacons (in a beacon-enabled PAN)
    149          //-------------------------------------------------------------------------------------------------------

   \                                 In segment NEAR_CODE, align 1, keep-with-next
    150          void mbcnTxPeriodicalBeacon(void) NEAR {
   \                     mbcnTxPeriodicalBeacon:
   \   000000   74F5         MOV     A,#-0xb
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 11
   \   000005                ; Auto size: 0
    151              mschAddTask(mbcnInfo.txTaskNumber, MAC_TASK_PRI_HIGHEST, mbcnTxPeriodicalBeaconTask, NULL);
   \   000005                ; Setup parameters for call to function mschAddTask
   \   000005   75....       MOV     ?V0 + 0,#(mbcnTxPeriodicalBeaconTask & 0xff)
   \   000008   75....       MOV     ?V0 + 1,#((mbcnTxPeriodicalBeaconTask >> 8) & 0xff)
   \   00000B   75....       MOV     ?V0 + 2,#((mbcnTxPeriodicalBeaconTask >> 16) & 0xff)
   \   00000E   78..         MOV     R0,#?V0 + 0
   \   000010   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000013   7C00         MOV     R4,#0x0
   \   000015   7D00         MOV     R5,#0x0
   \   000017   7A03         MOV     R2,#0x3
   \   000019   90....       MOV     DPTR,#mbcnInfo
   \   00001C   02....       LJMP    ?Subroutine0
    152          } // mbcnTxPeriodicalBeacon
    153          
    154          
    155          
    156          
    157          //-------------------------------------------------------------------------------------------------------
    158          //  void mbcnTxPeriodicalBeaconTask(MAC_TASK_INFO *pTask)
    159          //
    160          //  DESCRIPTION:
    161          //      This task is responsible for beacon transmission, and a few other housekeeping procedures (see
    162          //      the function comments. When finished, this task will continue in the mtxStartTransmission
    163          //      function (the task function pointer and the state is modified.
    164          //
    165          //  TASK DATA:
    166          //      0
    167          //-------------------------------------------------------------------------------------------------------

   \                                 In segment NEAR_CODE, align 1, keep-with-next
    168          void mbcnTxPeriodicalBeaconTask(MAC_TASK_INFO *pTask) NEAR {

⌨️ 快捷键说明

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