///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   08/Aug/2010  22:00:53 /
// 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_rx_onoff.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_rx_onoff.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_rx_onoff.s51                                /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME mac_rx_onoff

        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 ??macRxOff?relay
        EXTERN ??macRxOffRequest?relay
        EXTERN ??macRxOn?relay
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN __INIT_XDATA_Z

        PUBLIC ??macRxDisable?relay
        FUNCTION ??macRxDisable?relay,0203H
        PUBLIC ??macRxEnable?relay
        FUNCTION ??macRxEnable?relay,0203H
        PUBLIC ??macRxHardDisable?relay
        FUNCTION ??macRxHardDisable?relay,0203H
        PUBLIC ??macRxOff?relay
        FUNCTION ??macRxOff?relay,0203H
        PUBLIC ??macRxOffRequest?relay
        FUNCTION ??macRxOffRequest?relay,0203H
        PUBLIC ??macRxOn?relay
        FUNCTION ??macRxOn?relay,0203H
        PUBLIC ??macRxOnOffInit?relay
        FUNCTION ??macRxOnOffInit?relay,0203H
        PUBLIC ??macRxOnRequest?relay
        FUNCTION ??macRxOnRequest?relay,0203H
        PUBLIC ??macRxSoftEnable?relay
        FUNCTION ??macRxSoftEnable?relay,0203H
        PUBWEAK RFIF
        PUBWEAK RFST
        PUBWEAK _A_IEN0
        PUBLIC macRxDisable
        FUNCTION macRxDisable,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macRxEnable
        FUNCTION macRxEnable,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macRxEnableFlags
        PUBLIC macRxHardDisable
        FUNCTION macRxHardDisable,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macRxOff
        FUNCTION macRxOff,0203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macRxOffRequest
        FUNCTION macRxOffRequest,021203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macRxOn
        FUNCTION macRxOn,0203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macRxOnFlag
        PUBLIC macRxOnOffInit
        FUNCTION macRxOnOffInit,0203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macRxOnRequest
        FUNCTION macRxOnRequest,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC macRxSoftEnable
        FUNCTION macRxSoftEnable,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 9, 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
        
halAssertHandler    SYMBOL "halAssertHandler"
macRxHaltCleanup    SYMBOL "macRxHaltCleanup"
??halAssertHandler?relay SYMBOL "?relay", halAssertHandler
??macRxHaltCleanup?relay SYMBOL "?relay", macRxHaltCleanup
macRxDisable        SYMBOL "macRxDisable"
??macRxDisable?relay SYMBOL "?relay", macRxDisable
macRxEnable         SYMBOL "macRxEnable"
??macRxEnable?relay SYMBOL "?relay", macRxEnable
macRxHardDisable    SYMBOL "macRxHardDisable"
??macRxHardDisable?relay SYMBOL "?relay", macRxHardDisable
macRxOff            SYMBOL "macRxOff"
??macRxOff?relay    SYMBOL "?relay", macRxOff
macRxOffRequest     SYMBOL "macRxOffRequest"
??macRxOffRequest?relay SYMBOL "?relay", macRxOffRequest
macRxOn             SYMBOL "macRxOn"
??macRxOn?relay     SYMBOL "?relay", macRxOn
macRxOnOffInit      SYMBOL "macRxOnOffInit"
??macRxOnOffInit?relay SYMBOL "?relay", macRxOnOffInit
macRxOnRequest      SYMBOL "macRxOnRequest"
??macRxOnRequest?relay SYMBOL "?relay", macRxOnRequest
macRxSoftEnable     SYMBOL "macRxSoftEnable"
??macRxSoftEnable?relay SYMBOL "?relay", macRxSoftEnable

        EXTERN halAssertHandler
        FUNCTION halAssertHandler,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, 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 ??macRxHaltCleanup?relay
        FUNCTION ??macRxHaltCleanup?relay,00H
        EXTERN macRxActive
        EXTERN macRxOutgoingAckFlag
        EXTERN macTxActive

// C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf03\mac_rx_onoff.c
//    1 /**************************************************************************************************
//    2   Filename:       mac_rx_onoff.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_defs.h"
//   47 #include "hal_types.h"
//   48 
//   49 /* exported low-level */
//   50 #include "mac_low_level.h"
//   51 
//   52 /* low-level specific */
//   53 #include "mac_rx_onoff.h"
//   54 #include "mac_rx.h"
//   55 #include "mac_tx.h"
//   56 
//   57 /* target specific */
//   58 #include "mac_radio_defs.h"

        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

        ASEGN SFR_AN:DATA:NOROOT,0e9H
// unsigned char volatile __sfr RFIF
RFIF:
        DS 1
//   59 
//   60 /* debug */
//   61 #include "mac_assert.h"
//   62 
//   63 
//   64 /* ------------------------------------------------------------------------------------------------
//   65  *                                         Global Variables
//   66  * ------------------------------------------------------------------------------------------------
//   67  */

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   68 uint8 macRxOnFlag;
macRxOnFlag:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   69 uint8 macRxEnableFlags;
macRxEnableFlags:
        DS 1
        REQUIRE __INIT_XDATA_Z
//   70 
//   71 
//   72 /**************************************************************************************************
//   73  * @fn          macRxOnOffInit
//   74  *
//   75  * @brief       Initialize variables for rx on/off module.
//   76  *
//   77  * @param       none
//   78  *
//   79  * @return      none
//   80  **************************************************************************************************
//   81  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   82 void macRxOnOffInit(void)
macRxOnOffInit:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function macRxOnOffInit
//   83 {
        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
//   84   macRxEnableFlags = 0;
        CLR     A
        MOV     DPTR,#macRxEnableFlags
        MOVX    @DPTR,A
//   85   macRxOnFlag = 0;
        MOV     DPTR,#macRxOnFlag
        MOVX    @DPTR,A
//   86 }
        SJMP    ??Subroutine1_0
        CFI EndBlock cfiBlock0

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+-5
        CFI DPL0 Frame(CFA_SP, 4)
        CFI DPH0 Frame(CFA_SP, 5)
        MOV     A,R2
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
??Subroutine1_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 cfiBlock1
//   87 
//   88 
//   89 /**************************************************************************************************
//   90  * @fn          macRxEnable
//   91  *
//   92  * @brief       Set enable flags and then turn on receiver.
//   93  *
//   94  * @param       flags - byte containing rx enable flags to set
//   95  *
//   96  * @return      none
//   97  **************************************************************************************************
//   98  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   99 void macRxEnable(uint8 flags)
macRxEnable:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function macRxEnable
//  100 {
        FUNCALL macRxEnable, 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 macRxEnable, macRxOn
        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
//  101   halIntState_t  s;
//  102 
//  103   MAC_ASSERT(flags != 0); /* rx flags not affected */
        JNZ     ??macRxEnable_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  104 
//  105   /* set enable flags and then turn on receiver */
//  106   HAL_ENTER_CRITICAL_SECTION(s);
??macRxEnable_0:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R7,A
        CLR     0xa8.7
//  107   macRxEnableFlags |= flags;
        MOV     DPTR,#macRxEnableFlags
        MOVX    A,@DPTR
        ORL     A,R6
        MOVX    @DPTR,A
//  108   macRxOn();
        ; Setup parameters for call to function macRxOn
        LCALL   ??macRxOn?relay
//  109   HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R7
        SJMP    ??Subroutine2_0
        CFI EndBlock cfiBlock2
        REQUIRE _A_IEN0
//  110 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiBlock3 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     A,R6
??Subroutine2_0:
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
??Subroutine2_1:
        MOV     R7,#0x1
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock3
//  111 
//  112 
//  113 /**************************************************************************************************
//  114  * @fn          macRxSoftEnable
//  115  *
//  116  * @brief       Set enable flags but don't turn on the receiver.  Useful to leave the receiver
//  117  *              on after a transmit, but without turning it on immediately.
//  118  *
//  119  * @param       flags - byte containing rx enable flags to set
//  120  *
//  121  * @return      none
//  122  **************************************************************************************************
//  123  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  124 void macRxSoftEnable(uint8 flags)
macRxSoftEnable:
        CFI Block cfiBlock4 Using cfiCommon0
        CFI Function macRxSoftEnable
//  125 {
        FUNCALL macRxSoftEnable, 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
        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
//  126   halIntState_t  s;
//  127 
//  128   MAC_ASSERT(flags != 0); /* rx flags not affected */
        JNZ     ??macRxSoftEnable_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  129 
//  130   /* set the enable flags but do not turn on the receiver */
//  131   HAL_ENTER_CRITICAL_SECTION(s);
??macRxSoftEnable_0:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  132   macRxEnableFlags |= flags;
        MOV     DPTR,#macRxEnableFlags
        MOVX    A,@DPTR
        ORL     A,R6
        MOVX    @DPTR,A
//  133   HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R2
        SJMP    ??Subroutine2_0
        CFI EndBlock cfiBlock4
        REQUIRE _A_IEN0
//  134 }
//  135 
//  136 
//  137 /**************************************************************************************************
//  138  * @fn          macRxDisable
//  139  *
//  140  * @brief       Clear indicated rx enable flags.  If all flags are clear, turn off receiver
//  141  *              unless there is an active receive or transmit.
//  142  *
//  143  * @param       flags - byte containg rx enable flags to clear
//  144  *
//  145  * @return      none
//  146  **************************************************************************************************
//  147  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  148 void macRxDisable(uint8 flags)
macRxDisable:
        CFI Block cfiBlock5 Using cfiCommon0
        CFI Function macRxDisable
//  149 {
        FUNCALL macRxDisable, 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 macRxDisable, 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
        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
//  150   halIntState_t  s;
//  151 
//  152   MAC_ASSERT(flags != 0); /* rx flags not affected */
        JNZ     ??macRxDisable_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  153 
//  154   /* clear the indicated flags */
//  155   HAL_ENTER_CRITICAL_SECTION(s);
??macRxDisable_0:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R3,A
        CLR     0xa8.7
//  156   macRxEnableFlags &= (0xff ^ flags);
        MOV     A,#-0x1
        XRL     A,R6
        MOV     R2,A
        MOV     DPTR,#macRxEnableFlags
        MOVX    A,@DPTR
        ANL     A,R2
        MOVX    @DPTR,A
//  157   HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R3
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  158 
//  159   /* turn off the radio if it is allowed */
//  160   macRxOffRequest();
        ; Setup parameters for call to function macRxOffRequest
        LCALL   ??macRxOffRequest?relay
//  161 }
        SJMP    ??Subroutine2_1
        CFI EndBlock cfiBlock5
        REQUIRE _A_IEN0
//  162 
//  163 
//  164 /**************************************************************************************************
//  165  * @fn          macRxHardDisable
//  166  *
//  167  * @brief       Clear all enable flags and turn off receiver.
//  168  *
//  169  * @param       none
//  170  *
//  171  * @return      none
//  172  **************************************************************************************************
//  173  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  174 void macRxHardDisable(void)
macRxHardDisable:
        CFI Block cfiBlock6 Using cfiCommon0
        CFI Function macRxHardDisable
//  175 {
        FUNCALL macRxHardDisable, 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
//  176   halIntState_t  s;
//  177 
//  178   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  179 
//  180   macRxEnableFlags = 0;
        CLR     A
        MOV     DPTR,#macRxEnableFlags
        MOVX    @DPTR,A
//  181   macRxOnFlag = 0;
        MOV     DPTR,#macRxOnFlag
        LCALL   ?Subroutine0 & 0xFFFF
//  182 
//  183   /* force receiver off */
//  184   MAC_RADIO_RXTX_OFF();
//  185   MAC_RADIO_FLUSH_RX_FIFO();
//  186   MAC_DEBUG_TURN_OFF_RX_LED();
//  187 
//  188   HAL_EXIT_CRITICAL_SECTION(s);
??CrossCallReturnLabel_0:
        MOV     A,R2
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  189 
//  190   /* clean up after being forced off */
//  191   macRxHaltCleanup();
        ; Setup parameters for call to function macRxHaltCleanup
        LCALL   ??macRxHaltCleanup?relay
//  192 }
        LJMP    ??Subroutine1_0 & 0xFFFF
        CFI EndBlock cfiBlock6
        REQUIRE _A_IEN0
        REQUIRE RFST
//  193 
//  194 
//  195 /**************************************************************************************************
//  196  * @fn          macRxOnRequest
//  197  *
//  198  * @brief       Turn on the receiver if any rx enable flag is set.
//  199  *
//  200  * @param       none
//  201  *
//  202  * @return      none
//  203  **************************************************************************************************
//  204  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  205 void macRxOnRequest(void)
macRxOnRequest:
        CFI Block cfiBlock7 Using cfiCommon0
        CFI Function macRxOnRequest
//  206 {
        FUNCALL macRxOnRequest, macRxOn
        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
//  207   halIntState_t  s;
//  208 
//  209   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  210   if (macRxEnableFlags)
        MOV     DPTR,#macRxEnableFlags
        MOVX    A,@DPTR
        JZ      ??macRxOnRequest_0
//  211   {
//  212     macRxOn();
        ; Setup parameters for call to function macRxOn
        LCALL   ??macRxOn?relay
//  213   }
//  214   HAL_EXIT_CRITICAL_SECTION(s);
??macRxOnRequest_0:
        LJMP    ?Subroutine2 & 0xFFFF
        CFI EndBlock cfiBlock7
        REQUIRE _A_IEN0
//  215 }
//  216 
//  217 
//  218 /**************************************************************************************************
//  219  * @fn          macRxOffRequest
//  220  *
//  221  * @brief       Turn off receiver if permitted.
//  222  *
//  223  * @param       none
//  224  *
//  225  * @return      none
//  226  **************************************************************************************************
//  227  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  228 void macRxOffRequest(void)
macRxOffRequest:
        CFI Block cfiBlock8 Using cfiCommon0
        CFI Function macRxOffRequest
//  229 {
        FUNCALL macRxOffRequest, macRxOff
        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
//  230   halIntState_t  s;
//  231 
//  232   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  233   if (!macRxEnableFlags)
        MOV     DPTR,#macRxEnableFlags
        MOVX    A,@DPTR
        JNZ     ??macRxOffRequest_0
//  234   {
//  235     if (!MAC_RX_IS_PHYSICALLY_ACTIVE() && !MAC_TX_IS_PHYSICALLY_ACTIVE())
        MOV     DPTR,#macRxActive
        MOVX    A,@DPTR
        MOV     C,0xE0 /* A   */.7
        JC      ??macRxOffRequest_0
        MOV     DPTR,#macRxOutgoingAckFlag
        MOVX    A,@DPTR
        JNZ     ??macRxOffRequest_0
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        MOV     C,0xE0 /* A   */.7
        JC      ??macRxOffRequest_0
//  236     {
//  237       macRxOff();
        ; Setup parameters for call to function macRxOff
        LCALL   ??macRxOff?relay
//  238     }
//  239   }
//  240   HAL_EXIT_CRITICAL_SECTION(s);
??macRxOffRequest_0:
        LJMP    ?Subroutine2 & 0xFFFF
        CFI EndBlock cfiBlock8
        REQUIRE _A_IEN0
//  241 }
//  242 
//  243 
//  244 /**************************************************************************************************
//  245  * @fn          macRxOn
//  246  *
//  247  * @brief       Turn on the receiver if it's not already on.
//  248  *
//  249  * @param       none
//  250  *
//  251  * @return      none
//  252  **************************************************************************************************
//  253  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  254 void macRxOn(void)
macRxOn:
        CFI Block cfiBlock9 Using cfiCommon0
        CFI Function macRxOn
//  255 {
        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
//  256   halIntState_t  s;
//  257 
//  258   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  259   if (!macRxOnFlag)
        MOV     DPTR,#macRxOnFlag
        MOVX    A,@DPTR
        JNZ     ??macRxOn_0
//  260   {
//  261     macRxOnFlag = 1;
        MOV     A,#0x1
        MOVX    @DPTR,A
//  262     MAC_RADIO_RX_ON();
        MOV     0xe1,#-0x1e
//  263     MAC_DEBUG_TURN_ON_RX_LED();
//  264   }
//  265   HAL_EXIT_CRITICAL_SECTION(s);
??macRxOn_0:
        LJMP    ?Subroutine1 & 0xFFFF
        CFI EndBlock cfiBlock9
        REQUIRE _A_IEN0
        REQUIRE RFST
//  266 }
//  267 
//  268 
//  269 /**************************************************************************************************
//  270  * @fn          macRxOff
//  271  *
//  272  * @brief       Turn off the receiver if it's not already off.
//  273  *
//  274  * @param       none
//  275  *
//  276  * @return      none
//  277  **************************************************************************************************
//  278  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  279 void macRxOff(void)
macRxOff:
        CFI Block cfiBlock10 Using cfiCommon0
        CFI Function macRxOff
//  280 {
        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
//  281   halIntState_t  s;
//  282 
//  283   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  284   if (macRxOnFlag)
        MOV     DPTR,#macRxOnFlag
        MOVX    A,@DPTR
        JZ      ??macRxOff_0
//  285   {
//  286     macRxOnFlag = 0;
        CLR     A
        LCALL   ?Subroutine0 & 0xFFFF
//  287     MAC_RADIO_RXTX_OFF();
//  288     MAC_DEBUG_TURN_OFF_RX_LED();
//  289 
//  290     /* just in case a receive was about to start, flush the receive FIFO */
//  291     MAC_RADIO_FLUSH_RX_FIFO();
//  292 
//  293     /* clear any receive interrupt that happened to squeak through */
//  294     MAC_RADIO_CLEAR_RX_THRESHOLD_INTERRUPT_FLAG();
??CrossCallReturnLabel_1:
        MOV     0xe9,#-0x21
//  295 
//  296   }
//  297   HAL_EXIT_CRITICAL_SECTION(s);
??macRxOff_0:
        LJMP    ?Subroutine1 & 0xFFFF
        CFI EndBlock cfiBlock10
        REQUIRE _A_IEN0
        REQUIRE RFST
        REQUIRE RFIF
//  298 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond11 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_0
        CFI DPL0 Frame(CFA_SP, 4)
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        CFI Block cfiCond12 Using cfiCommon0
        CFI (cfiCond12) NoFunction
        CFI (cfiCond12) Conditional ??CrossCallReturnLabel_1
        CFI (cfiCond12) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond12) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond12) CFA_SP SP+-5
        CFI Block cfiPicker13 Using cfiCommon1
        CFI (cfiPicker13) NoFunction
        CFI (cfiPicker13) Picker
        MOVX    @DPTR,A
        MOV     0xe1,#-0x1b
        MOV     0xe1,#-0x1a
        MOV     0xe1,#-0x1a
        RET
        CFI EndBlock cfiCond11
        CFI EndBlock cfiCond12
        CFI EndBlock cfiPicker13

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

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

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

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

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

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

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

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

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

        END
//  299 
//  300 
//  301 /**************************************************************************************************
//  302 */
// 
// 310 bytes in segment BANKED_CODE
//  54 bytes in segment BANK_RELAYS
//   3 bytes in segment SFR_AN
//   2 bytes in segment XDATA_Z
// 
// 364 bytes of CODE  memory
//   0 bytes of DATA  memory (+ 3 bytes shared)
//   2 bytes of XDATA memory
//
//Errors: none
//Warnings: none
