###############################################################################
#                                                                             #
# IAR 8051 C/C++ Compiler V7.30B/W32                    12/Sep/2010  21:57:29 #
# Copyright 2004-2007 IAR Systems. All rights reserved.                       #
#                                                                             #
#    Core               =  plain                                              #
#    Code model         =  banked                                             #
#    Data model         =  large                                              #
#    Calling convention =  xdata reentrant                                    #
#    Constant location  =  data                                               #
#    Dptr setup         =  1,16                                               #
#    Source file        =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Compone #
#                          nts\mac\low_level\srf03\mac_backoff_timer.c        #
#    Command line       =  -f "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\Tools\CC2430DB\f8wRouter.cf #
#                          g" (-DCPU32MHZ -DFORCE_MAC_NEAR                    #
#                          -DROOT=__near_func -DMAC_CFG_APP_PENDING_QUEUE=TRU #
#                          E -DRTR_NWK -DBLINK_LEDS "-DCONST=const __code"    #
#                          -DGENERIC=__generic) -f "C:\Texas Instruments      #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\Tools\CC2430DB\f8wConfig.cf #
#                          g" (-DSECURE=1 -DDEFAULT_CHANLIST=0x04000000       #
#                          -DZDAPP_CONFIG_PAN_ID=0x00FF                       #
#                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_MA #
#                          SK=0x007F -DBEACON_REQUEST_DELAY=100               #
#                          -DBEACON_REQ_DELAY_MASK=0x00FF                     #
#                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_PO #
#                          LLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7             #
#                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3   #
#                          -DNWK_MAX_DATA_RETRIES=2                           #
#                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9         #
#                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20           #
#                          -DNWK_MAX_BINDING_ENTRIES=10                       #
#                          -DMAX_BINDING_CLUSTER_IDS=5 "-DDEFAULT_KEY={0x02,  #
#                          0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00,    #
#                          0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"         #
#                          -DRFD_RCVC_ALWAYS_ON=FALSE -DPOLL_RATE=1000        #
#                          -DQUEUED_POLL_RATE=100 -DRESPONSE_POLL_RATE=100)   #
#                          -DREJOIN_POLL_RATE=440 "C:\Texas Instruments       #
#                          33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf #
#                          03\mac_backoff_timer.c" -D CC2430EB -D             #
#                          LOCATION_REFNODE -D xNV_RESTORE -D ZTOOL_P1 -D     #
#                          MT_TASK -D POWER_SAVING -D HAL_UART_BIG_TX_BUF=1   #
#                          -D SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D             #
#                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas           #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\RefNode\List\" -lA       #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\RefNode\List\" #
#                           --diag_suppress Pe001,Pa010 --diag_remark pe550   #
#                          -o "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\RefNode\Obj\" -e                     #
#                          --require_prototypes -z9 --no_code_motion --debug  #
#                          --core=plain --dptr=16,1 --data_model=large        #
#                          --code_model=banked --calling_convention=xdata_ree #
#                          ntrant --place_constants=data --nr_virtual_regs 8  #
#                          -I "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\" -I "C:\Texas Instruments           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\SOURCE\" -I "C:\Texas             #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MT\" -I    #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\HAL\INCLUDE\" -I "C:\Texas             #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\..\..\COMPONENT #
#                          S\HAL\TARGET\CC2430BB\" -I "C:\Texas Instruments   #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\MCU\C #
#                          CSOC\" -I "C:\Texas Instruments                    #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\INCLU #
#                          DE\" -I "C:\Texas Instruments                      #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\AF\" #
#                           -I "C:\Texas Instruments                          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\NWK\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SEC\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SYS\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\ZDO\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\F8W\" #
#                           -I "C:\Texas Instruments                          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\" -I  #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\SERVICES\SADDR\" -I "C:\Texas          #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\..\..\COMPONENT #
#                          S\SERVICES\SDATA\" -I "C:\Texas Instruments        #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\INCLUD #
#                          E\" -I "C:\Texas Instruments                       #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\HIGH_L #
#                          EVEL\" -I "C:\Texas Instruments                    #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_LE #
#                          VEL\SRF03\" -I "C:\Texas Instruments               #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_LE #
#                          VEL\SRF03\SINGLE_CHIP\" -I "C:\Program Files\IAR   #
#                          Systems\Embedded Workbench 4.0 Evaluation          #
#                          version\8051\INC\" -I "C:\Program Files\IAR        #
#                          Systems\Embedded Workbench 4.0 Evaluation          #
#                          version\8051\INC\CLIB\"                            #
#    List file          =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Project #
#                          s\zstack\Project\Location\CC2430DB\RefNode\List\ma #
#                          c_backoff_timer.lst                                #
#    Object file        =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Project #
#                          s\zstack\Project\Location\CC2430DB\RefNode\Obj\mac #
#                          _backoff_timer.r51                                 #
#                                                                             #
#                                                                             #
###############################################################################

C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf03\mac_backoff_timer.c
      1          /**************************************************************************************************
      2            Filename:       mac_backoff_timer.c
      3            Revised:        $Date: 2007-10-29 22:38:47 -0700 (Mon, 29 Oct 2007) $
      4            Revision:       $Revision: 15812 $
      5          
      6            Description:    Describe the purpose and contents of the file.
      7          
      8          
      9            Copyright 2006-2007 Texas Instruments Incorporated. All rights reserved.
     10          
     11            IMPORTANT: Your use of this Software is limited to those specific rights
     12            granted under the terms of a software license agreement between the user
     13            who downloaded the software, his/her employer (which must be your employer)
     14            and Texas Instruments Incorporated (the "License").  You may not use this
     15            Software unless you agree to abide by the terms of the License. The License
     16            limits your use, and you acknowledge, that the Software may not be modified,
     17            copied or distributed unless embedded on a Texas Instruments microcontroller
     18            or used solely and exclusively in conjunction with a Texas Instruments radio
     19            frequency transceiver, which is integrated into your product.  Other than for
     20            the foregoing purpose, you may not use, reproduce, copy, prepare derivative
     21            works of, modify, distribute, perform, display or sell this Software and/or
     22            its documentation for any purpose.
     23          
     24            YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
     25            PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, 
     26            INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, 
     27            NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
     28            TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
     29            NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
     30            LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
     31            INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
     32            OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
     33            OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
     34            (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
     35          
     36            Should you have any questions regarding your right to use this Software,
     37            contact Texas Instruments Incorporated at www.TI.com. 
     38          **************************************************************************************************/
     39          
     40          /* ------------------------------------------------------------------------------------------------
     41           *                                           Includes
     42           * ------------------------------------------------------------------------------------------------
     43           */
     44          
     45          /* hal */
     46          #include "hal_types.h"
     47          #include "hal_mcu.h"

   \                                 In  segment SFR_AN, at 0xa6
   \   unsigned char volatile __sfr T2TLD
   \                     T2TLD:
   \   000000                DS 1

   \                                 In  segment SFR_AN, at 0xa7
   \   unsigned char volatile __sfr T2THD
   \                     T2THD:
   \   000000                DS 1

   \                                 In  segment SFR_AN, at 0xa8
   \   union <unnamed> volatile __sfr _A_IEN0
   \                     _A_IEN0:
   \   000000                DS 1

   \                                 In  segment SFR_AN, at 0xc3
   \   unsigned char volatile __sfr T2CNF
   \                     T2CNF:
   \   000000                DS 1
     48          
     49          /* high-level specific */
     50          #include "mac_spec.h"
     51          
     52          /* exported low-level */
     53          #include "mac_low_level.h"
     54          
     55          /* low-level specific */
     56          #include "mac_backoff_timer.h"
     57          #include "mac_tx.h"
     58          
     59          /* target specific */
     60          #include "mac_radio_defs.h"
     61          
     62          /* debug */
     63          #include "mac_assert.h"
     64          
     65          
     66          /* ------------------------------------------------------------------------------------------------
     67           *                                            Defines
     68           * ------------------------------------------------------------------------------------------------
     69           */
     70          #define COMPARE_STATE_ROLLOVER_BV                 BV(0)
     71          #define COMPARE_STATE_TRIGGER_BV                  BV(1)
     72          #define COMPARE_STATE_ARM_BV                      BV(2)
     73          
     74          #define COMPARE_STATE_TRIGGER                     COMPARE_STATE_TRIGGER_BV
     75          #define COMPARE_STATE_ROLLOVER                    COMPARE_STATE_ROLLOVER_BV
     76          #define COMPARE_STATE_ROLLOVER_AND_TRIGGER        (COMPARE_STATE_ROLLOVER_BV | COMPARE_STATE_TRIGGER_BV)
     77          #define COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER    (COMPARE_STATE_ROLLOVER_BV | COMPARE_STATE_ARM_BV)
     78          
     79          
     80          /*
     81           *  The datasheet mentions a small delay on both receive and transmit side of approximately
     82           *  two microseconds.  The precise characterization is given below.
     83           *  (This data is not given in rev 1.03 datasheet)
     84           */
     85          #define RX_TX_PROP_DELAY_AVG_USEC         ((MAC_RADIO_RX_TX_PROP_DELAY_MIN_USEC + MAC_RADIO_RX_TX_PROP_DELAY_MAX_USEC) / 2)
     86          #define RX_TX_PROP_DELAY_AVG_TIMER_TICKS  ((uint16)(MAC_RADIO_TIMER_TICKS_PER_USEC() * RX_TX_PROP_DELAY_AVG_USEC + 0.5))
     87          
     88          /*
     89           *  For slotted receives, the SFD signal is expected to occur on a specifc symbol boundary.
     90           *  This does *not* correspond to the backoff boundary.  The SFD signal occurs at an
     91           *  offset from the backoff boundary.  This is done for efficiency of related algorithms.
     92           *
     93           *  Once transmit is strobed there is a fixed delay until the SFD signal occurs.  The frame
     94           *  does not start over-the-air transmit until after an internal radio delay of 12 symbols.
     95           *  Once transmitting over-the-air, the preamble is sent (8 symbols) followed by the
     96           *  SFD field (2 symbols). After the SFD field completes, the SFD signal occurs.  This
     97           *  adds up to a total of 22 symbols from strobe to SFD signal.
     98           *
     99           *  Since 22 symbols spans more than a backoff (20 symbols) the modulus operation is used
    100           *  to find the symbol offset which is 2 symbols.
    101           *
    102           *  This math is derived formally via the pre-processor.
    103           */
    104          #define SYMBOLS_FROM_STROBE_TO_PREAMBLE   12 /* from datasheet */
    105          #define SYMBOLS_FROM_PREAMBLE_TO_SFD      (MAC_SPEC_PREAMBLE_FIELD_LENGTH + MAC_SPEC_SFD_FIELD_LENGTH)
    106          #define SYMBOLS_FROM_STROBE_TO_SFD        (SYMBOLS_FROM_STROBE_TO_PREAMBLE + SYMBOLS_FROM_PREAMBLE_TO_SFD)
    107          #define SYMBOLS_EXPECTED_AT_SFD           (SYMBOLS_FROM_STROBE_TO_SFD % MAC_A_UNIT_BACKOFF_PERIOD)
    108          
    109          /* after all that formal math, make sure the result is as expected */
    110          #if (SYMBOLS_EXPECTED_AT_SFD != 2)
    111          #error "ERROR! Internal problem with pre-processor math of slotted alignment."
    112          #endif
    113          
    114          
    115          /*
    116           *  The expected SFD signal occurs at the symbol offset *plus* a small internal propagation delay
    117           *  internal to the radio.  This delay is given as the sum of a receive side delay and a transmit
    118           *  side delay.  When this delay is subtracted from the internal timer, the internal time base
    119           *  actually becomes the actual receive time *minus* the transmit delay.  This works out though.
    120           *  The transmit logic does *not* take into account this delay.  Since the timer is skewed by the
    121           *  transmit delay already, the transmits go out precisely on time.
    122           */
    123          #define TIMER_TICKS_EXPECTED_AT_SFD   ((SYMBOLS_EXPECTED_AT_SFD * MAC_RADIO_TIMER_TICKS_PER_SYMBOL()) \
    124                                                    + RX_TX_PROP_DELAY_AVG_TIMER_TICKS)
    125          
    126          
    127          /* ------------------------------------------------------------------------------------------------
    128           *                                         Local Variables
    129           * ------------------------------------------------------------------------------------------------
    130           */

   \                                 In  segment XDATA_Z, align 1, keep-with-next
    131          static uint32 backoffTimerRollover;
   \                     backoffTimerRollover:
   \   000000                DS 4
   \   000004                REQUIRE __INIT_XDATA_Z

   \                                 In  segment XDATA_Z, align 1, keep-with-next
    132          static uint32 backoffTimerTrigger;
   \                     backoffTimerTrigger:
   \   000000                DS 4
   \   000004                REQUIRE __INIT_XDATA_Z

   \                                 In  segment XDATA_Z, align 1, keep-with-next
    133          static uint8 compareState;
   \                     compareState:
   \   000000                DS 1
   \   000001                REQUIRE __INIT_XDATA_Z
    134          
    135          
    136          /**************************************************************************************************
    137           * @fn          macBackoffTimerInit
    138           *
    139           * @brief       Intializes backoff timer.
    140           *
    141           * @param       none
    142           *
    143           * @return      none
    144           **************************************************************************************************
    145           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    146          void macBackoffTimerInit(void)
   \                     macBackoffTimerInit:
    147          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
    148            compareState = COMPARE_STATE_ROLLOVER;
   \   000005   7401         MOV     A,#0x1
   \   000007   90....       MOV     DPTR,#compareState
   \   00000A   F0           MOVX    @DPTR,A
    149            MAC_RADIO_BACKOFF_SET_COUNT(0);
   \   00000B                ; Setup parameters for call to function macMcuOverflowSetCount
   \   00000B   90....       MOV     DPTR,#__Constant_0
   \   00000E   78..         MOV     R0,#?V0 + 0
   \   000010   12....       LCALL   ?L_MOV_X
   \   000013   AA..         MOV     R2,?V0 + 0
   \   000015   AB..         MOV     R3,?V0 + 1
   \   000017   AC..         MOV     R4,?V0 + 2
   \   000019   AD..         MOV     R5,?V0 + 3
   \   00001B   12....       LCALL   ??macMcuOverflowSetCount?relay
    150            macBackoffTimerSetRollover(MAC_BACKOFF_TIMER_DEFAULT_ROLLOVER);
   \   00001E                ; Setup parameters for call to function macBackoffTimerSetRollover
   \   00001E   90....       MOV     DPTR,#__Constant_c0000
   \   000021   78..         MOV     R0,#?V0 + 0
   \   000023   12....       LCALL   ?L_MOV_X
   \   000026   AA..         MOV     R2,?V0 + 0
   \   000028   AB..         MOV     R3,?V0 + 1
   \   00002A   AC..         MOV     R4,?V0 + 2
   \   00002C   AD..         MOV     R5,?V0 + 3
   \   00002E   12....       LCALL   ??macBackoffTimerSetRollover?relay
    151            MAC_RADIO_BACKOFF_COMPARE_CLEAR_INTERRUPT();
   \   000031   75C3C3       MOV     0xc3,#-0x3d
    152            MAC_RADIO_BACKOFF_COMPARE_ENABLE_INTERRUPT();
   \   000034                ; Setup parameters for call to function macMcuOrT2PEROF2
   \   000034   7920         MOV     R1,#0x20
   \   000036   12....       LCALL   ??macMcuOrT2PEROF2?relay
    153          }
   \   000039   02....       LJMP    ?Subroutine6 & 0xFFFF
   \   00003C                REQUIRE T2CNF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine6:
   \   000000   7F04         MOV     R7,#0x4
   \   000002   02....       LJMP    ?BANKED_LEAVE_XDATA
    154          
    155          
    156          /**************************************************************************************************
    157           * @fn          macBackoffTimerReset
    158           *
    159           * @brief       Resets backoff timer.
    160           *
    161           * @param       none
    162           *
    163           * @return      none
    164           **************************************************************************************************
    165           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    166          void macBackoffTimerReset(void)
   \                     macBackoffTimerReset:
    167          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    168            MAC_RADIO_BACKOFF_COMPARE_DISABLE_INTERRUPT();
   \   000004                ; Setup parameters for call to function macMcuAndT2PEROF2
   \   000004   79DF         MOV     R1,#-0x21
   \   000006   12....       LCALL   ??macMcuAndT2PEROF2?relay
    169            macBackoffTimerInit();
   \   000009                ; Setup parameters for call to function macBackoffTimerInit
   \   000009   12....       LCALL   ??macBackoffTimerInit?relay
    170          }
   \   00000C   D083         POP     DPH
   \   00000E   D082         POP     DPL
   \   000010   02....       LJMP    ?BRET
    171          
    172          
    173          /**************************************************************************************************
    174           * @fn          macBackoffTimerSetRollover
    175           *
    176           * @brief       Set rollover count of backoff timer.
    177           *
    178           * @param       rolloverBackoff - backoff count where count is reset to zero
    179           *
    180           * @return      none
    181           **************************************************************************************************
    182           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    183          void macBackoffTimerSetRollover(uint32 rolloverBackoff)
   \                     macBackoffTimerSetRollover:
    184          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
   \   000005   8A..         MOV     ?V0 + 0,R2
   \   000007   8B..         MOV     ?V0 + 1,R3
   \   000009   8C..         MOV     ?V0 + 2,R4
   \   00000B   8D..         MOV     ?V0 + 3,R5
    185            halIntState_t  s;
    186          
    187            MAC_ASSERT(rolloverBackoff > MAC_RADIO_BACKOFF_COUNT());  /* rollover value must be greater than count */
   \   00000D                ; Setup parameters for call to function macMcuOverflowCount
   \   00000D   12....       LCALL   ?Subroutine0 & 0xFFFF
   \                     ??CrossCallReturnLabel_0:
   \   000010   12....       LCALL   ?UL_GT
   \   000013   4003         JC      ??macBackoffTimerSetRollover_0
   \   000015                ; Setup parameters for call to function halAssertHandler
   \   000015   12....       LCALL   ??halAssertHandler?relay
    188          
    189            HAL_ENTER_CRITICAL_SECTION(s);
   \                     ??macBackoffTimerSetRollover_0:
   \   000018   A2AF         MOV     C,0xa8.7
   \   00001A   E4           CLR     A
   \   00001B   92E0         MOV     0xE0 /* A   */.0,C
   \   00001D   FE           MOV     R6,A
   \   00001E   C2AF         CLR     0xa8.7
    190            backoffTimerRollover = rolloverBackoff;
   \   000020   90....       MOV     DPTR,#backoffTimerRollover
   \   000023   78..         MOV     R0,#?V0 + 0
   \   000025   12....       LCALL   ?L_MOV_TO_X
    191            MAC_RADIO_BACKOFF_SET_COMPARE(rolloverBackoff);
   \   000028                ; Setup parameters for call to function macMcuOverflowSetCompare
   \   000028                REQUIRE ?Subroutine7
   \   000028                REQUIRE _A_IEN0
   \   000028                ; // Fall through to label ?Subroutine7
    192            HAL_EXIT_CRITICAL_SECTION(s);
    193          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine7:
   \   000000   12....       LCALL   ?Subroutine2 & 0xFFFF
   \                     ??CrossCallReturnLabel_9:
   \   000003   02....       LJMP    ?BANKED_LEAVE_XDATA

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   12....       LCALL   ?Subroutine5 & 0xFFFF
   \                     ??CrossCallReturnLabel_10:
   \   000003   7F08         MOV     R7,#0x8
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   12....       LCALL   ??macMcuOverflowCount?relay
   \   000003   8A..         MOV     ?V0 + 4,R2
   \   000005   8B..         MOV     ?V0 + 5,R3
   \   000007   8C..         MOV     ?V0 + 6,R4
   \   000009   8D..         MOV     ?V0 + 7,R5
   \   00000B   78..         MOV     R0,#?V0 + 0
   \   00000D   79..         MOV     R1,#?V0 + 4
   \   00000F   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine5:
   \   000000   AA..         MOV     R2,?V0 + 0
   \   000002   AB..         MOV     R3,?V0 + 1
   \   000004   AC..         MOV     R4,?V0 + 2
   \   000006   AD..         MOV     R5,?V0 + 3
   \   000008   12....       LCALL   ??macMcuOverflowSetCompare?relay
   \   00000B   EE           MOV     A,R6
   \   00000C   A2E0         MOV     C,0xE0 /* A   */.0
   \   00000E   92AF         MOV     0xa8.7,C
   \   000010   22           RET
    194          
    195          
    196          /**************************************************************************************************
    197           * @fn          macBackoffTimerSetCount
    198           *
    199           * @brief       Sets the count of the backoff timer.
    200           *
    201           * @param       backoff - new count
    202           *
    203           * @return      none
    204           **************************************************************************************************
    205           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    206          void macBackoffTimerSetCount(uint32 backoff)
   \                     macBackoffTimerSetCount:
    207          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
   \   000005   8A..         MOV     ?V0 + 4,R2
   \   000007   8B..         MOV     ?V0 + 5,R3
   \   000009   8C..         MOV     ?V0 + 6,R4
   \   00000B   8D..         MOV     ?V0 + 7,R5
    208            halIntState_t  s;
    209          
    210            MAC_ASSERT(compareState == COMPARE_STATE_ROLLOVER);   /* trigger cannot be active if changing count */
   \   00000D   90....       MOV     DPTR,#compareState
   \   000010   E0           MOVX    A,@DPTR
   \   000011   6401         XRL     A,#0x1
   \   000013   6003         JZ      ??macBackoffTimerSetCount_0
   \   000015                ; Setup parameters for call to function halAssertHandler
   \   000015   12....       LCALL   ??halAssertHandler?relay
    211            MAC_ASSERT(backoff < backoffTimerRollover);  /* count must be less than rollover value */
   \                     ??macBackoffTimerSetCount_0:
   \   000018   90....       MOV     DPTR,#backoffTimerRollover
   \   00001B   78..         MOV     R0,#?V0 + 0
   \   00001D   12....       LCALL   ?L_MOV_X
   \   000020   78..         MOV     R0,#?V0 + 0
   \   000022   79..         MOV     R1,#?V0 + 4
   \   000024   12....       LCALL   ?UL_GT
   \   000027   4003         JC      ??macBackoffTimerSetCount_1
   \   000029                ; Setup parameters for call to function halAssertHandler
   \   000029   12....       LCALL   ??halAssertHandler?relay
    212            MAC_ASSERT(!(backoff & 0x80000000));  /* count must not represent negative value for int32 */
   \                     ??macBackoffTimerSetCount_1:
   \   00002C   85....       MOV     ?V0 + 0,?V0 + 4
   \   00002F   85....       MOV     ?V0 + 1,?V0 + 5
   \   000032   85....       MOV     ?V0 + 2,?V0 + 6
   \   000035   85....       MOV     ?V0 + 3,?V0 + 7
   \   000038   90....       MOV     DPTR,#__Constant_80000000
   \   00003B   78..         MOV     R0,#?V0 + 0
   \   00003D   12....       LCALL   ?L_AND_X
   \   000040   90....       MOV     DPTR,#__Constant_0
   \   000043   78..         MOV     R0,#?V0 + 0
   \   000045   12....       LCALL   ?L_EQ_X
   \   000048   6003         JZ      ??macBackoffTimerSetCount_2
   \   00004A                ; Setup parameters for call to function halAssertHandler
   \   00004A   12....       LCALL   ??halAssertHandler?relay
    213          
    214            HAL_ENTER_CRITICAL_SECTION(s);
   \                     ??macBackoffTimerSetCount_2:
   \   00004D   A2AF         MOV     C,0xa8.7
   \   00004F   E4           CLR     A
   \   000050   92E0         MOV     0xE0 /* A   */.0,C
   \   000052   FE           MOV     R6,A
   \   000053   C2AF         CLR     0xa8.7
    215            MAC_RADIO_BACKOFF_SET_COUNT(backoff);
   \   000055                ; Setup parameters for call to function macMcuOverflowSetCount
   \   000055   AA..         MOV     R2,?V0 + 4
   \   000057   AB..         MOV     R3,?V0 + 5
   \   000059   AC..         MOV     R4,?V0 + 6
   \   00005B   AD..         MOV     R5,?V0 + 7
   \   00005D   12....       LCALL   ??macMcuOverflowSetCount?relay
    216            HAL_EXIT_CRITICAL_SECTION(s);
   \   000060   EE           MOV     A,R6
   \   000061   A2E0         MOV     C,0xE0 /* A   */.0
   \   000063   92AF         MOV     0xa8.7,C
    217          }
   \   000065   80..         SJMP    ?Subroutine8
   \   000067                REQUIRE _A_IEN0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine8:
   \   000000   7F08         MOV     R7,#0x8
   \   000002   02....       LJMP    ?BANKED_LEAVE_XDATA
    218          
    219          
    220          /**************************************************************************************************
    221           * @fn          macBackoffTimerCount
    222           *
    223           * @brief       Returns the current backoff count.
    224           *
    225           * @param       none
    226           *
    227           * @return      current backoff count
    228           **************************************************************************************************
    229           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    230          uint32 macBackoffTimerCount(void)
   \                     macBackoffTimerCount:
    231          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
    232            halIntState_t  s;
    233            uint32 backoffCount;
    234          
    235            HAL_ENTER_CRITICAL_SECTION(s);
   \   000005   A2AF         MOV     C,0xa8.7
   \   000007   E4           CLR     A
   \   000008   92E0         MOV     0xE0 /* A   */.0,C
   \   00000A   FE           MOV     R6,A
   \   00000B   C2AF         CLR     0xa8.7
    236            backoffCount = MAC_RADIO_BACKOFF_COUNT();
   \   00000D                ; Setup parameters for call to function macMcuOverflowCount
   \   00000D   12....       LCALL   ?Subroutine1 & 0xFFFF
    237            HAL_EXIT_CRITICAL_SECTION(s);
   \                     ??CrossCallReturnLabel_2:
   \   000010   EE           MOV     A,R6
   \   000011   A2E0         MOV     C,0xE0 /* A   */.0
   \   000013   92AF         MOV     0xa8.7,C
    238            
    239          #ifdef MAC_RADIO_FEATURE_HARDWARE_OVERFLOW_NO_ROLLOVER
    240            /*
    241             *  Extra processing is required if the radio has a special hardware overflow
    242             *  count feature.  Unfortunately this feature does not provide for setting a
    243             *  rollover value.  This must be done manually.
    244             *
    245             *  This means there is a small window in time when reading the hardware count
    246             *  will be inaccurate.  It's possible it could be one more than the allowable
    247             *  count.  This happens if the count has just incremented beyond the maximum
    248             *  and is queried before the ISR has a chance to run and reset the backoff
    249             *  count back to zero.  (Pure software implementation of backoff count does
    250             *  not have this problem.)
    251             *
    252             *  To solve this, before returning a value for the backoff count, the value
    253             *  must be tested to see if it is beyond the maximum value.  If so, a rollover
    254             *  interrupt that will set backoff count to zero is imminent.  In that case,
    255             *  the correct backoff count of zero is returned.
    256             */
    257            if (backoffCount >= backoffTimerRollover)
   \   000015   90....       MOV     DPTR,#backoffTimerRollover
   \   000018   78..         MOV     R0,#?V0 + 4
   \   00001A   12....       LCALL   ?L_MOV_X
   \   00001D   78..         MOV     R0,#?V0 + 4
   \   00001F   79..         MOV     R1,#?V0 + 0
   \   000021   12....       LCALL   ?UL_GT
   \   000024   4008         JC      ??macBackoffTimerCount_0
    258            {
    259              return(0);
   \   000026   7A00         MOV     R2,#0x0
   \   000028   7B00         MOV     R3,#0x0
   \   00002A   7C00         MOV     R4,#0x0
   \   00002C   7D00         MOV     R5,#0x0
    260            }
    261          #endif
    262            
    263            return(backoffCount);
   \                     ??macBackoffTimerCount_0:
   \   00002E   80..         SJMP    ?Subroutine8
   \   000030                REQUIRE _A_IEN0
    264          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine1:
   \   000000   12....       LCALL   ??macMcuOverflowCount?relay
   \   000003   8A..         MOV     ?V0 + 0,R2
   \   000005   8B..         MOV     ?V0 + 1,R3
   \   000007   8C..         MOV     ?V0 + 2,R4
   \   000009   8D..         MOV     ?V0 + 3,R5
   \   00000B   22           RET
    265          
    266          
    267          /**************************************************************************************************
    268           * @fn          macBackoffTimerCapture
    269           *
    270           * @brief       Returns the most recently captured backoff count
    271           *
    272           * @param       none
    273           *
    274           * @return      last backoff count that was captured
    275           **************************************************************************************************
    276           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    277          uint32 macBackoffTimerCapture(void)
   \                     macBackoffTimerCapture:
    278          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
    279            halIntState_t  s;
    280            uint32 backoffCapture;
    281          
    282            HAL_ENTER_CRITICAL_SECTION(s);
   \   000005   A2AF         MOV     C,0xa8.7
   \   000007   E4           CLR     A
   \   000008   92E0         MOV     0xE0 /* A   */.0,C
   \   00000A   FE           MOV     R6,A
   \   00000B   C2AF         CLR     0xa8.7
    283            backoffCapture = MAC_RADIO_BACKOFF_CAPTURE();
   \   00000D                ; Setup parameters for call to function macMcuOverflowCapture
   \   00000D   12....       LCALL   ??macMcuOverflowCapture?relay
   \   000010   8A..         MOV     ?V0 + 0,R2
   \   000012   8B..         MOV     ?V0 + 1,R3
   \   000014   8C..         MOV     ?V0 + 2,R4
   \   000016   8D..         MOV     ?V0 + 3,R5
    284            HAL_EXIT_CRITICAL_SECTION(s);
   \   000018   EE           MOV     A,R6
   \   000019   A2E0         MOV     C,0xE0 /* A   */.0
   \   00001B   92AF         MOV     0xa8.7,C
    285          
    286          #ifdef MAC_RADIO_FEATURE_HARDWARE_OVERFLOW_NO_ROLLOVER
    287            /*
    288             *  See other instance of this #ifdef for detailed comments.
    289             *  Those comments apply to the backoff capture value too.
    290             */
    291            if (backoffCapture >= backoffTimerRollover)
   \   00001D   90....       MOV     DPTR,#backoffTimerRollover
   \   000020   78..         MOV     R0,#?V0 + 4
   \   000022   12....       LCALL   ?L_MOV_X
   \   000025   78..         MOV     R0,#?V0 + 4
   \   000027   79..         MOV     R1,#?V0 + 0
   \   000029   12....       LCALL   ?UL_GT
   \   00002C   4008         JC      ??macBackoffTimerCapture_0
    292            {
    293              return(0);
   \   00002E   7A00         MOV     R2,#0x0
   \   000030   7B00         MOV     R3,#0x0
   \   000032   7C00         MOV     R4,#0x0
   \   000034   7D00         MOV     R5,#0x0
    294            }
    295          #endif
    296            
    297            return(backoffCapture);
   \                     ??macBackoffTimerCapture_0:
   \   000036                REQUIRE ?Subroutine8
   \   000036                REQUIRE _A_IEN0
   \   000036                ; // Fall through to label ?Subroutine8
    298          }
    299          
    300          
    301          /**************************************************************************************************
    302           * @fn          macBackoffTimerGetTrigger
    303           *
    304           * @brief       Returns the trigger set for the backoff timer.
    305           *
    306           * @param       none
    307           *
    308           * @return      backoff count of trigger
    309           **************************************************************************************************
    310           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    311          uint32 macBackoffTimerGetTrigger(void)
   \                     macBackoffTimerGetTrigger:
    312          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
    313            return(backoffTimerTrigger);
   \   000005   90....       MOV     DPTR,#backoffTimerTrigger
   \   000008   78..         MOV     R0,#?V0 + 0
   \   00000A   12....       LCALL   ?L_MOV_X
   \   00000D   AA..         MOV     R2,?V0 + 0
   \   00000F   AB..         MOV     R3,?V0 + 1
   \   000011   AC..         MOV     R4,?V0 + 2
   \   000013   AD..         MOV     R5,?V0 + 3
   \   000015   02....       LJMP    ?Subroutine6 & 0xFFFF
    314          }
    315          
    316          
    317          /**************************************************************************************************
    318           * @fn          macBackoffTimerSetTrigger
    319           *
    320           * @brief       Sets the trigger count for the backoff counter.  A callback is exectuted when
    321           *              the backoff count reaches the trigger
    322           *
    323           * @param       triggerBackoff - backoff count for new trigger
    324           *
    325           * @return      none
    326           **************************************************************************************************
    327           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    328          void macBackoffTimerSetTrigger(uint32 triggerBackoff)
   \                     macBackoffTimerSetTrigger:
    329          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
   \   000005   8A..         MOV     ?V0 + 0,R2
   \   000007   8B..         MOV     ?V0 + 1,R3
   \   000009   8C..         MOV     ?V0 + 2,R4
   \   00000B   8D..         MOV     ?V0 + 3,R5
    330            halIntState_t  s;
    331          
    332            MAC_ASSERT(triggerBackoff < backoffTimerRollover); /* trigger backoff must be less than rollover backoff */
   \   00000D   90....       MOV     DPTR,#backoffTimerRollover
   \   000010   78..         MOV     R0,#?V0 + 4
   \   000012   12....       LCALL   ?L_MOV_X
   \   000015   78..         MOV     R0,#?V0 + 4
   \   000017   79..         MOV     R1,#?V0 + 0
   \   000019   12....       LCALL   ?UL_GT
   \   00001C   4003         JC      ??macBackoffTimerSetTrigger_0
   \   00001E                ; Setup parameters for call to function halAssertHandler
   \   00001E   12....       LCALL   ??halAssertHandler?relay
    333          
    334            HAL_ENTER_CRITICAL_SECTION(s);
   \                     ??macBackoffTimerSetTrigger_0:
   \   000021   A2AF         MOV     C,0xa8.7
   \   000023   E4           CLR     A
   \   000024   92E0         MOV     0xE0 /* A   */.0,C
   \   000026   FE           MOV     R6,A
   \   000027   C2AF         CLR     0xa8.7
    335            backoffTimerTrigger = triggerBackoff;
   \   000029   90....       MOV     DPTR,#backoffTimerTrigger
   \   00002C   78..         MOV     R0,#?V0 + 0
   \   00002E   12....       LCALL   ?L_MOV_TO_X
    336            if (triggerBackoff > MAC_RADIO_BACKOFF_COUNT())
   \   000031                ; Setup parameters for call to function macMcuOverflowCount
   \   000031   12....       LCALL   ?Subroutine0 & 0xFFFF
   \                     ??CrossCallReturnLabel_1:
   \   000034   12....       LCALL   ?UL_GT
   \   000037   5008         JNC     ??macBackoffTimerSetTrigger_1
    337            {
    338              compareState = COMPARE_STATE_TRIGGER;
   \   000039   7402         MOV     A,#0x2
   \   00003B   90....       MOV     DPTR,#compareState
   \   00003E   F0           MOVX    @DPTR,A
    339              MAC_RADIO_BACKOFF_SET_COMPARE(triggerBackoff);
   \   00003F                ; Setup parameters for call to function macMcuOverflowSetCompare
   \   00003F   8016         SJMP    ??macBackoffTimerSetTrigger_2
    340            }
    341            else
    342            {
    343              if (triggerBackoff == 0)
   \                     ??macBackoffTimerSetTrigger_1:
   \   000041   90....       MOV     DPTR,#__Constant_0
   \   000044   78..         MOV     R0,#?V0 + 0
   \   000046   12....       LCALL   ?L_EQ_X
   \   000049   7004         JNZ     ??macBackoffTimerSetTrigger_3
    344              {
    345                compareState = COMPARE_STATE_ROLLOVER_AND_TRIGGER;
   \   00004B   7403         MOV     A,#0x3
   \   00004D   8002         SJMP    ??macBackoffTimerSetTrigger_4
    346              }
    347              else
    348              {
    349                compareState = COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER;
   \                     ??macBackoffTimerSetTrigger_3:
   \   00004F   7405         MOV     A,#0x5
   \                     ??macBackoffTimerSetTrigger_4:
   \   000051   12....       LCALL   ??Subroutine3_0 & 0xFFFF
    350              }
    351              MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerRollover);
   \                     ??CrossCallReturnLabel_6:
   \   000054   12....       LCALL   ?L_MOV_X
   \                     ??macBackoffTimerSetTrigger_2:
   \   000057   02....       LJMP    ?Subroutine7 & 0xFFFF
   \   00005A                REQUIRE _A_IEN0
    352            }
    353            HAL_EXIT_CRITICAL_SECTION(s);
    354          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine3:
   \   000000   7401         MOV     A,#0x1
   \                     ??Subroutine3_0:
   \   000002   90....       MOV     DPTR,#compareState
   \   000005   F0           MOVX    @DPTR,A
   \   000006                ; Setup parameters for call to function macMcuOverflowSetCompare
   \   000006                ; Setup parameters for call to function macMcuOverflowSetCompare
   \   000006                ; Setup parameters for call to function macMcuOverflowSetCompare
   \   000006   90....       MOV     DPTR,#backoffTimerRollover
   \   000009   78..         MOV     R0,#?V0 + 0
   \   00000B   22           RET
    355          
    356          
    357          /**************************************************************************************************
    358           * @fn          macBackoffTimerCancelTrigger
    359           *
    360           * @brief       Cancels the trigger for the backoff counter.
    361           *
    362           * @param       none
    363           *
    364           * @return      none
    365           **************************************************************************************************
    366           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    367          void macBackoffTimerCancelTrigger(void)
   \                     macBackoffTimerCancelTrigger:
    368          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
    369            halIntState_t  s;
    370          
    371            HAL_ENTER_CRITICAL_SECTION(s);
   \   000005   A2AF         MOV     C,0xa8.7
   \   000007   E4           CLR     A
   \   000008   92E0         MOV     0xE0 /* A   */.0,C
   \   00000A   FE           MOV     R6,A
   \   00000B   C2AF         CLR     0xa8.7
    372            compareState = COMPARE_STATE_ROLLOVER;
   \   00000D   12....       LCALL   ?Subroutine3 & 0xFFFF
    373            MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerRollover);
   \                     ??CrossCallReturnLabel_4:
   \   000010   12....       LCALL   ?L_MOV_X
   \   000013   12....       LCALL   ?Subroutine4 & 0xFFFF
    374            HAL_EXIT_CRITICAL_SECTION(s);
    375          }
   \                     ??CrossCallReturnLabel_7:
   \   000016                REQUIRE ?Subroutine6
   \   000016                REQUIRE _A_IEN0
   \   000016                ; // Fall through to label ?Subroutine6

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine4:
   \   000000   12....       LCALL   ?Subroutine5 & 0xFFFF
   \                     ??CrossCallReturnLabel_11:
   \   000003   22           RET
    376          
    377          
    378          /**************************************************************************************************
    379           * @fn          macBackoffTimerRealign
    380           *
    381           * @brief       
    382           *
    383           *  Realignment is accomplished by adjusting the internal time base to align with the expected
    384           *  reception time of an incoming frame.  The difference between the expected reception time and
    385           *  the actual reception time is computed and this difference is used to adjust the hardware
    386           *  timer count and backoff count.
    387           *
    388           *  The realignment is based on the SFD signal for the incoming frame.  The timer is aligned
    389           *  by adjusting it with the difference between the expected SFD time and the actual SFD time.
    390           *
    391           * @param       none
    392           *
    393           * @return      none
    394           **************************************************************************************************
    395           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    396          int32 macBackoffTimerRealign(macRx_t *pMsg)
   \                     macBackoffTimerRealign:
    397          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 4
   \   000005   74FC         MOV     A,#-0x4
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
   \   00000A   EA           MOV     A,R2
   \   00000B   FE           MOV     R6,A
   \   00000C   EB           MOV     A,R3
   \   00000D   FF           MOV     R7,A
    398            uint16 timerDelayTicks;
    399            int32 backoffDelta;
    400            int32 backoffCount;
    401          
    402            MAC_ASSERT(!MAC_TX_IS_PHYSICALLY_ACTIVE()); /* realignment during actual transmit corrupts timing */
   \   00000E   90....       MOV     DPTR,#macTxActive
   \   000011   E0           MOVX    A,@DPTR
   \   000012   A2E7         MOV     C,0xE0 /* A   */.7
   \   000014   5003         JNC     ??macBackoffTimerRealign_0
   \   000016                ; Setup parameters for call to function halAssertHandler
   \   000016   12....       LCALL   ??halAssertHandler?relay
    403          
    404            /*-------------------------------------------------------------------------------
    405             *  Calculate the delta backoff difference between expected backoff count,
    406             *  which is zero, and the backoff count of the received frame.
    407             */
    408          
    409            /* since expected receive time is zero, the delta is simply the receive time */
    410            backoffDelta = pMsg->mac.timestamp;
   \                     ??macBackoffTimerRealign_0:
   \   000019   EE           MOV     A,R6
   \   00001A   2424         ADD     A,#0x24
   \   00001C   F582         MOV     DPL,A
   \   00001E   EF           MOV     A,R7
   \   00001F   3400         ADDC    A,#0x0
   \   000021   F583         MOV     DPH,A
   \   000023   78..         MOV     R0,#?V0 + 4
   \   000025   12....       LCALL   ?L_MOV_X
    411          
    412            /* if the frame was received more than halfway to the rollover count, use a negative delta value */
    413            if (((uint32) backoffDelta) > (backoffTimerRollover / 2))
   \   000028   90....       MOV     DPTR,#backoffTimerRollover
   \   00002B   78..         MOV     R0,#?V0 + 0
   \   00002D   12....       LCALL   ?L_MOV_X
   \   000030   7401         MOV     A,#0x1
   \   000032   78..         MOV     R0,#?V0 + 0
   \   000034   12....       LCALL   ?UL_SHR
   \   000037   78..         MOV     R0,#?V0 + 4
   \   000039   79..         MOV     R1,#?V0 + 0
   \   00003B   12....       LCALL   ?UL_GT
   \   00003E   5008         JNC     ??macBackoffTimerRealign_1
    414            {
    415              backoffDelta = backoffDelta - backoffTimerRollover;    /* result will be negative */
   \   000040   90....       MOV     DPTR,#backoffTimerRollover
   \   000043   78..         MOV     R0,#?V0 + 4
   \   000045   12....       LCALL   ?L_SUB_X
    416            }
    417          
    418            /*-------------------------------------------------------------------------------
    419             *  Calculate the number of timer ticks to delay that will align the internal
    420             *  time base with the received frame.
    421             */
    422          
    423            /* retrieve the timer count when frame was received */
    424            timerDelayTicks = pMsg->mac.timestamp2;
   \                     ??macBackoffTimerRealign_1:
   \   000048   EE           MOV     A,R6
   \   000049   2428         ADD     A,#0x28
   \   00004B   F582         MOV     DPL,A
   \   00004D   EF           MOV     A,R7
   \   00004E   3400         ADDC    A,#0x0
   \   000050   F583         MOV     DPH,A
   \   000052   E0           MOVX    A,@DPTR
   \   000053   FE           MOV     R6,A
   \   000054   A3           INC     DPTR
   \   000055   E0           MOVX    A,@DPTR
   \   000056   FF           MOV     R7,A
    425          
    426            /*
    427             *  Subtract the expected SFD time from the actual SFD time to find the needed
    428             *  timer adjustment. If subtracting the offset would result in a negative value,
    429             *  the tick delay must wrap around.
    430             */
    431            if (timerDelayTicks >= TIMER_TICKS_EXPECTED_AT_SFD)
   \   000057   C3           CLR     C
   \   000058   EE           MOV     A,R6
   \   000059   9466         SUBB    A,#0x66
   \   00005B   EF           MOV     A,R7
   \   00005C   9404         SUBB    A,#0x4
   \   00005E   EE           MOV     A,R6
   \   00005F   4009         JC      ??macBackoffTimerRealign_2
    432            {
    433              /* since delay count is greater than or equal to offset, subtract it directly */
    434              timerDelayTicks = timerDelayTicks - TIMER_TICKS_EXPECTED_AT_SFD;
   \   000061   249A         ADD     A,#-0x66
   \   000063   FE           MOV     R6,A
   \   000064   EF           MOV     A,R7
   \   000065   34FB         ADDC    A,#-0x5
   \   000067   FF           MOV     R7,A
   \   000068   800F         SJMP    ??macBackoffTimerRealign_3
    435            }
    436            else
    437            {
    438              /*
    439               *  The expected time is greater that actualy time so it cannot be subtracted directly.
    440               *  The tick count per backoff is added to wrap around within the backoff.
    441               *  Since a wrap around did happen, the backoff delta is adjusted by one.
    442               */
    443              timerDelayTicks = timerDelayTicks - TIMER_TICKS_EXPECTED_AT_SFD + MAC_RADIO_TIMER_TICKS_PER_BACKOFF();
   \                     ??macBackoffTimerRealign_2:
   \   00006A   249A         ADD     A,#-0x66
   \   00006C   FE           MOV     R6,A
   \   00006D   EF           MOV     A,R7
   \   00006E   3423         ADDC    A,#0x23
   \   000070   FF           MOV     R7,A
    444              backoffDelta--;
   \   000071   90....       MOV     DPTR,#__Constant_ffffffff
   \   000074   78..         MOV     R0,#?V0 + 4
   \   000076   12....       LCALL   ?L_ADD_X
    445            }
    446          
    447            /*-------------------------------------------------------------------------------
    448             *  Calculate the new backoff count.
    449             */
    450          
    451            backoffCount = MAC_RADIO_BACKOFF_COUNT() - backoffDelta;
   \                     ??macBackoffTimerRealign_3:
   \   000079                ; Setup parameters for call to function macMcuOverflowCount
   \   000079   12....       LCALL   ?Subroutine1 & 0xFFFF
   \                     ??CrossCallReturnLabel_3:
   \   00007C   78..         MOV     R0,#?V0 + 0
   \   00007E   79..         MOV     R1,#?V0 + 4
   \   000080   12....       LCALL   ?L_SUB
   \   000083   85..82       MOV     DPL,?XSP + 0
   \   000086   85..83       MOV     DPH,?XSP + 1
   \   000089   78..         MOV     R0,#?V0 + 0
   \   00008B   12....       LCALL   ?L_MOV_TO_X
    452          
    453            if (backoffCount >= ((int32) backoffTimerRollover))
   \   00008E   85..82       MOV     DPL,?XSP + 0
   \   000091   85..83       MOV     DPH,?XSP + 1
   \   000094   C082         PUSH    DPL
   \   000096   C083         PUSH    DPH
   \   000098   90....       MOV     DPTR,#backoffTimerRollover
   \   00009B   78..         MOV     R0,#?V0 + 0
   \   00009D   12....       LCALL   ?L_MOV_X
   \   0000A0   D083         POP     DPH
   \   0000A2   D082         POP     DPL
   \   0000A4   78..         MOV     R0,#?V0 + 0
   \   0000A6   12....       LCALL   ?SL_GT_X
   \   0000A9   4015         JC      ??macBackoffTimerRealign_4
    454            {
    455              backoffCount -= backoffTimerRollover;
   \   0000AB   90....       MOV     DPTR,#backoffTimerRollover
   \   0000AE   78..         MOV     R0,#?V0 + 0
   \   0000B0   12....       LCALL   ?L_MOV_X
   \   0000B3   85..82       MOV     DPL,?XSP + 0
   \   0000B6   85..83       MOV     DPH,?XSP + 1
   \   0000B9   78..         MOV     R0,#?V0 + 0
   \   0000BB   12....       LCALL   ?L_SUB_FROM_X
   \   0000BE   8030         SJMP    ??macBackoffTimerRealign_5
    456            }
    457            else if (backoffCount < 0)
   \                     ??macBackoffTimerRealign_4:
   \   0000C0   85..82       MOV     DPL,?XSP + 0
   \   0000C3   85..83       MOV     DPH,?XSP + 1
   \   0000C6   C082         PUSH    DPL
   \   0000C8   C083         PUSH    DPH
   \   0000CA   90....       MOV     DPTR,#__Constant_0
   \   0000CD   78..         MOV     R0,#?V0 + 0
   \   0000CF   12....       LCALL   ?L_MOV_X
   \   0000D2   D083         POP     DPH
   \   0000D4   D082         POP     DPL
   \   0000D6   78..         MOV     R0,#?V0 + 0
   \   0000D8   12....       LCALL   ?SL_GT_X
   \   0000DB   5013         JNC     ??macBackoffTimerRealign_5
    458            {
    459              backoffCount += backoffTimerRollover;
   \   0000DD   90....       MOV     DPTR,#backoffTimerRollover
   \   0000E0   78..         MOV     R0,#?V0 + 0
   \   0000E2   12....       LCALL   ?L_MOV_X
   \   0000E5   85..82       MOV     DPL,?XSP + 0
   \   0000E8   85..83       MOV     DPH,?XSP + 1
   \   0000EB   78..         MOV     R0,#?V0 + 0
   \   0000ED   12....       LCALL   ?L_ADD_TO_X
    460            }
    461          
    462            MAC_RADIO_TIMER_FORCE_DELAY(timerDelayTicks);
   \                     ??macBackoffTimerRealign_5:
   \   0000F0   EE           MOV     A,R6
   \   0000F1   F5A6         MOV     0xa6,A
   \   0000F3   EF           MOV     A,R7
   \   0000F4   F5A7         MOV     0xa7,A
    463            MAC_RADIO_BACKOFF_SET_COUNT(backoffCount);
   \   0000F6                ; Setup parameters for call to function macMcuOverflowSetCount
   \   0000F6   85..82       MOV     DPL,?XSP + 0
   \   0000F9   85..83       MOV     DPH,?XSP + 1
   \   0000FC   78..         MOV     R0,#?V0 + 0
   \   0000FE   12....       LCALL   ?L_MOV_X
   \   000101   AA..         MOV     R2,?V0 + 0
   \   000103   AB..         MOV     R3,?V0 + 1
   \   000105   AC..         MOV     R4,?V0 + 2
   \   000107   AD..         MOV     R5,?V0 + 3
   \   000109   12....       LCALL   ??macMcuOverflowSetCount?relay
    464          
    465            return(backoffDelta);
   \   00010C   AA..         MOV     R2,?V0 + 4
   \   00010E   AB..         MOV     R3,?V0 + 5
   \   000110   AC..         MOV     R4,?V0 + 6
   \   000112   AD..         MOV     R5,?V0 + 7
   \   000114   7404         MOV     A,#0x4
   \   000116   12....       LCALL   ?DEALLOC_XSTACK8
   \   000119   02....       LJMP    ?Subroutine8 & 0xFFFF
   \   00011C                REQUIRE T2TLD
   \   00011C                REQUIRE T2THD
    466          }
    467          
    468          
    469          /**************************************************************************************************
    470           * @fn          macBackoffTimerCompareIsr
    471           *
    472           * @brief       Interrupt service routine that fires when the backoff count is equal
    473           *              to the trigger count.
    474           *
    475           * @param       none
    476           *
    477           * @return      none
    478           **************************************************************************************************
    479           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    480          void macBackoffTimerCompareIsr(void)
   \                     macBackoffTimerCompareIsr:
    481          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
    482            uint8 oldState;
    483            halIntState_t  s;
    484          
    485            HAL_ENTER_CRITICAL_SECTION(s);
   \   000005   A2AF         MOV     C,0xa8.7
   \   000007   E4           CLR     A
   \   000008   92E0         MOV     0xE0 /* A   */.0,C
   \   00000A   FE           MOV     R6,A
   \   00000B   C2AF         CLR     0xa8.7
    486            oldState = compareState;
   \   00000D   90....       MOV     DPTR,#compareState
   \   000010   E0           MOVX    A,@DPTR
   \   000011   FF           MOV     R7,A
    487          
    488            /* if compare is a rollover, set count to zero */
    489            if (oldState & COMPARE_STATE_ROLLOVER_BV)
   \   000012   A2E0         MOV     C,0xE0 /* A   */.0
   \   000014   5016         JNC     ??macBackoffTimerCompareIsr_0
    490            {
    491              MAC_RADIO_BACKOFF_SET_COUNT(0);
   \   000016                ; Setup parameters for call to function macMcuOverflowSetCount
   \   000016   90....       MOV     DPTR,#__Constant_0
   \   000019   78..         MOV     R0,#?V0 + 0
   \   00001B   12....       LCALL   ?L_MOV_X
   \   00001E   AA..         MOV     R2,?V0 + 0
   \   000020   AB..         MOV     R3,?V0 + 1
   \   000022   AC..         MOV     R4,?V0 + 2
   \   000024   AD..         MOV     R5,?V0 + 3
   \   000026   12....       LCALL   ??macMcuOverflowSetCount?relay
    492              macBackoffTimerRolloverCallback();
   \   000029                ; Setup parameters for call to function macBackoffTimerRolloverCallback
   \   000029   12....       LCALL   ??macBackoffTimerRolloverCallback?relay
    493            }
    494          
    495            /* if compare is a trigger, reset for rollover and run the trigger callback */
    496            if (oldState & COMPARE_STATE_TRIGGER_BV)
   \                     ??macBackoffTimerCompareIsr_0:
   \   00002C   EF           MOV     A,R7
   \   00002D   A2E1         MOV     C,0xE0 /* A   */.1
   \   00002F   500E         JNC     ??macBackoffTimerCompareIsr_1
    497            {
    498              compareState = COMPARE_STATE_ROLLOVER;
   \   000031   12....       LCALL   ?Subroutine3 & 0xFFFF
    499              MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerRollover);
   \                     ??CrossCallReturnLabel_5:
   \   000034   12....       LCALL   ?L_MOV_X
   \   000037   12....       LCALL   ?Subroutine4 & 0xFFFF
    500              HAL_EXIT_CRITICAL_SECTION(s);
    501              macBackoffTimerTriggerCallback();
   \                     ??CrossCallReturnLabel_8:
   \   00003A                ; Setup parameters for call to function macBackoffTimerTriggerCallback
   \   00003A   12....       LCALL   ??macBackoffTimerTriggerCallback?relay
   \   00003D   8023         SJMP    ??macBackoffTimerCompareIsr_2
    502            }
    503            else if (oldState == COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER)
   \                     ??macBackoffTimerCompareIsr_1:
   \   00003F   7405         MOV     A,#0x5
   \   000041   6F           XRL     A,R7
   \   000042   7019         JNZ     ??macBackoffTimerCompareIsr_3
    504            {
    505              compareState = COMPARE_STATE_TRIGGER;
   \   000044   7402         MOV     A,#0x2
   \   000046   90....       MOV     DPTR,#compareState
   \   000049   F0           MOVX    @DPTR,A
    506              MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerTrigger);
   \   00004A                ; Setup parameters for call to function macMcuOverflowSetCompare
   \   00004A   90....       MOV     DPTR,#backoffTimerTrigger
   \   00004D   78..         MOV     R0,#?V0 + 0
   \   00004F   12....       LCALL   ?L_MOV_X
   \   000052   AA..         MOV     R2,?V0 + 0
   \   000054   AB..         MOV     R3,?V0 + 1
   \   000056   AC..         MOV     R4,?V0 + 2
   \   000058   AD..         MOV     R5,?V0 + 3
   \   00005A   12....       LCALL   ??macMcuOverflowSetCompare?relay
    507              HAL_EXIT_CRITICAL_SECTION(s);
    508            }
    509            else
    510            {
    511              HAL_EXIT_CRITICAL_SECTION(s);
   \                     ??macBackoffTimerCompareIsr_3:
   \   00005D   EE           MOV     A,R6
   \   00005E   A2E0         MOV     C,0xE0 /* A   */.0
   \   000060   92AF         MOV     0xa8.7,C
    512            }
    513          }
   \                     ??macBackoffTimerCompareIsr_2:
   \   000062   02....       LJMP    ?Subroutine6 & 0xFFFF
   \   000065                REQUIRE _A_IEN0

   \                                 In  segment XDATA_I, align 1, keep-with-next
   \                     __Constant_0:
   \   000000                DS 4
   \   000004                REQUIRE `?<Initializer for __Constant_0>`
   \   000004                REQUIRE __INIT_XDATA_I

   \                                 In  segment XDATA_ID, align 1, keep-with-next
   \                     `?<Initializer for __Constant_0>`:
   \   000000   00000000     DD 0

   \                                 In  segment XDATA_I, align 1, keep-with-next
   \                     __Constant_c0000:
   \   000000                DS 4
   \   000004                REQUIRE `?<Initializer for __Constant_c0000>`
   \   000004                REQUIRE __INIT_XDATA_I

   \                                 In  segment XDATA_ID, align 1, keep-with-next
   \                     `?<Initializer for __Constant_c0000>`:
   \   000000   00000C00     DD 786432

   \                                 In  segment XDATA_I, align 1, keep-with-next
   \                     __Constant_80000000:
   \   000000                DS 4
   \   000004                REQUIRE `?<Initializer for __Constant_80000000>`
   \   000004                REQUIRE __INIT_XDATA_I

   \                                 In  segment XDATA_ID, align 1, keep-with-next
   \                     `?<Initializer for __Constant_80000000>`:
   \   000000   00000080     DD 2147483648

   \                                 In  segment XDATA_I, align 1, keep-with-next
   \                     __Constant_ffffffff:
   \   000000                DS 4
   \   000004                REQUIRE `?<Initializer for __Constant_ffffffff>`
   \   000004                REQUIRE __INIT_XDATA_I

   \                                 In  segment XDATA_ID, align 1, keep-with-next
   \                     `?<Initializer for __Constant_ffffffff>`:
   \   000000   FFFFFFFF     DD -1

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerInit?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerInit

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerReset?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerReset

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerSetRollover?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerSetRollover

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerSetCount?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerSetCount

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerCount?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerCount

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerCapture?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerCapture

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerGetTrigger?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerGetTrigger

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerSetTrigger?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerSetTrigger

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerCancelTrigger?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerCancelTrigger

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerRealign?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerRealign

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macBackoffTimerCompareIsr?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macBackoffTimerCompareIsr
    514          
    515          
    516          /**************************************************************************************************
    517          */

   Maximum stack usage in bytes:

     Function                       ISTACK PSTACK XSTACK
     --------                       ------ ------ ------
     macBackoffTimerCancelTrigger       0      0     12
       -> macMcuOverflowSetCompare      0      0     24
     macBackoffTimerCapture             0      0     16
       -> macMcuOverflowCapture         0      0     32
     macBackoffTimerCompareIsr          0      0     12
       -> macMcuOverflowSetCount        0      0     24
       -> macBackoffTimerRolloverCallback
                                        0      0     24
       -> macMcuOverflowSetCompare      0      0     24
       -> macBackoffTimerTriggerCallback
                                        0      0     24
       -> macMcuOverflowSetCompare      0      0     24
     macBackoffTimerCount               0      0     16
       -> macMcuOverflowCount           0      0     32
     macBackoffTimerGetTrigger          0      0     12
     macBackoffTimerInit                0      0     12
       -> macMcuOverflowSetCount        0      0     24
       -> macBackoffTimerSetRollover
                                        0      0     24
       -> macMcuOrT2PEROF2              0      0     24
     macBackoffTimerRealign             2      0     20
       -> halAssertHandler              0      0     40
       -> macMcuOverflowCount           0      0     40
       -> macMcuOverflowSetCount        0      0     40
     macBackoffTimerReset               2      0      0
       -> macMcuAndT2PEROF2             4      0      0
       -> macBackoffTimerInit           4      0      0
     macBackoffTimerSetCount            0      0     16
       -> halAssertHandler              0      0     32
       -> halAssertHandler              0      0     32
       -> halAssertHandler              0      0     32
       -> macMcuOverflowSetCount        0      0     32
     macBackoffTimerSetRollover         0      0     28
       -> macMcuOverflowCount           0      0     32
       -> halAssertHandler              0      0     32
       -> macMcuOverflowSetCompare      0      0     32
     macBackoffTimerSetTrigger          0      0     16
       -> halAssertHandler              0      0     32
       -> macMcuOverflowCount           0      0     32
       -> macMcuOverflowSetCompare      0      0     32
       -> macMcuOverflowSetCompare      0      0     32


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     T2TLD                             1
     T2THD                             1
     _A_IEN0                           1
     T2CNF                             1
     backoffTimerRollover              4
     backoffTimerTrigger               4
     compareState                      1
     macBackoffTimerInit              60
     ?Subroutine6                      5
     macBackoffTimerReset             19
     macBackoffTimerSetRollover       40
     ?Subroutine7                      6
     ?Subroutine2                      6
     ?Subroutine0                     16
     ?Subroutine5                     17
     macBackoffTimerSetCount         103
     ?Subroutine8                      5
     macBackoffTimerCount             48
     ?Subroutine1                     12
     macBackoffTimerCapture           54
     macBackoffTimerGetTrigger        24
     macBackoffTimerSetTrigger        90
     ?Subroutine3                     12
     macBackoffTimerCancelTrigger     22
     ?Subroutine4                      4
     macBackoffTimerRealign          284
     macBackoffTimerCompareIsr       101
     __Constant_0                      4
     ?<Initializer for __Constant_0>
                                       4
     __Constant_c0000                  4
     ?<Initializer for __Constant_c0000>
                                       4
     __Constant_80000000               4
     ?<Initializer for __Constant_80000000>
                                       4
     __Constant_ffffffff               4
     ?<Initializer for __Constant_ffffffff>
                                       4
     ??macBackoffTimerInit?relay       6
     ??macBackoffTimerReset?relay      6
     ??macBackoffTimerSetRollover?relay
                                       6
     ??macBackoffTimerSetCount?relay
                                       6
     ??macBackoffTimerCount?relay      6
     ??macBackoffTimerCapture?relay    6
     ??macBackoffTimerGetTrigger?relay
                                       6
     ??macBackoffTimerSetTrigger?relay
                                       6
     ??macBackoffTimerCancelTrigger?relay
                                       6
     ??macBackoffTimerRealign?relay    6
     ??macBackoffTimerCompareIsr?relay
                                       6

 
 928 bytes in segment BANKED_CODE
  66 bytes in segment BANK_RELAYS
   4 bytes in segment SFR_AN
  16 bytes in segment XDATA_I
  16 bytes in segment XDATA_ID
   9 bytes in segment XDATA_Z
 
 994 bytes of CODE  memory (+ 16 bytes shared)
   0 bytes of DATA  memory (+  4 bytes shared)
   9 bytes of XDATA memory (+ 16 bytes shared)

Errors: none
Warnings: none
