###############################################################################
#                                                                             #
# 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\Compone #
#                          nts\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\Loca #
#                          tion\CC2430DB\..\..\..\Tools\CC2430DB\f8wCoord.cfg #
#                          " (-DCPU32MHZ -DFORCE_MAC_NEAR -DROOT=__near_func  #
#                          -DMAC_CFG_APP_PENDING_QUEUE=TRUE                   #
#                          -DZDO_COORDINATOR -DRTR_NWK -DBLINK_LEDS           #
#                          "-DCONST=const __code" -DGENERIC=__generic) -f     #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\Tools #
#                          \CC2430DB\f8wConfig.cfg" (-DSECURE=1               #
#                          -DDEFAULT_CHANLIST=0x04000000                      #
#                          -DZDAPP_CONFIG_PAN_ID=0x00FF                       #
#                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_MA #
#                          SK=0x007F -DBEACON_REQUEST_DELAY=100               #
#                          -DBEACON_REQ_DELAY_MASK=0x00FF                     #
#                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_PO #
#                          LLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7             #
#                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3   #
#                          -DNWK_MAX_DATA_RETRIES=2                           #
#                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9         #
#                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20           #
#                          -DNWK_MAX_BINDING_ENTRIES=10                       #
#                          -DMAX_BINDING_CLUSTER_IDS=5 "-DDEFAULT_KEY={0x02,  #
#                          0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00,    #
#                          0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"         #
#                          -DRFD_RCVC_ALWAYS_ON=FALSE -DPOLL_RATE=1000        #
#                          -DQUEUED_POLL_RATE=100 -DRESPONSE_POLL_RATE=100)   #
#                          -DREJOIN_POLL_RATE=440 "C:\Texas Instruments       #
#                          33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf #
#                          03\mac_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\Projec #
#                          ts\zstack\Project\Location\CC2430DB\LocDongle\List #
#                          \" --diag_suppress Pe001,Pa010 --diag_remark       #
#                          pe550 -o "C:\Texas Instruments                     #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\LocDongle\Obj\" -e                   #
#                          --require_prototypes -z9 --no_code_motion --debug  #
#                          --core=plain --dptr=16,1 --data_model=large        #
#                          --code_model=banked --calling_convention=xdata_ree #
#                          ntrant --place_constants=data --nr_virtual_regs 8  #
#                          -I "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\" -I "C:\Texas Instruments           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\SOURCE\" -I "C:\Texas             #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\WXL\INCLUDE\" -I         #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\MT\" -I "C:\Texas Instruments          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\INCLUD #
#                          E\" -I "C:\Texas Instruments                       #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\TARGET #
#                          \CC2430EB\" -I "C:\Texas Instruments               #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\MCU\C #
#                          CSOC\" -I "C:\Texas Instruments                    #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\INCLU #
#                          DE\" -I "C:\Texas Instruments                      #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\AF\" #
#                           -I "C:\Texas Instruments                          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\NWK\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SEC\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SYS\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\ZDO\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\F8W\" #
#                           -I "C:\Texas Instruments                          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\" -I  #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\SERVICES\SADDR\" -I "C:\Texas          #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\..\..\COMPONENT #
#                          S\SERVICES\SDATA\" -I "C:\Texas Instruments        #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\INCLUD #
#                          E\" -I "C:\Texas Instruments                       #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\HIGH_L #
#                          EVEL\" -I "C:\Texas Instruments                    #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_LE #
#                          VEL\SRF03\" -I "C:\Texas Instruments               #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_LE #
#                          VEL\SRF03\SINGLE_CHIP\" -I "C:\Program Files\IAR   #
#                          Systems\Embedded Workbench 4.0 Evaluation          #
#                          version\8051\INC\" -I "C:\Program Files\IAR        #
#                          Systems\Embedded Workbench 4.0 Evaluation          #
#                          version\8051\INC\CLIB\"                            #
#    List file          =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Project #
#                          s\zstack\Project\Location\CC2430DB\LocDongle\List\ #
#                          mac_rx_onoff.lst                                   #
#    Object file        =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Project #
#                          s\zstack\Project\Location\CC2430DB\LocDongle\Obj\m #
#                          ac_rx_onoff.r51                                    #
#                                                                             #
#                                                                             #
###############################################################################

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"

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

   \                                 In  segment SFR_AN, at 0xe1
   \   unsigned char volatile __sfr RFST
   \                     RFST:
   \   000000                DS 1

   \                                 In  segment SFR_AN, at 0xe9
   \   unsigned char volatile __sfr RFIF
   \                     RFIF:
   \   000000                DS 1
     59          
     60          /* debug */
     61          #include "mac_assert.h"
     62          
     63          
     64          /* ------------------------------------------------------------------------------------------------
     65           *                                         Global Variables
     66           * ------------------------------------------------------------------------------------------------
     67           */

   \                                 In  segment XDATA_Z, align 1, keep-with-next
     68          uint8 macRxOnFlag;
   \                     macRxOnFlag:
   \   000000                DS 1
   \   000001                REQUIRE __INIT_XDATA_Z

   \                                 In  segment XDATA_Z, align 1, keep-with-next
     69          uint8 macRxEnableFlags;
   \                     macRxEnableFlags:
   \   000000                DS 1
   \   000001                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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
     82          void macRxOnOffInit(void)
   \                     macRxOnOffInit:
     83          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
     84            macRxEnableFlags = 0;
   \   000004   E4           CLR     A
   \   000005   90....       MOV     DPTR,#macRxEnableFlags
   \   000008   F0           MOVX    @DPTR,A
     85            macRxOnFlag = 0;
   \   000009   90....       MOV     DPTR,#macRxOnFlag
   \   00000C   F0           MOVX    @DPTR,A
     86          }
   \   00000D   80..         SJMP    ??Subroutine1_0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine1:
   \   000000   EA           MOV     A,R2
   \   000001   A2E0         MOV     C,0xE0 /* A   */.0
   \   000003   92AF         MOV     0xa8.7,C
   \                     ??Subroutine1_0:
   \   000005   D083         POP     DPH
   \   000007   D082         POP     DPL
   \   000009   02....       LJMP    ?BRET
     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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
     99          void macRxEnable(uint8 flags)
   \                     macRxEnable:
    100          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   \   000005   E9           MOV     A,R1
   \   000006   FE           MOV     R6,A
    101            halIntState_t  s;
    102          
    103            MAC_ASSERT(flags != 0); /* rx flags not affected */
   \   000007   7003         JNZ     ??macRxEnable_0
   \   000009                ; Setup parameters for call to function halAssertHandler
   \   000009   12....       LCALL   ??halAssertHandler?relay
    104          
    105            /* set enable flags and then turn on receiver */
    106            HAL_ENTER_CRITICAL_SECTION(s);
   \                     ??macRxEnable_0:
   \   00000C   A2AF         MOV     C,0xa8.7
   \   00000E   E4           CLR     A
   \   00000F   92E0         MOV     0xE0 /* A   */.0,C
   \   000011   FF           MOV     R7,A
   \   000012   C2AF         CLR     0xa8.7
    107            macRxEnableFlags |= flags;
   \   000014   90....       MOV     DPTR,#macRxEnableFlags
   \   000017   E0           MOVX    A,@DPTR
   \   000018   4E           ORL     A,R6
   \   000019   F0           MOVX    @DPTR,A
    108            macRxOn();
   \   00001A                ; Setup parameters for call to function macRxOn
   \   00001A   12....       LCALL   ??macRxOn?relay
    109            HAL_EXIT_CRITICAL_SECTION(s);
   \   00001D   EF           MOV     A,R7
   \   00001E   80..         SJMP    ??Subroutine2_0
   \   000020                REQUIRE _A_IEN0
    110          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   EE           MOV     A,R6
   \                     ??Subroutine2_0:
   \   000001   A2E0         MOV     C,0xE0 /* A   */.0
   \   000003   92AF         MOV     0xa8.7,C
   \                     ??Subroutine2_1:
   \   000005   7F01         MOV     R7,#0x1
   \   000007   02....       LJMP    ?BANKED_LEAVE_XDATA
    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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    124          void macRxSoftEnable(uint8 flags)
   \                     macRxSoftEnable:
    125          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   \   000005   E9           MOV     A,R1
   \   000006   FE           MOV     R6,A
    126            halIntState_t  s;
    127          
    128            MAC_ASSERT(flags != 0); /* rx flags not affected */
   \   000007   7003         JNZ     ??macRxSoftEnable_0
   \   000009                ; Setup parameters for call to function halAssertHandler
   \   000009   12....       LCALL   ??halAssertHandler?relay
    129          
    130            /* set the enable flags but do not turn on the receiver */
    131            HAL_ENTER_CRITICAL_SECTION(s);
   \                     ??macRxSoftEnable_0:
   \   00000C   A2AF         MOV     C,0xa8.7
   \   00000E   E4           CLR     A
   \   00000F   92E0         MOV     0xE0 /* A   */.0,C
   \   000011   FA           MOV     R2,A
   \   000012   C2AF         CLR     0xa8.7
    132            macRxEnableFlags |= flags;
   \   000014   90....       MOV     DPTR,#macRxEnableFlags
   \   000017   E0           MOVX    A,@DPTR
   \   000018   4E           ORL     A,R6
   \   000019   F0           MOVX    @DPTR,A
    133            HAL_EXIT_CRITICAL_SECTION(s);
   \   00001A   EA           MOV     A,R2
   \   00001B   80..         SJMP    ??Subroutine2_0
   \   00001D                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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    148          void macRxDisable(uint8 flags)
   \                     macRxDisable:
    149          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   \   000005   E9           MOV     A,R1
   \   000006   FE           MOV     R6,A
    150            halIntState_t  s;
    151          
    152            MAC_ASSERT(flags != 0); /* rx flags not affected */
   \   000007   7003         JNZ     ??macRxDisable_0
   \   000009                ; Setup parameters for call to function halAssertHandler
   \   000009   12....       LCALL   ??halAssertHandler?relay
    153          
    154            /* clear the indicated flags */
    155            HAL_ENTER_CRITICAL_SECTION(s);
   \                     ??macRxDisable_0:
   \   00000C   A2AF         MOV     C,0xa8.7
   \   00000E   E4           CLR     A
   \   00000F   92E0         MOV     0xE0 /* A   */.0,C
   \   000011   FB           MOV     R3,A
   \   000012   C2AF         CLR     0xa8.7
    156            macRxEnableFlags &= (0xff ^ flags);
   \   000014   74FF         MOV     A,#-0x1
   \   000016   6E           XRL     A,R6
   \   000017   FA           MOV     R2,A
   \   000018   90....       MOV     DPTR,#macRxEnableFlags
   \   00001B   E0           MOVX    A,@DPTR
   \   00001C   5A           ANL     A,R2
   \   00001D   F0           MOVX    @DPTR,A
    157            HAL_EXIT_CRITICAL_SECTION(s);
   \   00001E   EB           MOV     A,R3
   \   00001F   A2E0         MOV     C,0xE0 /* A   */.0
   \   000021   92AF         MOV     0xa8.7,C
    158          
    159            /* turn off the radio if it is allowed */
    160            macRxOffRequest();
   \   000023                ; Setup parameters for call to function macRxOffRequest
   \   000023   12....       LCALL   ??macRxOffRequest?relay
    161          }
   \   000026   80..         SJMP    ??Subroutine2_1
   \   000028                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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    174          void macRxHardDisable(void)
   \                     macRxHardDisable:
    175          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    176            halIntState_t  s;
    177          
    178            HAL_ENTER_CRITICAL_SECTION(s);
   \   000004   A2AF         MOV     C,0xa8.7
   \   000006   E4           CLR     A
   \   000007   92E0         MOV     0xE0 /* A   */.0,C
   \   000009   FA           MOV     R2,A
   \   00000A   C2AF         CLR     0xa8.7
    179          
    180            macRxEnableFlags = 0;
   \   00000C   E4           CLR     A
   \   00000D   90....       MOV     DPTR,#macRxEnableFlags
   \   000010   F0           MOVX    @DPTR,A
    181            macRxOnFlag = 0;
   \   000011   90....       MOV     DPTR,#macRxOnFlag
   \   000014   12....       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:
   \   000017   EA           MOV     A,R2
   \   000018   A2E0         MOV     C,0xE0 /* A   */.0
   \   00001A   92AF         MOV     0xa8.7,C
    189          
    190            /* clean up after being forced off */
    191            macRxHaltCleanup();
   \   00001C                ; Setup parameters for call to function macRxHaltCleanup
   \   00001C   12....       LCALL   ??macRxHaltCleanup?relay
    192          }
   \   00001F   02....       LJMP    ??Subroutine1_0 & 0xFFFF
   \   000022                REQUIRE _A_IEN0
   \   000022                REQUIRE RFST

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   75E1E5       MOV     0xe1,#-0x1b
   \   000004   75E1E6       MOV     0xe1,#-0x1a
   \   000007   75E1E6       MOV     0xe1,#-0x1a
   \   00000A   22           RET
    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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    205          void macRxOnRequest(void)
   \                     macRxOnRequest:
    206          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
    207            halIntState_t  s;
    208          
    209            HAL_ENTER_CRITICAL_SECTION(s);
   \   000005   A2AF         MOV     C,0xa8.7
   \   000007   E4           CLR     A
   \   000008   92E0         MOV     0xE0 /* A   */.0,C
   \   00000A   FE           MOV     R6,A
   \   00000B   C2AF         CLR     0xa8.7
    210            if (macRxEnableFlags)
   \   00000D   90....       MOV     DPTR,#macRxEnableFlags
   \   000010   E0           MOVX    A,@DPTR
   \   000011   6003         JZ      ??macRxOnRequest_0
    211            {
    212              macRxOn();
   \   000013                ; Setup parameters for call to function macRxOn
   \   000013   12....       LCALL   ??macRxOn?relay
    213            }
    214            HAL_EXIT_CRITICAL_SECTION(s);
   \                     ??macRxOnRequest_0:
   \   000016   02....       LJMP    ?Subroutine2 & 0xFFFF
   \   000019                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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    228          void macRxOffRequest(void)
   \                     macRxOffRequest:
    229          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
    230            halIntState_t  s;
    231          
    232            HAL_ENTER_CRITICAL_SECTION(s);
   \   000005   A2AF         MOV     C,0xa8.7
   \   000007   E4           CLR     A
   \   000008   92E0         MOV     0xE0 /* A   */.0,C
   \   00000A   FE           MOV     R6,A
   \   00000B   C2AF         CLR     0xa8.7
    233            if (!macRxEnableFlags)
   \   00000D   90....       MOV     DPTR,#macRxEnableFlags
   \   000010   E0           MOVX    A,@DPTR
   \   000011   7019         JNZ     ??macRxOffRequest_0
    234            {
    235              if (!MAC_RX_IS_PHYSICALLY_ACTIVE() && !MAC_TX_IS_PHYSICALLY_ACTIVE())
   \   000013   90....       MOV     DPTR,#macRxActive
   \   000016   E0           MOVX    A,@DPTR
   \   000017   A2E7         MOV     C,0xE0 /* A   */.7
   \   000019   4011         JC      ??macRxOffRequest_0
   \   00001B   90....       MOV     DPTR,#macRxOutgoingAckFlag
   \   00001E   E0           MOVX    A,@DPTR
   \   00001F   700B         JNZ     ??macRxOffRequest_0
   \   000021   90....       MOV     DPTR,#macTxActive
   \   000024   E0           MOVX    A,@DPTR
   \   000025   A2E7         MOV     C,0xE0 /* A   */.7
   \   000027   4003         JC      ??macRxOffRequest_0
    236              {
    237                macRxOff();
   \   000029                ; Setup parameters for call to function macRxOff
   \   000029   12....       LCALL   ??macRxOff?relay
    238              }
    239            }
    240            HAL_EXIT_CRITICAL_SECTION(s);
   \                     ??macRxOffRequest_0:
   \   00002C   02....       LJMP    ?Subroutine2 & 0xFFFF
   \   00002F                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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    254          void macRxOn(void)
   \                     macRxOn:
    255          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    256            halIntState_t  s;
    257          
    258            HAL_ENTER_CRITICAL_SECTION(s);
   \   000004   A2AF         MOV     C,0xa8.7
   \   000006   E4           CLR     A
   \   000007   92E0         MOV     0xE0 /* A   */.0,C
   \   000009   FA           MOV     R2,A
   \   00000A   C2AF         CLR     0xa8.7
    259            if (!macRxOnFlag)
   \   00000C   90....       MOV     DPTR,#macRxOnFlag
   \   00000F   E0           MOVX    A,@DPTR
   \   000010   7006         JNZ     ??macRxOn_0
    260            {
    261              macRxOnFlag = 1;
   \   000012   7401         MOV     A,#0x1
   \   000014   F0           MOVX    @DPTR,A
    262              MAC_RADIO_RX_ON();
   \   000015   75E1E2       MOV     0xe1,#-0x1e
    263              MAC_DEBUG_TURN_ON_RX_LED();
    264            }
    265            HAL_EXIT_CRITICAL_SECTION(s);
   \                     ??macRxOn_0:
   \   000018   02....       LJMP    ?Subroutine1 & 0xFFFF
   \   00001B                REQUIRE _A_IEN0
   \   00001B                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           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    279          void macRxOff(void)
   \                     macRxOff:
    280          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    281            halIntState_t  s;
    282          
    283            HAL_ENTER_CRITICAL_SECTION(s);
   \   000004   A2AF         MOV     C,0xa8.7
   \   000006   E4           CLR     A
   \   000007   92E0         MOV     0xE0 /* A   */.0,C
   \   000009   FA           MOV     R2,A
   \   00000A   C2AF         CLR     0xa8.7
    284            if (macRxOnFlag)
   \   00000C   90....       MOV     DPTR,#macRxOnFlag
   \   00000F   E0           MOVX    A,@DPTR
   \   000010   6007         JZ      ??macRxOff_0
    285            {
    286              macRxOnFlag = 0;
   \   000012   E4           CLR     A
   \   000013   12....       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:
   \   000016   75E9DF       MOV     0xe9,#-0x21
    295          
    296            }
    297            HAL_EXIT_CRITICAL_SECTION(s);
   \                     ??macRxOff_0:
   \   000019   02....       LJMP    ?Subroutine1 & 0xFFFF
   \   00001C                REQUIRE _A_IEN0
   \   00001C                REQUIRE RFST
   \   00001C                REQUIRE RFIF
    298          }

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

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

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

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

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

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

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

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

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macRxOff?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macRxOff
    299          
    300          
    301          /**************************************************************************************************
    302          */

   Maximum stack usage in bytes:

     Function              ISTACK PSTACK XSTACK
     --------              ------ ------ ------
     macRxDisable              0      0      9
       -> halAssertHandler     0      0     18
       -> macRxOffRequest      0      0     18
     macRxEnable               0      0      9
       -> halAssertHandler     0      0     18
       -> macRxOn              0      0     18
     macRxHardDisable          2      0      0
       -> macRxHaltCleanup     4      0      0
     macRxOff                  2      0      9
     macRxOffRequest           0      0     18
       -> macRxOff             0      0     18
     macRxOn                   2      0      9
     macRxOnOffInit            2      0      0
     macRxOnRequest            0      0      9
       -> macRxOn              0      0     18
     macRxSoftEnable           0      0      9
       -> halAssertHandler     0      0     18


   Segment part sizes:

     Function/Label           Bytes
     --------------           -----
     _A_IEN0                     1
     RFST                        1
     RFIF                        1
     macRxOnFlag                 1
     macRxEnableFlags            1
     macRxOnOffInit             15
     ?Subroutine1               12
     macRxEnable                32
     ?Subroutine2               10
     macRxSoftEnable            29
     macRxDisable               40
     macRxHardDisable           34
     ?Subroutine0               11
     macRxOnRequest             25
     macRxOffRequest            47
     macRxOn                    27
     macRxOff                   28
     ??macRxOnOffInit?relay      6
     ??macRxEnable?relay         6
     ??macRxSoftEnable?relay     6
     ??macRxDisable?relay        6
     ??macRxHardDisable?relay    6
     ??macRxOnRequest?relay      6
     ??macRxOffRequest?relay     6
     ??macRxOn?relay             6
     ??macRxOff?relay            6

 
 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
