///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   08/Aug/2010  22:00:54 /
// 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\Compon /
//                          ents\mac\low_level\srf03\mac_tx.c                 /
//    Command line       =  -f "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\CC2430DB\f8wCoord.c /
//                          fg" (-DCPU32MHZ -DFORCE_MAC_NEAR                  /
//                          -DROOT=__near_func -DMAC_CFG_APP_PENDING_QUEUE=TR /
//                          UE -DZDO_COORDINATOR -DRTR_NWK -DBLINK_LEDS       /
//                          "-DCONST=const __code" -DGENERIC=__generic) -f    /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\..\..\Too /
//                          ls\CC2430DB\f8wConfig.cfg" (-DSECURE=1            /
//                          -DDEFAULT_CHANLIST=0x04000000                     /
//                          -DZDAPP_CONFIG_PAN_ID=0x00FF                      /
//                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_M /
//                          ASK=0x007F -DBEACON_REQUEST_DELAY=100             /
//                          -DBEACON_REQ_DELAY_MASK=0x00FF                    /
//                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_P /
//                          OLLED=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\Compo /
//                          nents\mac\low_level\srf03\mac_tx.c" -D CC2430EB   /
//                          -D ZTOOL_P1 -D LOCATION_DONGLE -D MT_TASK -D      /
//                          xNV_RESTORE -D INT_HEAP_LEN=4608 -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\LocDongle\List\" -lA   /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\LocDongle\Li /
//                          st\" --diag_suppress Pe001,Pa010 --diag_remark    /
//                          pe550 -o "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\LocDongle\Obj\" -e                 /
//                          --require_prototypes -z9 --no_code_motion         /
//                          --debug --core=plain --dptr=16,1                  /
//                          --data_model=large --code_model=banked            /
//                          --calling_convention=xdata_reentrant              /
//                          --place_constants=data --nr_virtual_regs 8 -I     /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\" -I         /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\SOURCE\"  /
//                          -I "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\ZMAIN\TI2430DB\" -I       /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\..\..\..\ /
//                          WXL\INCLUDE\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MT\" -I  /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\..\..\..\ /
//                          ..\COMPONENTS\HAL\INCLUDE\" -I "C:\Texas          /
//                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack /
//                          \Project\Location\CC2430DB\..\..\..\..\..\COMPONE /
//                          NTS\HAL\TARGET\CC2430EB\" -I "C:\Texas            /
//                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack /
//                          \Project\Location\CC2430DB\..\..\..\..\..\COMPONE /
//                          NTS\OSAL\MCU\CCSOC\" -I "C:\Texas Instruments     /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\INC /
//                          LUDE\" -I "C:\Texas Instruments                   /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\AF /
//                          \" -I "C:\Texas Instruments                       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\NW /
//                          K\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SE /
//                          C\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SY /
//                          S\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\ZD /
//                          O\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\F8W /
//                          \" -I "C:\Texas Instruments                       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\"   /
//                          -I "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\SERVICES /
//                          \SADDR\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\SERVICES /
//                          \SDATA\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\INCL /
//                          UDE\" -I "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\HIGH /
//                          _LEVEL\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_ /
//                          LEVEL\SRF03\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_ /
//                          LEVEL\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\Projec /
//                          ts\zstack\Project\Location\CC2430DB\LocDongle\Lis /
//                          t\mac_tx.s51                                      /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME mac_tx

        RTMODEL "__calling_convention", "xdata_reentrant"
        RTMODEL "__code_model", "banked"
        RTMODEL "__core", "plain"
        RTMODEL "__data_model", "large"
        RTMODEL "__dptr_size", "16"
        RTMODEL "__extended_stack", "disabled"
        RTMODEL "__location_for_constants", "data"
        RTMODEL "__number_of_dptrs", "1"
        RTMODEL "__rt_version", "1"

        RSEG DOVERLAY:DATA:NOROOT(0)
        RSEG IOVERLAY:IDATA:NOROOT(0)
        RSEG ISTACK:IDATA:NOROOT(0)
        RSEG PSTACK:XDATA:NOROOT(0)
        RSEG XSTACK:XDATA:NOROOT(0)

        EXTERN ??macTxFrame?relay
        EXTERN ??txComplete?relay
        EXTERN ??txCsmaGo?relay
        EXTERN ??txCsmaPrep?relay
        EXTERN ??txGo?relay
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN ?L_MOV_TO_X
        EXTERN ?S_SHL
        EXTERN ?V0
        EXTERN __INIT_XDATA_I
        EXTERN __INIT_XDATA_Z

        PUBLIC ??macTxAckNotReceivedCallback?relay
        FUNCTION ??macTxAckNotReceivedCallback?relay,0203H
        PUBLIC ??macTxAckReceivedCallback?relay
        FUNCTION ??macTxAckReceivedCallback?relay,0203H
        PUBLIC ??macTxChannelBusyCallback?relay
        FUNCTION ??macTxChannelBusyCallback?relay,0203H
        PUBLIC ??macTxCollisionWithRxCallback?relay
        FUNCTION ??macTxCollisionWithRxCallback?relay,0203H
        PUBLIC ??macTxDoneCallback?relay
        FUNCTION ??macTxDoneCallback?relay,0203H
        PUBLIC ??macTxFrame?relay
        FUNCTION ??macTxFrame?relay,0203H
        PUBLIC ??macTxFrameRetransmit?relay
        FUNCTION ??macTxFrameRetransmit?relay,0203H
        PUBLIC ??macTxHaltCleanup?relay
        FUNCTION ??macTxHaltCleanup?relay,0203H
        PUBLIC ??macTxInit?relay
        FUNCTION ??macTxInit?relay,0203H
        PUBLIC ??macTxStartQueuedFrame?relay
        FUNCTION ??macTxStartQueuedFrame?relay,0203H
        PUBLIC ??macTxTimestampCallback?relay
        FUNCTION ??macTxTimestampCallback?relay,0203H
        FUNCTION ??txComplete?relay,0203H
        FUNCTION ??txCsmaGo?relay,0203H
        FUNCTION ??txCsmaPrep?relay,0203H
        FUNCTION ??txGo?relay,0203H
        PUBWEAK RFIM
        PUBWEAK RFST
        PUBWEAK _A_IEN0
        PUBLIC macTxAckNotReceivedCallback
        FUNCTION macTxAckNotReceivedCallback,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macTxAckReceivedCallback
        FUNCTION macTxAckReceivedCallback,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macTxActive
        PUBLIC macTxBe
        PUBLIC macTxChannelBusyCallback
        FUNCTION macTxChannelBusyCallback,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 3, STACK
        PUBLIC macTxCollisionWithRxCallback
        FUNCTION macTxCollisionWithRxCallback,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macTxCsmaBackoffDelay
        PUBLIC macTxDoneCallback
        FUNCTION macTxDoneCallback,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macTxFrame
        FUNCTION macTxFrame,021203H
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macTxFrameRetransmit
        FUNCTION macTxFrameRetransmit,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macTxHaltCleanup
        FUNCTION macTxHaltCleanup,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macTxInit
        FUNCTION macTxInit,0203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macTxSlottedDelay
        PUBLIC macTxStartQueuedFrame
        FUNCTION macTxStartQueuedFrame,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macTxTimestampCallback
        FUNCTION macTxTimestampCallback,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC macTxType
        FUNCTION txComplete,021203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 9, STACK
        FUNCTION txCsmaGo,021203H
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        FUNCTION txCsmaPrep,021203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 10, STACK
        FUNCTION txGo,021203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        
        CFI Names cfiNames0
        CFI StackFrame CFA_SP SP DATA
        CFI StackFrame CFA_PSP16 PSP16 XDATA
        CFI StackFrame CFA_XSP16 XSP16 XDATA
        CFI StaticOverlayFrame CFA_IOVERLAY IOVERLAY
        CFI StaticOverlayFrame CFA_DOVERLAY DOVERLAY
        CFI Resource `PSW.CY`:1, `B.BR0`:1, `B.BR1`:1, `B.BR2`:1, `B.BR3`:1
        CFI Resource `B.BR4`:1, `B.BR5`:1, `B.BR6`:1, `B.BR7`:1, `VB.BR8`:1
        CFI Resource `VB.BR9`:1, `VB.BR10`:1, `VB.BR11`:1, `VB.BR12`:1
        CFI Resource `VB.BR13`:1, `VB.BR14`:1, `VB.BR15`:1, VB:8, B:8, A:8
        CFI Resource PSW:8, DPL0:8, DPH0:8, R0:8, R1:8, R2:8, R3:8, R4:8, R5:8
        CFI Resource R6:8, R7:8, V0:8, V1:8, V2:8, V3:8, V4:8, V5:8, V6:8, V7:8
        CFI Resource SP:8, PSPH:8, PSPL:8, PSP16:16, XSPH:8, XSPL:8, XSP16:16
        CFI VirtualResource ?RET:24
        CFI Resource ?BRET_EXT:8
        CFI VirtualResource ?RET_HIGH:8, ?RET_LOW:8
        CFI ResourceParts PSP16 PSPH, PSPL
        CFI ResourceParts XSP16 XSPH, XSPL
        CFI ResourceParts ?RET ?BRET_EXT, ?RET_HIGH, ?RET_LOW
        CFI EndNames cfiNames0
        
        CFI Common cfiCommon0 Using cfiNames0
        CFI CodeAlign 1
        CFI DataAlign -1
        CFI ReturnAddress ?RET CODE
        CFI CFA_DOVERLAY Used
        CFI CFA_IOVERLAY Used
        CFI CFA_SP SP+-3
        CFI CFA_PSP16 PSP16+0
        CFI CFA_XSP16 XSP16+0
        CFI `PSW.CY` SameValue
        CFI `B.BR0` SameValue
        CFI `B.BR1` SameValue
        CFI `B.BR2` SameValue
        CFI `B.BR3` SameValue
        CFI `B.BR4` SameValue
        CFI `B.BR5` SameValue
        CFI `B.BR6` SameValue
        CFI `B.BR7` SameValue
        CFI `VB.BR8` SameValue
        CFI `VB.BR9` SameValue
        CFI `VB.BR10` SameValue
        CFI `VB.BR11` SameValue
        CFI `VB.BR12` SameValue
        CFI `VB.BR13` SameValue
        CFI `VB.BR14` SameValue
        CFI `VB.BR15` SameValue
        CFI VB SameValue
        CFI B Undefined
        CFI A Undefined
        CFI PSW SameValue
        CFI DPL0 SameValue
        CFI DPH0 SameValue
        CFI R0 Undefined
        CFI R1 Undefined
        CFI R2 Undefined
        CFI R3 Undefined
        CFI R4 Undefined
        CFI R5 Undefined
        CFI R6 SameValue
        CFI R7 SameValue
        CFI V0 SameValue
        CFI V1 SameValue
        CFI V2 SameValue
        CFI V3 SameValue
        CFI V4 SameValue
        CFI V5 SameValue
        CFI V6 SameValue
        CFI V7 SameValue
        CFI PSPH Undefined
        CFI PSPL Undefined
        CFI XSPH Undefined
        CFI XSPL Undefined
        CFI ?RET Concat
        CFI ?BRET_EXT Frame(CFA_SP, 3)
        CFI ?RET_HIGH Frame(CFA_SP, 2)
        CFI ?RET_LOW Frame(CFA_SP, 1)
        CFI EndCommon cfiCommon0
        
        
        CFI Common cfiCommon1 Using cfiNames0
        CFI CodeAlign 1
        CFI DataAlign -1
        CFI ReturnAddress ?RET CODE
        CFI CFA_DOVERLAY Used
        CFI CFA_IOVERLAY Used
        CFI CFA_SP SP+-2
        CFI CFA_PSP16 PSP16+0
        CFI CFA_XSP16 XSP16+0
        CFI `PSW.CY` SameValue
        CFI `B.BR0` SameValue
        CFI `B.BR1` SameValue
        CFI `B.BR2` SameValue
        CFI `B.BR3` SameValue
        CFI `B.BR4` SameValue
        CFI `B.BR5` SameValue
        CFI `B.BR6` SameValue
        CFI `B.BR7` SameValue
        CFI `VB.BR8` SameValue
        CFI `VB.BR9` SameValue
        CFI `VB.BR10` SameValue
        CFI `VB.BR11` SameValue
        CFI `VB.BR12` SameValue
        CFI `VB.BR13` SameValue
        CFI `VB.BR14` SameValue
        CFI `VB.BR15` SameValue
        CFI VB SameValue
        CFI B SameValue
        CFI A SameValue
        CFI PSW SameValue
        CFI DPL0 SameValue
        CFI DPH0 SameValue
        CFI R0 SameValue
        CFI R1 SameValue
        CFI R2 SameValue
        CFI R3 SameValue
        CFI R4 SameValue
        CFI R5 SameValue
        CFI R6 SameValue
        CFI R7 SameValue
        CFI V0 SameValue
        CFI V1 SameValue
        CFI V2 SameValue
        CFI V3 SameValue
        CFI V4 SameValue
        CFI V5 SameValue
        CFI V6 SameValue
        CFI V7 SameValue
        CFI PSPH Undefined
        CFI PSPL Undefined
        CFI XSPH Undefined
        CFI XSPL Undefined
        CFI ?RET Concat
        CFI ?BRET_EXT SameValue
        CFI ?RET_HIGH Frame(CFA_SP, 2)
        CFI ?RET_LOW Frame(CFA_SP, 1)
        CFI EndCommon cfiCommon1
        
macCspTxReset       SYMBOL "macCspTxReset"
halAssertHandler    SYMBOL "halAssertHandler"
macCspTxPrepSlotted SYMBOL "macCspTxPrepSlotted"
macMemWriteTxFifo   SYMBOL "macMemWriteTxFifo"
macRadioRandomByte  SYMBOL "macRadioRandomByte"
macCspTxPrepCsmaSlotted SYMBOL "macCspTxPrepCsmaSlotted"
macCspTxPrepCsmaUnslotted SYMBOL "macCspTxPrepCsmaUnslotted"
macCspTxGoSlotted   SYMBOL "macCspTxGoSlotted"
macDataTxTimeAvailable SYMBOL "macDataTxTimeAvailable"
macCspTxGoCsma      SYMBOL "macCspTxGoCsma"
macRxOffRequest     SYMBOL "macRxOffRequest"
macCspTxRequestAckTimeoutCallback SYMBOL "macCspTxRequestAckTimeoutCallback"
macCspTxCancelAckTimeoutCallback SYMBOL "macCspTxCancelAckTimeoutCallback"
macRadioUpdateTxPower SYMBOL "macRadioUpdateTxPower"
macRadioUpdateChannel SYMBOL "macRadioUpdateChannel"
macTxCompleteCallback SYMBOL "macTxCompleteCallback"
macBackoffTimerCapture SYMBOL "macBackoffTimerCapture"
macMcuTimerCapture  SYMBOL "macMcuTimerCapture"
macRxHaltCleanup    SYMBOL "macRxHaltCleanup"
??halAssertHandler?relay SYMBOL "?relay", halAssertHandler
??macBackoffTimerCapture?relay SYMBOL "?relay", macBackoffTimerCapture
??macCspTxCancelAckTimeoutCallback?relay SYMBOL "?relay", macCspTxCancelAckTimeoutCallback
??macCspTxGoCsma?relay SYMBOL "?relay", macCspTxGoCsma
??macCspTxGoSlotted?relay SYMBOL "?relay", macCspTxGoSlotted
??macCspTxPrepCsmaSlotted?relay SYMBOL "?relay", macCspTxPrepCsmaSlotted
??macCspTxPrepCsmaUnslotted?relay SYMBOL "?relay", macCspTxPrepCsmaUnslotted
??macCspTxPrepSlotted?relay SYMBOL "?relay", macCspTxPrepSlotted
??macCspTxRequestAckTimeoutCallback?relay SYMBOL "?relay", macCspTxRequestAckTimeoutCallback
??macCspTxReset?relay SYMBOL "?relay", macCspTxReset
??macDataTxTimeAvailable?relay SYMBOL "?relay", macDataTxTimeAvailable
??macMcuTimerCapture?relay SYMBOL "?relay", macMcuTimerCapture
??macMemWriteTxFifo?relay SYMBOL "?relay", macMemWriteTxFifo
??macRadioRandomByte?relay SYMBOL "?relay", macRadioRandomByte
??macRadioUpdateChannel?relay SYMBOL "?relay", macRadioUpdateChannel
??macRadioUpdateTxPower?relay SYMBOL "?relay", macRadioUpdateTxPower
??macRxHaltCleanup?relay SYMBOL "?relay", macRxHaltCleanup
??macRxOffRequest?relay SYMBOL "?relay", macRxOffRequest
??macTxCompleteCallback?relay SYMBOL "?relay", macTxCompleteCallback
macTxAckNotReceivedCallback SYMBOL "macTxAckNotReceivedCallback"
??macTxAckNotReceivedCallback?relay SYMBOL "?relay", macTxAckNotReceivedCallback
macTxAckReceivedCallback SYMBOL "macTxAckReceivedCallback"
??macTxAckReceivedCallback?relay SYMBOL "?relay", macTxAckReceivedCallback
macTxChannelBusyCallback SYMBOL "macTxChannelBusyCallback"
??macTxChannelBusyCallback?relay SYMBOL "?relay", macTxChannelBusyCallback
macTxCollisionWithRxCallback SYMBOL "macTxCollisionWithRxCallback"
??macTxCollisionWithRxCallback?relay SYMBOL "?relay", macTxCollisionWithRxCallback
macTxDoneCallback   SYMBOL "macTxDoneCallback"
??macTxDoneCallback?relay SYMBOL "?relay", macTxDoneCallback
macTxFrame          SYMBOL "macTxFrame"
??macTxFrame?relay  SYMBOL "?relay", macTxFrame
macTxFrameRetransmit SYMBOL "macTxFrameRetransmit"
??macTxFrameRetransmit?relay SYMBOL "?relay", macTxFrameRetransmit
macTxHaltCleanup    SYMBOL "macTxHaltCleanup"
??macTxHaltCleanup?relay SYMBOL "?relay", macTxHaltCleanup
macTxInit           SYMBOL "macTxInit"
??macTxInit?relay   SYMBOL "?relay", macTxInit
macTxStartQueuedFrame SYMBOL "macTxStartQueuedFrame"
??macTxStartQueuedFrame?relay SYMBOL "?relay", macTxStartQueuedFrame
macTxTimestampCallback SYMBOL "macTxTimestampCallback"
??macTxTimestampCallback?relay SYMBOL "?relay", macTxTimestampCallback

        EXTERN macCspTxReset
        FUNCTION macCspTxReset,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN halAssertHandler
        FUNCTION halAssertHandler,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxPrepSlotted
        FUNCTION macCspTxPrepSlotted,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMemWriteTxFifo
        FUNCTION macMemWriteTxFifo,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macRadioRandomByte
        FUNCTION macRadioRandomByte,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxPrepCsmaSlotted
        FUNCTION macCspTxPrepCsmaSlotted,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxPrepCsmaUnslotted
        FUNCTION macCspTxPrepCsmaUnslotted,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxGoSlotted
        FUNCTION macCspTxGoSlotted,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macDataTxTimeAvailable
        FUNCTION macDataTxTimeAvailable,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxGoCsma
        FUNCTION macCspTxGoCsma,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macRxOffRequest
        FUNCTION macRxOffRequest,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxRequestAckTimeoutCallback
        FUNCTION macCspTxRequestAckTimeoutCallback,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macCspTxCancelAckTimeoutCallback
        FUNCTION macCspTxCancelAckTimeoutCallback,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macRadioUpdateTxPower
        FUNCTION macRadioUpdateTxPower,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macRadioUpdateChannel
        FUNCTION macRadioUpdateChannel,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macTxCompleteCallback
        FUNCTION macTxCompleteCallback,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macBackoffTimerCapture
        FUNCTION macBackoffTimerCapture,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMcuTimerCapture
        FUNCTION macMcuTimerCapture,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macRxHaltCleanup
        FUNCTION macRxHaltCleanup,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN ??halAssertHandler?relay
        FUNCTION ??halAssertHandler?relay,00H
        EXTERN ??macBackoffTimerCapture?relay
        FUNCTION ??macBackoffTimerCapture?relay,00H
        EXTERN ??macCspTxCancelAckTimeoutCallback?relay
        FUNCTION ??macCspTxCancelAckTimeoutCallback?relay,00H
        EXTERN ??macCspTxGoCsma?relay
        FUNCTION ??macCspTxGoCsma?relay,00H
        EXTERN ??macCspTxGoSlotted?relay
        FUNCTION ??macCspTxGoSlotted?relay,00H
        EXTERN ??macCspTxPrepCsmaSlotted?relay
        FUNCTION ??macCspTxPrepCsmaSlotted?relay,00H
        EXTERN ??macCspTxPrepCsmaUnslotted?relay
        FUNCTION ??macCspTxPrepCsmaUnslotted?relay,00H
        EXTERN ??macCspTxPrepSlotted?relay
        FUNCTION ??macCspTxPrepSlotted?relay,00H
        EXTERN ??macCspTxRequestAckTimeoutCallback?relay
        FUNCTION ??macCspTxRequestAckTimeoutCallback?relay,00H
        EXTERN ??macCspTxReset?relay
        FUNCTION ??macCspTxReset?relay,00H
        EXTERN ??macDataTxTimeAvailable?relay
        FUNCTION ??macDataTxTimeAvailable?relay,00H
        EXTERN ??macMcuTimerCapture?relay
        FUNCTION ??macMcuTimerCapture?relay,00H
        EXTERN ??macMemWriteTxFifo?relay
        FUNCTION ??macMemWriteTxFifo?relay,00H
        EXTERN ??macRadioRandomByte?relay
        FUNCTION ??macRadioRandomByte?relay,00H
        EXTERN ??macRadioUpdateChannel?relay
        FUNCTION ??macRadioUpdateChannel?relay,00H
        EXTERN ??macRadioUpdateTxPower?relay
        FUNCTION ??macRadioUpdateTxPower?relay,00H
        EXTERN ??macRxHaltCleanup?relay
        FUNCTION ??macRxHaltCleanup?relay,00H
        EXTERN ??macRxOffRequest?relay
        FUNCTION ??macRxOffRequest?relay,00H
        EXTERN ??macTxCompleteCallback?relay
        FUNCTION ??macTxCompleteCallback?relay,00H
        EXTERN macPib
        EXTERN macRxActive
        EXTERN macRxOutgoingAckFlag
        EXTERN macSleepState
        EXTERN pMacDataTx

// C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf03\mac_tx.c
//    1 /**************************************************************************************************
//    2   Filename:       mac_tx.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_defs.h"
//   48 #include "hal_mcu.h"

        ASEGN SFR_AN:DATA:NOROOT,091H
// unsigned char volatile __sfr RFIM
RFIM:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0a8H
// union <unnamed> volatile __sfr _A_IEN0
_A_IEN0:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0e1H
// unsigned char volatile __sfr RFST
RFST:
        DS 1
//   49 #include "hal_mac_cfg.h"
//   50 
//   51 /* high-level */
//   52 #include "mac_spec.h"
//   53 #include "mac_pib.h"
//   54 
//   55 /* exported low-level */
//   56 #include "mac_low_level.h"
//   57 
//   58 /* low-level specific */
//   59 #include "mac_tx.h"
//   60 #include "mac_backoff_timer.h"
//   61 #include "mac_rx.h"
//   62 #include "mac_rx_onoff.h"
//   63 #include "mac_radio.h"
//   64 #include "mac_sleep.h"
//   65 
//   66 /* target specific */
//   67 #include "mac_radio_defs.h"
//   68 
//   69 /* debug */
//   70 #include "mac_assert.h"
//   71 
//   72 
//   73 /* ------------------------------------------------------------------------------------------------
//   74  *                                            Defines
//   75  * ------------------------------------------------------------------------------------------------
//   76  */
//   77 #define MFR_LEN                   MAC_FCS_FIELD_LEN
//   78 #define PREPENDED_BYTE_LEN        1
//   79 
//   80 
//   81 /* ------------------------------------------------------------------------------------------------
//   82  *                                         Global Constants
//   83  * ------------------------------------------------------------------------------------------------
//   84  */
//   85 
//   86 /*
//   87  *  This is the time, in backoffs, required to set up a slotted transmit.
//   88  *  It is exported to high level so that code can schedule enough time
//   89  *  for slotted transmits.
//   90  *
//   91  *  A default is provided if a value is not specified.  If the default
//   92  *  is not appropriate, a #define should be added within hal_mac_cfg.h.
//   93  */
//   94 #ifndef HAL_MAC_TX_SLOTTED_DELAY
//   95 #define HAL_MAC_TX_SLOTTED_DELAY    3
//   96 #endif

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
//   97 uint8 const macTxSlottedDelay = HAL_MAC_TX_SLOTTED_DELAY;
macTxSlottedDelay:
        DS 1
        REQUIRE `?<Initializer for macTxSlottedDelay>`
        REQUIRE __INIT_XDATA_I
//   98 
//   99 
//  100 /* ------------------------------------------------------------------------------------------------
//  101  *                                         Global Variables
//  102  * ------------------------------------------------------------------------------------------------
//  103  */

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  104 uint8 macTxActive;
macTxActive:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  105 uint8 macTxType;
macTxType:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  106 uint8 macTxBe;
macTxBe:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  107 uint8 macTxCsmaBackoffDelay;
macTxCsmaBackoffDelay:
        DS 1
        REQUIRE __INIT_XDATA_Z
//  108 
//  109 
//  110 /* ------------------------------------------------------------------------------------------------
//  111  *                                         Local Variables
//  112  * ------------------------------------------------------------------------------------------------
//  113  */

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  114 static uint8 nb;
nb:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  115 static uint8 txSeqn;
txSeqn:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  116 static uint8 txAckReq;
txAckReq:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  117 static uint8 txRetransmitFlag;
txRetransmitFlag:
        DS 1
        REQUIRE __INIT_XDATA_Z
//  118 
//  119 
//  120 /* ------------------------------------------------------------------------------------------------
//  121  *                                         Local Prototypes
//  122  * ------------------------------------------------------------------------------------------------
//  123  */
//  124 static void txCsmaPrep(void);
//  125 static void txGo(void);
//  126 static void txCsmaGo(void);
//  127 static void txComplete(uint8 status);
//  128 
//  129 
//  130 /**************************************************************************************************
//  131  * @fn          macTxInit
//  132  *
//  133  * @brief       Initialize variables for tx module.
//  134  *
//  135  * @param       none
//  136  *
//  137  * @return      none
//  138  **************************************************************************************************
//  139  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  140 void macTxInit(void)
macTxInit:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function macTxInit
//  141 {
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  142   macTxActive      = MAC_TX_ACTIVE_NO_ACTIVITY;
        LJMP    ?Subroutine5 & 0xFFFF
        CFI EndBlock cfiBlock0
//  143   txRetransmitFlag = 0;
//  144 }
//  145 
//  146 
//  147 /**************************************************************************************************
//  148  * @fn          macTxHaltCleanup
//  149  *
//  150  * @brief       -
//  151  *
//  152  * @param       none
//  153  *
//  154  * @return      none
//  155  **************************************************************************************************
//  156  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  157 void macTxHaltCleanup(void)
macTxHaltCleanup:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function macTxHaltCleanup
//  158 {
        FUNCALL macTxHaltCleanup, macCspTxReset
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  159   MAC_RADIO_TX_RESET();
        ; Setup parameters for call to function macCspTxReset
        LCALL   ??macCspTxReset?relay
//  160   macTxInit();
        LJMP    ?Subroutine5 & 0xFFFF
        CFI EndBlock cfiBlock1
//  161 }
//  162 
//  163 
//  164 /**************************************************************************************************
//  165  * @fn          macTxFrame
//  166  *
//  167  * @brief       Transmit the frame pointed to by pMacDataTx with the specified type.
//  168  *              NOTE! It is not legal to call this function from interrupt context.
//  169  *
//  170  * @param       txType - type of transmit
//  171  *
//  172  * @return      none
//  173  **************************************************************************************************
//  174  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  175 void macTxFrame(uint8 txType)
macTxFrame:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function macTxFrame
//  176 {
        FUNCALL macTxFrame, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, txComplete
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, macCspTxPrepSlotted
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, txCsmaPrep
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, macMemWriteTxFifo
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxFrame, txGo
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
        MOV     A,R1
        MOV     R6,A
//  177   MAC_ASSERT(!macTxActive);            /* transmit on top of transmit */
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        JZ      ??macTxFrame_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  178 
//  179   /* mark transmit as active */
//  180   macTxActive = MAC_TX_ACTIVE_INITIALIZE;
??macTxFrame_0:
        MOV     A,#0x1
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  181 
//  182   /*
//  183    *  The MAC will not enter sleep mode if there is an active transmit.  However, if macSleep() is
//  184    *  ever called from interrupt context, it possible to enter sleep state after a transmit is
//  185    *  intiated but before macTxActive is set.  To recover from this, the transmit must be aborted
//  186    *  and proper notificiation given to high-level.
//  187    */
//  188   if (macSleepState != MAC_SLEEP_STATE_AWAKE)
        MOV     DPTR,#macSleepState
        MOVX    A,@DPTR
        JZ      ??macTxFrame_1
//  189   {
//  190     /* notify high-level that transmit had to be aborted */
//  191     txComplete(MAC_TX_ABORTED);
        ; Setup parameters for call to function txComplete
        MOV     R1,#0x1d
        LCALL   ??txComplete?relay
//  192 
//  193     /* exit from transmit logic */
//  194     return;
        LJMP    ??macTxFrame_2 & 0xFFFF
//  195   }
//  196   
//  197   /* save transmit type */
//  198   macTxType = txType;
??macTxFrame_1:
        MOV     A,R6
        MOV     DPTR,#macTxType
        MOVX    @DPTR,A
//  199 
//  200   /*-------------------------------------------------------------------------------
//  201    *  Prepare for transmit.
//  202    */
//  203   if (macTxType == MAC_TX_TYPE_SLOTTED)
        XRL     A,#0x2
        JNZ     ??macTxFrame_3
//  204   {
//  205     MAC_RADIO_TX_PREP_SLOTTED();
        ; Setup parameters for call to function macCspTxPrepSlotted
        LCALL   ??macCspTxPrepSlotted?relay
        SJMP    ??macTxFrame_4
//  206   }
//  207   else
//  208   {
//  209     MAC_ASSERT((macTxType == MAC_TX_TYPE_SLOTTED_CSMA) || (macTxType == MAC_TX_TYPE_UNSLOTTED_CSMA));
??macTxFrame_3:
        MOVX    A,@DPTR
        JZ      ??macTxFrame_5
        XRL     A,#0x1
        JZ      ??macTxFrame_5
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  210 
//  211     nb = 0;
??macTxFrame_5:
        CLR     A
        MOV     DPTR,#nb
        MOVX    @DPTR,A
//  212     macTxBe = (pMacDataTx->internal.txOptions & MAC_TXOPTION_ALT_BE) ? macPib.altBe : macPib.minBe;
        MOV     DPTR,#pMacDataTx
        MOVX    A,@DPTR
        ADD     A,#0xe
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_8:
        MOV     C,0xE0 /* A   */.6
        JNC     ??macTxFrame_6
        MOV     DPTR,#(macPib + 58)
        SJMP    ??macTxFrame_7
??macTxFrame_6:
        MOV     DPTR,#(macPib + 28)
??macTxFrame_7:
        MOVX    A,@DPTR
        MOV     R2,A
        MOV     A,R2
        MOV     DPTR,#macTxBe
        LCALL   ?Subroutine2 & 0xFFFF
//  213 
//  214     if ((macTxType == MAC_TX_TYPE_SLOTTED_CSMA) && (macPib.battLifeExt))
??CrossCallReturnLabel_4:
        JNZ     ??macTxFrame_8
        MOV     DPTR,#(macPib + 3)
        MOVX    A,@DPTR
        JZ      ??macTxFrame_8
//  215     {
//  216       macTxBe = MIN(2, macTxBe);
        MOV     DPTR,#macTxBe
        MOVX    A,@DPTR
        CLR     C
        SUBB    A,#0x3
        JC      ??macTxFrame_9
        MOV     R2,#0x2
??macTxFrame_9:
        MOV     A,R2
        MOVX    @DPTR,A
//  217     }
//  218 
//  219     txCsmaPrep();
??macTxFrame_8:
        ; Setup parameters for call to function txCsmaPrep
        LCALL   ??txCsmaPrep?relay
//  220   }
//  221 
//  222   /*-------------------------------------------------------------------------------
//  223    *  Load transmit FIFO unless this is a retransmit.  No need to write
//  224    *  the FIFO again in that case.
//  225    */
//  226   if (!txRetransmitFlag)
??macTxFrame_4:
        MOV     DPTR,#txRetransmitFlag
        MOVX    A,@DPTR
        JNZ     ??macTxFrame_10
//  227   {
//  228     uint8 * p;
//  229     uint8   lenMhrMsdu;
//  230 
//  231     MAC_ASSERT(pMacDataTx != NULL); /* must have data to transmit */
        MOV     DPTR,#pMacDataTx
        MOVX    A,@DPTR
        JNZ     ??macTxFrame_11
        INC     DPTR
        MOVX    A,@DPTR
??macTxFrame_11:
        JNZ     ??macTxFrame_12
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  232 
//  233     /* save needed parameters */
//  234     txAckReq = MAC_ACK_REQUEST(pMacDataTx->msdu.p);
??macTxFrame_12:
        MOV     DPTR,#pMacDataTx
        MOVX    A,@DPTR
        ADD     A,#0x2
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_9:
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R2
        MOVX    A,@DPTR
        ANL     A,#0x20
        MOV     DPTR,#txAckReq
        MOVX    @DPTR,A
//  235     txSeqn   = MAC_SEQ_NUMBER(pMacDataTx->msdu.p);
        MOV     DPL,R0
        MOV     DPH,R1
        LCALL   ?Subroutine4 & 0xFFFF
??CrossCallReturnLabel_10:
        MOVX    A,@DPTR
        MOV     DPTR,#txSeqn
        MOVX    @DPTR,A
//  236 
//  237     /* set length of frame (note: use of term msdu is a misnomer, here it's actually mhr + msdu) */
//  238     lenMhrMsdu = pMacDataTx->msdu.len;
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_0:
        MOVX    A,@DPTR
        MOV     R2,A
//  239 
//  240     /* calling code guarantees an unused prepended byte  */
//  241     p = pMacDataTx->msdu.p - PREPENDED_BYTE_LEN;
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        ADD     A,#-0x1
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,#-0x1
        MOV     R1,A
        MOV     DPL,R0
        MOV     DPH,R1
//  242 
//  243     /* first byte of buffer is length of MPDU */
//  244     *p = lenMhrMsdu + MFR_LEN;
        MOV     A,#0x2
        ADD     A,R2
        MOVX    @DPTR,A
//  245 
//  246     /*
//  247      *  Flush the TX FIFO.  This is necessary in case the previous transmit was never
//  248      *  actually sent (e.g. CSMA failed without strobing TXON).  If bytes are written to
//  249      *  the FIFO but not transmitted, they remain in the FIFO to be transmitted whenever
//  250      *  a strobe of TXON does happen.
//  251      */
//  252     MAC_RADIO_FLUSH_TX_FIFO();
        MOV     0xe1,#-0x19
//  253 
//  254     /* write bytes to FIFO, prepended byte is included, MFR is not (it's generated by hardware) */
//  255     MAC_RADIO_WRITE_TX_FIFO(p, PREPENDED_BYTE_LEN + lenMhrMsdu);
        ; Setup parameters for call to function macMemWriteTxFifo
        MOV     A,#0x1
        ADD     A,R2
        MOV     R1,A
        MOV     R2,DPL
        MOV     R3,DPH
        LCALL   ??macMemWriteTxFifo?relay
//  256   }
//  257 
//  258   /*-------------------------------------------------------------------------------
//  259    *  If not receiving, start the transmit.  If receive is active
//  260    *  queue up the transmit.
//  261    *
//  262    *  Critical sections around the state change prevents any sort of race condition
//  263    *  with  macTxStartQueuedFrame().  This guarantees function txGo() will only be
//  264    *  called once.
//  265    */
//  266   {
//  267     halIntState_t  s;
//  268 
//  269     HAL_ENTER_CRITICAL_SECTION(s);
??macTxFrame_10:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  270     if (!macRxActive && !macRxOutgoingAckFlag)
        MOV     DPTR,#macRxActive
        MOVX    A,@DPTR
        JNZ     ??macTxFrame_13
        MOV     DPTR,#macRxOutgoingAckFlag
        MOVX    A,@DPTR
        JNZ     ??macTxFrame_13
//  271     {
//  272       macTxActive = MAC_TX_ACTIVE_GO;
        MOV     A,#-0x7d
        MOV     DPTR,#macTxActive
        LCALL   ?Subroutine1 & 0xFFFF
//  273       HAL_EXIT_CRITICAL_SECTION(s);
//  274       txGo();
??CrossCallReturnLabel_2:
        SJMP    ??macTxFrame_2
//  275     }
//  276     else
//  277     {
//  278       macTxActive = MAC_TX_ACTIVE_QUEUED;
??macTxFrame_13:
        MOV     A,#0x2
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  279       HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R2
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
??macTxFrame_2:
        LJMP    ?Subroutine6 & 0xFFFF
        CFI EndBlock cfiBlock2
        REQUIRE _A_IEN0
        REQUIRE RFST
//  280     }
//  281   }
//  282 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine3:
        CFI Block cfiCond3 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_8
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond4 Using cfiCommon0
        CFI (cfiCond4) NoFunction
        CFI (cfiCond4) Conditional ??CrossCallReturnLabel_9
        CFI (cfiCond4) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond4) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond4) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond4) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond4) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond4) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond4) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond4) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond4) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond4) CFA_SP SP+0
        CFI (cfiCond4) CFA_XSP16 add(XSP16, 9)
        CFI Block cfiPicker5 Using cfiCommon1
        CFI (cfiPicker5) NoFunction
        CFI (cfiPicker5) Picker
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,#0x0
        MOV     R1,A
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        RET
        CFI EndBlock cfiCond3
        CFI EndBlock cfiCond4
        CFI EndBlock cfiPicker5
//  283 
//  284 
//  285 /*=================================================================================================
//  286  * @fn          txCsmaPrep
//  287  *
//  288  * @brief       Prepare/initialize for a CSMA transmit.
//  289  *
//  290  * @param       none
//  291  *
//  292  * @return      none
//  293  *=================================================================================================
//  294  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  295 static void txCsmaPrep(void)
txCsmaPrep:
        CFI Block cfiBlock6 Using cfiCommon0
        CFI Function txCsmaPrep
//  296 {
        FUNCALL txCsmaPrep, macRadioRandomByte
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txCsmaPrep, macCspTxPrepCsmaSlotted
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txCsmaPrep, macCspTxPrepCsmaUnslotted
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xa
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 10)
        ; Saved register size: 10
        ; Auto size: 0
//  297   macTxCsmaBackoffDelay = macRadioRandomByte() & ((1 << macTxBe) - 1);
        ; Setup parameters for call to function macRadioRandomByte
        LCALL   ??macRadioRandomByte?relay
        MOV     A,R1
        MOV     R2,A
        MOV     ?V0 + 0,#0x1
        MOV     ?V0 + 1,#0x0
        MOV     DPTR,#macTxBe
        MOVX    A,@DPTR
        MOV     R0,#?V0 + 0
        LCALL   ?S_SHL
        MOV     A,?V0 + 0
        DEC     A
        ANL     A,R2
        MOV     DPTR,#macTxCsmaBackoffDelay
        LCALL   ?Subroutine2 & 0xFFFF
//  298 
//  299   if (macTxType == MAC_TX_TYPE_SLOTTED_CSMA)
??CrossCallReturnLabel_5:
        JNZ     ??txCsmaPrep_0
//  300   {
//  301     MAC_RADIO_TX_PREP_CSMA_SLOTTED();
        ; Setup parameters for call to function macCspTxPrepCsmaSlotted
        LCALL   ??macCspTxPrepCsmaSlotted?relay
        SJMP    ??txCsmaPrep_1
//  302   }
//  303   else
//  304   {
//  305     MAC_RADIO_TX_PREP_CSMA_UNSLOTTED();
??txCsmaPrep_0:
        ; Setup parameters for call to function macCspTxPrepCsmaUnslotted
        LCALL   ??macCspTxPrepCsmaUnslotted?relay
//  306   }
//  307 }
??txCsmaPrep_1:
        MOV     R7,#0x2
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock6
//  308 
//  309 
//  310 /*=================================================================================================
//  311  * @fn          txGo
//  312  *
//  313  * @brief       Start a transmit going.
//  314  *
//  315  * @param       none
//  316  *
//  317  * @return      none
//  318  *=================================================================================================
//  319  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  320 static void txGo(void)
txGo:
        CFI Block cfiBlock7 Using cfiCommon0
        CFI Function txGo
//  321 {
        FUNCALL txGo, macCspTxGoSlotted
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txGo, txCsmaGo
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  322   /*
//  323    *  If execution has reached this point, any transmitted ACK has long since completed.  It is
//  324    *  possible though that there is still a pending callback.  If so, it is irrelevant and needs to
//  325    *  be canceled at this point.
//  326    */
//  327   MAC_RADIO_CANCEL_ACK_TX_DONE_CALLBACK();
        ANL     0x91,#0xbf
//  328   macRxOutgoingAckFlag = 0;
        CLR     A
        MOV     DPTR,#macRxOutgoingAckFlag
        LCALL   ?Subroutine2 & 0xFFFF
//  329 
//  330   /* based on type of transmit, call the correct "go" functionality */
//  331   if (macTxType == MAC_TX_TYPE_SLOTTED)
??CrossCallReturnLabel_6:
        XRL     A,#0x2
        JNZ     ??txGo_0
//  332   {
//  333     MAC_RADIO_TX_GO_SLOTTED();
        ; Setup parameters for call to function macCspTxGoSlotted
        LCALL   ??macCspTxGoSlotted?relay
        SJMP    ??txGo_1
//  334   }
//  335   else
//  336   {
//  337     txCsmaGo();
??txGo_0:
        ; Setup parameters for call to function txCsmaGo
        LCALL   ??txCsmaGo?relay
//  338   }
//  339 }
??txGo_1:
        SJMP    ??Subroutine5_0
        CFI EndBlock cfiBlock7
        REQUIRE RFIM

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiCond8 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_4
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond9 Using cfiCommon0
        CFI (cfiCond9) NoFunction
        CFI (cfiCond9) Conditional ??CrossCallReturnLabel_5
        CFI (cfiCond9) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond9) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond9) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond9) V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond9) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond9) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond9) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond9) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond9) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond9) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond9) CFA_SP SP+0
        CFI (cfiCond9) CFA_XSP16 add(XSP16, 10)
        CFI Block cfiCond10 Using cfiCommon0
        CFI (cfiCond10) NoFunction
        CFI (cfiCond10) Conditional ??CrossCallReturnLabel_6
        CFI (cfiCond10) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond10) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond10) CFA_SP SP+-5
        CFI Block cfiCond11 Using cfiCommon0
        CFI (cfiCond11) NoFunction
        CFI (cfiCond11) Conditional ??CrossCallReturnLabel_7
        CFI (cfiCond11) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond11) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond11) CFA_SP SP+-5
        CFI Block cfiPicker12 Using cfiCommon1
        CFI (cfiPicker12) NoFunction
        CFI (cfiPicker12) Picker
        MOVX    @DPTR,A
        ; Setup parameters for call to function macTxFrame
        MOV     DPTR,#macTxType
        MOVX    A,@DPTR
        RET
        CFI EndBlock cfiCond8
        CFI EndBlock cfiCond9
        CFI EndBlock cfiCond10
        CFI EndBlock cfiCond11
        CFI EndBlock cfiPicker12
//  340 
//  341 
//  342 /*=================================================================================================
//  343  * @fn          txCsmaGo
//  344  *
//  345  * @brief       Start a CSMA transmit going.
//  346  *
//  347  * @param       none
//  348  *
//  349  * @return      none
//  350  *=================================================================================================
//  351  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  352 static void txCsmaGo(void)
txCsmaGo:
        CFI Block cfiBlock13 Using cfiCommon0
        CFI Function txCsmaGo
//  353 {
        FUNCALL txCsmaGo, macDataTxTimeAvailable
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txCsmaGo, txComplete
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txCsmaGo, macCspTxGoCsma
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  354   if (macTxType == MAC_TX_TYPE_SLOTTED_CSMA)
        MOV     DPTR,#macTxType
        MOVX    A,@DPTR
        JNZ     ??txCsmaGo_0
//  355   {
//  356     if (macTxCsmaBackoffDelay >= macDataTxTimeAvailable())
        ; Setup parameters for call to function macDataTxTimeAvailable
        LCALL   ??macDataTxTimeAvailable?relay
        MOV     A,R1
        MOV     R2,A
        MOV     DPTR,#macTxCsmaBackoffDelay
        MOVX    A,@DPTR
        CLR     C
        SUBB    A,R2
        JC      ??txCsmaGo_0
//  357     {
//  358       txComplete(MAC_NO_TIME);
        ; Setup parameters for call to function txComplete
        MOV     R1,#0x1c
        LCALL   ??txComplete?relay
//  359       return;
        SJMP    ??txCsmaGo_1
//  360     }
//  361   }
//  362 
//  363   MAC_RADIO_TX_GO_CSMA();
??txCsmaGo_0:
        ; Setup parameters for call to function macCspTxGoCsma
        LCALL   ??macCspTxGoCsma?relay
//  364 }
??txCsmaGo_1:
        SJMP    ??Subroutine5_0
        CFI EndBlock cfiBlock13
//  365 
//  366 
//  367 /**************************************************************************************************
//  368  * @fn          macTxFrameRetransmit
//  369  *
//  370  * @brief       Retransmit the last frame.
//  371  *
//  372  * @param       none
//  373  *
//  374  * @return      none
//  375  **************************************************************************************************
//  376  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  377 void macTxFrameRetransmit(void)
macTxFrameRetransmit:
        CFI Block cfiBlock14 Using cfiCommon0
        CFI Function macTxFrameRetransmit
//  378 {
        FUNCALL macTxFrameRetransmit, macTxFrame
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  379   txRetransmitFlag = 1;
        MOV     A,#0x1
        MOV     DPTR,#txRetransmitFlag
        LCALL   ?Subroutine2 & 0xFFFF
//  380   macTxFrame(macTxType);
??CrossCallReturnLabel_7:
        MOV     R1,A
        LCALL   ??macTxFrame?relay
//  381 }
        SJMP    ??Subroutine5_0
        CFI EndBlock cfiBlock14

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine5:
        CFI Block cfiBlock15 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+-5
        CFI DPL0 Frame(CFA_SP, 4)
        CFI DPH0 Frame(CFA_SP, 5)
        CLR     A
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
        MOV     DPTR,#txRetransmitFlag
        MOVX    @DPTR,A
??Subroutine5_0:
        POP     DPH
        CFI CFA_SP SP+-4
        CFI DPH0 SameValue
        POP     DPL
        CFI CFA_SP SP+-3
        CFI DPL0 SameValue
        LJMP    ?BRET
        CFI EndBlock cfiBlock15
//  382 
//  383 
//  384 /**************************************************************************************************
//  385  * @fn          macTxStartQueuedFrame
//  386  *
//  387  * @brief       See if there is a queued frame waiting to transmit.  If so, initiate
//  388  *              the transmit now.
//  389  *
//  390  * @param       none
//  391  *
//  392  * @return      none
//  393  **************************************************************************************************
//  394  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  395 void macTxStartQueuedFrame(void)
macTxStartQueuedFrame:
        CFI Block cfiBlock16 Using cfiCommon0
        CFI Function macTxStartQueuedFrame
//  396 {
        FUNCALL macTxStartQueuedFrame, halAssertHandler
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxStartQueuedFrame, txGo
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  397   halIntState_t  s;
//  398 
//  399   MAC_ASSERT(!macRxActive && !macRxOutgoingAckFlag); /* queued frames should not transmit in middle of a receive */
        MOV     DPTR,#macRxActive
        MOVX    A,@DPTR
        JNZ     ??macTxStartQueuedFrame_0
        MOV     DPTR,#macRxOutgoingAckFlag
        MOVX    A,@DPTR
        JZ      ??macTxStartQueuedFrame_1
??macTxStartQueuedFrame_0:
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  400   
//  401   /*
//  402    *  Critical sections around the state change prevents any sort of race condition
//  403    *  with macTxFrame().  This guarantees function txGo() will only be be called once.
//  404    */
//  405   HAL_ENTER_CRITICAL_SECTION(s);
??macTxStartQueuedFrame_1:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  406   if (macTxActive == MAC_TX_ACTIVE_QUEUED)
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        XRL     A,#0x2
        JNZ     ??macTxStartQueuedFrame_2
//  407   {
//  408     macTxActive = MAC_TX_ACTIVE_GO;
        MOV     A,#-0x7d
        LCALL   ?Subroutine1 & 0xFFFF
//  409     HAL_EXIT_CRITICAL_SECTION(s);
//  410     txGo();
??CrossCallReturnLabel_3:
        SJMP    ??macTxStartQueuedFrame_3
//  411   }
//  412   else
//  413   {
//  414     HAL_EXIT_CRITICAL_SECTION(s);
??macTxStartQueuedFrame_2:
        MOV     A,R2
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  415   }
//  416 }
??macTxStartQueuedFrame_3:
        SJMP    ??Subroutine5_0
        CFI EndBlock cfiBlock16
        REQUIRE _A_IEN0

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiCond17 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_2
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond18 Using cfiCommon0
        CFI (cfiCond18) NoFunction
        CFI (cfiCond18) Conditional ??CrossCallReturnLabel_3
        CFI (cfiCond18) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond18) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond18) CFA_SP SP+-5
        CFI Block cfiPicker19 Using cfiCommon1
        CFI (cfiPicker19) NoFunction
        CFI (cfiPicker19) Picker
        MOVX    @DPTR,A
        MOV     A,R2
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
        ; Setup parameters for call to function txGo
        ; Setup parameters for call to function txGo
        LCALL   ??txGo?relay
        RET
        CFI EndBlock cfiCond17
        CFI EndBlock cfiCond18
        CFI EndBlock cfiPicker19
//  417 
//  418 
//  419 /**************************************************************************************************
//  420  * @fn          macTxChannelBusyCallback
//  421  *
//  422  * @brief       This callback is executed if a CSMA transmit was attempted but the channel
//  423  *              was busy.
//  424  *
//  425  * @param       none
//  426  *
//  427  * @return      none
//  428  **************************************************************************************************
//  429  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  430 void macTxChannelBusyCallback(void)
macTxChannelBusyCallback:
        CFI Block cfiBlock20 Using cfiCommon0
        CFI Function macTxChannelBusyCallback
//  431 {
        FUNCALL macTxChannelBusyCallback, halAssertHandler
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxChannelBusyCallback, macRxOffRequest
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxChannelBusyCallback, txComplete
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxChannelBusyCallback, txCsmaPrep
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxChannelBusyCallback, txCsmaGo
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  432   MAC_ASSERT((macTxType == MAC_TX_TYPE_SLOTTED_CSMA) || (macTxType == MAC_TX_TYPE_UNSLOTTED_CSMA));
        MOV     DPTR,#macTxType
        MOVX    A,@DPTR
        JZ      ??macTxChannelBusyCallback_0
        XRL     A,#0x1
        JZ      ??macTxChannelBusyCallback_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  433 
//  434   /* turn off receiver if allowed */
//  435   macTxActive = MAC_TX_ACTIVE_CHANNEL_BUSY;
??macTxChannelBusyCallback_0:
        MOV     A,#0x4
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  436   macRxOffRequest();
        ; Setup parameters for call to function macRxOffRequest
        LCALL   ??macRxOffRequest?relay
//  437 
//  438   /*  clear channel assement failed, follow through with CSMA algorithm */
//  439   nb++;
        MOV     DPTR,#nb
        MOVX    A,@DPTR
        INC     A
        MOVX    @DPTR,A
//  440   if (nb > macPib.maxCsmaBackoffs)
        MOV     DPTR,#(macPib + 27)
        MOVX    A,@DPTR
        PUSH    A
        CFI CFA_SP SP+-6
        MOV     DPTR,#nb
        MOVX    A,@DPTR
        MOV     R2,A
        POP     A
        CFI CFA_SP SP+-5
        CLR     C
        SUBB    A,R2
        JNC     ??macTxChannelBusyCallback_1
//  441   {
//  442     txComplete(MAC_CHANNEL_ACCESS_FAILURE);
        ; Setup parameters for call to function txComplete
        MOV     R1,#-0x1f
        LCALL   ??txComplete?relay
        SJMP    ??macTxChannelBusyCallback_2
//  443   }
//  444   else
//  445   {
//  446     macTxBe = MIN(macTxBe+1, macPib.maxBe);
??macTxChannelBusyCallback_1:
        MOV     DPTR,#macTxBe
        MOVX    A,@DPTR
        MOV     R0,A
        MOV     A,#0x1
        ADD     A,R0
        INC     R0
        CLR     A
        ADDC    A,#0x0
        MOV     R1,A
        MOV     DPTR,#(macPib + 39)
        MOVX    A,@DPTR
        MOV     R2,A
        MOV     A,R0
        SUBB    A,R2
        MOV     A,R1
        SUBB    A,#0x0
        CLR     C
        XRL     A,PSW
        RLC     A
        JNC     ??macTxChannelBusyCallback_3
        MOV     DPTR,#macTxBe
        MOVX    A,@DPTR
        INC     A
        MOV     R2,A
??macTxChannelBusyCallback_3:
        MOV     A,R2
        MOV     DPTR,#macTxBe
        MOVX    @DPTR,A
//  447     txCsmaPrep();
        ; Setup parameters for call to function txCsmaPrep
        LCALL   ??txCsmaPrep?relay
//  448     macTxActive = MAC_TX_ACTIVE_GO;
        MOV     A,#-0x7d
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  449     txCsmaGo();
        ; Setup parameters for call to function txCsmaGo
        LCALL   ??txCsmaGo?relay
//  450   }
//  451 }
??macTxChannelBusyCallback_2:
        LJMP    ??Subroutine5_0 & 0xFFFF
        CFI EndBlock cfiBlock20
//  452 
//  453 
//  454 /**************************************************************************************************
//  455  * @fn          macTxDoneCallback
//  456  *
//  457  * @brief       This callback is executed when transmit completes.
//  458  *
//  459  * @param       none
//  460  *
//  461  * @return      none
//  462  **************************************************************************************************
//  463  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  464 void macTxDoneCallback(void)
macTxDoneCallback:
        CFI Block cfiBlock21 Using cfiCommon0
        CFI Function macTxDoneCallback
//  465 {
        FUNCALL macTxDoneCallback, txComplete
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxDoneCallback, macCspTxRequestAckTimeoutCallback
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
//  466   halIntState_t  s;
//  467 
//  468   /*
//  469    *  There is a small chance this function could be called twice for a single transmit.
//  470    *  To prevent logic from executing twice, the state variable macTxActive is used as
//  471    *  a gating mechanism to guarantee single time execution.
//  472    */
//  473   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  474   if (macTxActive == MAC_TX_ACTIVE_GO)
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        XRL     A,#0x83
        JNZ     ??macTxDoneCallback_0
//  475   {
//  476     /* see if ACK was requested */
//  477     if (!txAckReq)
        MOV     DPTR,#txAckReq
        MOVX    A,@DPTR
        JNZ     ??macTxDoneCallback_1
//  478     {
//  479       macTxActive = MAC_TX_ACTIVE_DONE;
        MOV     A,#-0x7b
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  480       HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  481 
//  482       /* ACK was not requested, transmit is complete */
//  483       txComplete(MAC_SUCCESS);
        ; Setup parameters for call to function txComplete
        MOV     R1,#0x0
        LCALL   ??txComplete?relay
        SJMP    ??macTxDoneCallback_2
//  484     }
//  485     else
//  486     {
//  487       /*
//  488        *  ACK was requested - must wait to receive it.  A timer is set
//  489        *  to expire after the timeout duration for waiting for an ACK.
//  490        *  If an ACK is received, the function macTxAckReceived() is called.
//  491        *  If an ACK is not received within the timeout period,
//  492        *  the function macTxAckTimeoutCallback() is called.
//  493        */
//  494       macTxActive = MAC_TX_ACTIVE_LISTEN_FOR_ACK;
??macTxDoneCallback_1:
        MOV     A,#-0x7a
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  495       MAC_RADIO_TX_REQUEST_ACK_TIMEOUT_CALLBACK();
        ; Setup parameters for call to function macCspTxRequestAckTimeoutCallback
        LCALL   ??macCspTxRequestAckTimeoutCallback?relay
//  496       HAL_EXIT_CRITICAL_SECTION(s);
//  497     }
//  498   }
//  499   else
//  500   {
//  501     HAL_EXIT_CRITICAL_SECTION(s);
??macTxDoneCallback_0:
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  502   }
//  503 }
??macTxDoneCallback_2:
        SJMP    ?Subroutine6
        CFI EndBlock cfiBlock21
        REQUIRE _A_IEN0
//  504 
//  505 
//  506 /**************************************************************************************************
//  507  * @fn          macTxAckReceivedCallback
//  508  *
//  509  * @brief       This function is called by the receive logic when an ACK is received and
//  510  *              transmit logic is listening for an ACK.
//  511  *
//  512  * @param       seqn        - sequence number of received ACK
//  513  * @param       pendingFlag - set if pending flag of ACK is set, cleared otherwise
//  514  *
//  515  * @return      none
//  516  **************************************************************************************************
//  517  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  518 void macTxAckReceivedCallback(uint8 seqn, uint8 pendingFlag)
macTxAckReceivedCallback:
        CFI Block cfiBlock22 Using cfiCommon0
        CFI Function macTxAckReceivedCallback
//  519 {
        FUNCALL macTxAckReceivedCallback, macCspTxCancelAckTimeoutCallback
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxAckReceivedCallback, txComplete
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxAckReceivedCallback, txComplete
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxAckReceivedCallback, txComplete
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
        MOV     A,R1
        MOV     R6,A
        MOV     A,R2
        MOV     R7,A
//  520   halIntState_t  s;
//  521 
//  522   /* only process if listening for an ACK; critical section prevents race condition problems */
//  523   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     ?V0 + 0,A
        CLR     0xa8.7
//  524   if (macTxActive == MAC_TX_ACTIVE_LISTEN_FOR_ACK)
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        XRL     A,#0x86
        JNZ     ??macTxAckReceivedCallback_0
//  525   {
//  526     macTxActive = MAC_TX_ACTIVE_POST_ACK;
        MOV     A,#-0x79
        MOVX    @DPTR,A
//  527     MAC_RADIO_TX_CANCEL_ACK_TIMEOUT_CALLBACK();
        ; Setup parameters for call to function macCspTxCancelAckTimeoutCallback
        LCALL   ??macCspTxCancelAckTimeoutCallback?relay
//  528     HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,?V0 + 0
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  529 
//  530     /* see if the sequence number of received ACK matches sequence number of packet just sent */
//  531     if (seqn == txSeqn)
        MOV     DPTR,#txSeqn
        MOVX    A,@DPTR
        XRL     A,R6
        JNZ     ??macTxAckReceivedCallback_1
//  532     {
//  533       /*
//  534        *  Sequence numbers match so transmit is successful.  Return appropriate
//  535        *  status based on the pending flag of the received ACK.
//  536        */
//  537       if (pendingFlag)
        MOV     A,R7
        JZ      ??macTxAckReceivedCallback_2
//  538       {
//  539         txComplete(MAC_ACK_PENDING);
        ; Setup parameters for call to function txComplete
        MOV     R1,#0x1b
??macTxAckReceivedCallback_3:
        LCALL   ??txComplete?relay
        SJMP    ??macTxAckReceivedCallback_4
//  540       }
//  541       else
//  542       {
//  543         txComplete(MAC_SUCCESS);
??macTxAckReceivedCallback_2:
        ; Setup parameters for call to function txComplete
        MOV     R1,#0x0
        SJMP    ??macTxAckReceivedCallback_3
//  544       }
//  545     }
//  546     else
//  547     {
//  548       /* sequence number did not match; per spec, transmit failed at this point */
//  549       txComplete(MAC_NO_ACK);
??macTxAckReceivedCallback_1:
        ; Setup parameters for call to function txComplete
        MOV     R1,#-0x17
        LCALL   ??txComplete?relay
        SJMP    ??macTxAckReceivedCallback_4
//  550     }
//  551   }
//  552   else
//  553   {
//  554     HAL_EXIT_CRITICAL_SECTION(s);
??macTxAckReceivedCallback_0:
        MOV     A,?V0 + 0
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
        CFI EndBlock cfiBlock22
//  555   }
//  556 }
??macTxAckReceivedCallback_4:
        REQUIRE ?Subroutine6
        REQUIRE _A_IEN0
        ; // Fall through to label ?Subroutine6

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine6:
        CFI Block cfiBlock23 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x1
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock23
//  557 
//  558 
//  559 /**************************************************************************************************
//  560  * @fn          macTxAckNotReceivedCallback
//  561  *
//  562  * @brief       This function is called by the receive logic when transmit is listening
//  563  *              for an ACK but something else is received.  It is also called if the
//  564  *              listen-for-ACK timeout is reached.
//  565  *
//  566  * @param       none
//  567  *
//  568  * @return      none
//  569  **************************************************************************************************
//  570  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  571 void macTxAckNotReceivedCallback(void)
macTxAckNotReceivedCallback:
        CFI Block cfiBlock24 Using cfiCommon0
        CFI Function macTxAckNotReceivedCallback
//  572 {
        FUNCALL macTxAckNotReceivedCallback, macCspTxCancelAckTimeoutCallback
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxAckNotReceivedCallback, txComplete
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
//  573   halIntState_t  s;
//  574 
//  575   /* only process if listening for an ACK; critical section prevents race condition problems */
//  576   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  577   if (macTxActive == MAC_TX_ACTIVE_LISTEN_FOR_ACK)
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        XRL     A,#0x86
        JNZ     ??macTxAckNotReceivedCallback_0
//  578   {
//  579     macTxActive = MAC_TX_ACTIVE_POST_ACK;
        MOV     A,#-0x79
        MOVX    @DPTR,A
//  580     MAC_RADIO_TX_CANCEL_ACK_TIMEOUT_CALLBACK();
        ; Setup parameters for call to function macCspTxCancelAckTimeoutCallback
        LCALL   ??macCspTxCancelAckTimeoutCallback?relay
//  581     HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  582 
//  583     /* a non-ACK was received when expecting an ACK, per spec transmit is over at this point */
//  584     txComplete(MAC_NO_ACK);
        ; Setup parameters for call to function txComplete
        MOV     R1,#-0x17
        LCALL   ??txComplete?relay
        SJMP    ??macTxAckNotReceivedCallback_1
//  585   }
//  586   else
//  587   {
//  588     HAL_EXIT_CRITICAL_SECTION(s);
??macTxAckNotReceivedCallback_0:
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  589   }
//  590 }
??macTxAckNotReceivedCallback_1:
        SJMP    ?Subroutine6
        CFI EndBlock cfiBlock24
        REQUIRE _A_IEN0
//  591 
//  592 
//  593 /*=================================================================================================
//  594  * @fn          txComplete
//  595  *
//  596  * @brief       Transmit has completed.  Perform needed maintenance and return status of
//  597  *              the transmit via callback function.
//  598  *
//  599  * @param       status - status of the transmit that just went out
//  600  *
//  601  * @return      none
//  602  *=================================================================================================
//  603  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  604 static void txComplete(uint8 status)
txComplete:
        CFI Block cfiBlock25 Using cfiCommon0
        CFI Function txComplete
//  605 {
        FUNCALL txComplete, macRxOffRequest
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txComplete, macRadioUpdateTxPower
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txComplete, macRadioUpdateChannel
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL txComplete, macTxCompleteCallback
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
        MOV     A,R1
        MOV     R6,A
//  606   /* reset the retransmit flag */
//  607   txRetransmitFlag = 0;
        CLR     A
        MOV     DPTR,#txRetransmitFlag
        MOVX    @DPTR,A
//  608 
//  609   /* update tx state; turn off receiver if nothing is keeping it on */
//  610   macTxActive = MAC_TX_ACTIVE_NO_ACTIVITY;
        MOV     DPTR,#macTxActive
        MOVX    @DPTR,A
//  611 
//  612   /* turn off receive if allowed */
//  613   macRxOffRequest();
        ; Setup parameters for call to function macRxOffRequest
        LCALL   ??macRxOffRequest?relay
//  614 
//  615   /* update transmit power in case there was a change */
//  616   macRadioUpdateTxPower();
        ; Setup parameters for call to function macRadioUpdateTxPower
        LCALL   ??macRadioUpdateTxPower?relay
//  617 
//  618   /*
//  619    *  Channel cannot change during transmit so update it here.  (Channel *can* change during
//  620    *  a receive.  The update function resets receive logic and any partially received
//  621    *  frame is purged.)
//  622    */
//  623   macRadioUpdateChannel();
        ; Setup parameters for call to function macRadioUpdateChannel
        LCALL   ??macRadioUpdateChannel?relay
//  624 
//  625   /* return status of transmit via callback function */
//  626   macTxCompleteCallback(status);
        ; Setup parameters for call to function macTxCompleteCallback
        MOV     A,R6
        MOV     R1,A
        LCALL   ??macTxCompleteCallback?relay
//  627 }
        SJMP    ?Subroutine6
        CFI EndBlock cfiBlock25
//  628 
//  629 
//  630 /**************************************************************************************************
//  631  * @fn          macTxTimestampCallback
//  632  *
//  633  * @brief       This callback function records the timestamp into the receive data structure.
//  634  *              It should be called as soon as possible after there is a valid timestamp.
//  635  *
//  636  * @param       none
//  637  *
//  638  * @return      none
//  639  **************************************************************************************************
//  640  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  641 void macTxTimestampCallback(void)
macTxTimestampCallback:
        CFI Block cfiBlock26 Using cfiCommon0
        CFI Function macTxTimestampCallback
//  642 {
        FUNCALL macTxTimestampCallback, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxTimestampCallback, macBackoffTimerCapture
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macTxTimestampCallback, macMcuTimerCapture
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  643   MAC_ASSERT(pMacDataTx != NULL); /* transmit structure must be there */
        MOV     DPTR,#pMacDataTx
        MOVX    A,@DPTR
        JNZ     ??macTxTimestampCallback_0
        INC     DPTR
        MOVX    A,@DPTR
??macTxTimestampCallback_0:
        JNZ     ??macTxTimestampCallback_1
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  644 
//  645   pMacDataTx->internal.timestamp  = macBackoffTimerCapture();
??macTxTimestampCallback_1:
        ; Setup parameters for call to function macBackoffTimerCapture
        LCALL   ??macBackoffTimerCapture?relay
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     ?V0 + 2,R4
        MOV     ?V0 + 3,R5
        MOV     DPTR,#pMacDataTx
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R0
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
//  646   pMacDataTx->internal.timestamp2 = MAC_RADIO_TIMER_CAPTURE();
        ; Setup parameters for call to function macMcuTimerCapture
        LCALL   ??macMcuTimerCapture?relay
        MOV     ?V0 + 0,R2
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_1:
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOV     A,?V0 + 0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
//  647 }
        MOV     R7,#0x4
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock26

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond27 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_0
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond28 Using cfiCommon0
        CFI (cfiCond28) NoFunction
        CFI (cfiCond28) Conditional ??CrossCallReturnLabel_1
        CFI (cfiCond28) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond28) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond28) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond28) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond28) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond28) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond28) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond28) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond28) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond28) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond28) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond28) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond28) CFA_SP SP+0
        CFI (cfiCond28) CFA_XSP16 add(XSP16, 12)
        CFI Block cfiPicker29 Using cfiCommon1
        CFI (cfiPicker29) NoFunction
        CFI (cfiPicker29) Picker
        MOV     DPTR,#pMacDataTx
        LCALL   ?Subroutine4 & 0xFFFF
??CrossCallReturnLabel_11:
        INC     DPTR
        INC     DPTR
        RET
        CFI EndBlock cfiCond27
        CFI EndBlock cfiCond28
        CFI EndBlock cfiPicker29

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine4:
        CFI Block cfiCond30 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_10
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond31 Using cfiCommon0
        CFI (cfiCond31) NoFunction
        CFI (cfiCond31) Conditional ??CrossCallReturnLabel_11, ??CrossCallReturnLabel_0
        CFI (cfiCond31) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond31) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond31) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond31) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond31) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond31) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond31) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond31) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond31) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond31) CFA_SP SP+0
        CFI (cfiCond31) CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond32 Using cfiCommon0
        CFI (cfiCond32) NoFunction
        CFI (cfiCond32) Conditional ??CrossCallReturnLabel_11, ??CrossCallReturnLabel_1
        CFI (cfiCond32) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond32) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond32) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond32) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond32) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond32) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond32) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond32) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond32) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond32) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond32) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond32) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond32) CFA_SP SP+0
        CFI (cfiCond32) CFA_XSP16 add(XSP16, 12)
        CFI Block cfiPicker33 Using cfiCommon1
        CFI (cfiPicker33) NoFunction
        CFI (cfiPicker33) Picker
        MOVX    A,@DPTR
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R2
        INC     DPTR
        INC     DPTR
        RET
        CFI EndBlock cfiCond30
        CFI EndBlock cfiCond31
        CFI EndBlock cfiCond32
        CFI EndBlock cfiPicker33
//  648 
//  649 
//  650 /**************************************************************************************************
//  651  * @fn          macTxCollisionWithRxCallback
//  652  *
//  653  * @brief       Function called if transmit strobed on top of a receive.
//  654  *
//  655  * @param       none
//  656  *
//  657  * @return      none
//  658  **************************************************************************************************
//  659  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  660 void macTxCollisionWithRxCallback(void)
macTxCollisionWithRxCallback:
        CFI Block cfiBlock34 Using cfiCommon0
        CFI Function macTxCollisionWithRxCallback
//  661 {
        FUNCALL macTxCollisionWithRxCallback, macRxHaltCleanup
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  662   macRxHaltCleanup();
        ; Setup parameters for call to function macRxHaltCleanup
        LCALL   ??macRxHaltCleanup?relay
//  663 }
        LJMP    ??Subroutine5_0 & 0xFFFF
        CFI EndBlock cfiBlock34

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for macTxSlottedDelay>`:
        DB 3

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxInit?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxInit

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxHaltCleanup?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxHaltCleanup

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxFrame?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxFrame

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??txCsmaPrep?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    txCsmaPrep

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??txGo?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    txGo

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??txCsmaGo?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    txCsmaGo

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxFrameRetransmit?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxFrameRetransmit

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxStartQueuedFrame?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxStartQueuedFrame

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxChannelBusyCallback?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxChannelBusyCallback

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxDoneCallback?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxDoneCallback

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxAckReceivedCallback?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxAckReceivedCallback

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxAckNotReceivedCallback?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxAckNotReceivedCallback

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??txComplete?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    txComplete

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxTimestampCallback?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxTimestampCallback

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macTxCollisionWithRxCallback?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macTxCollisionWithRxCallback

        END
//  664 
//  665 
//  666 
//  667 /**************************************************************************************************
//  668  *                                  Compile Time Integrity Checks
//  669  **************************************************************************************************
//  670  */
//  671 #if (MAC_TX_ACTIVE_NO_ACTIVITY != 0x00)
//  672 #error "ERROR! Zero is reserved value of macTxActive. Allows boolean operations, e.g !macTxActive."
//  673 #endif
//  674 
//  675 /**************************************************************************************************
//  676 */
// 
// 929 bytes in segment BANKED_CODE
//  90 bytes in segment BANK_RELAYS
//   3 bytes in segment SFR_AN
//   1 byte  in segment XDATA_I
//   1 byte  in segment XDATA_ID
//   8 bytes in segment XDATA_Z
// 
// 1 020 bytes of CODE  memory
//     0 bytes of DATA  memory (+ 3 bytes shared)
//     9 bytes of XDATA memory
//
//Errors: none
//Warnings: none
