///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   12/Sep/2010  21:57:32 /
// 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\hal\target\CC2430BB\hal_led.c                /
//    Command line       =  -f "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\CC2430DB\f8wRouter. /
//                          cfg" (-DCPU32MHZ -DFORCE_MAC_NEAR                 /
//                          -DROOT=__near_func -DMAC_CFG_APP_PENDING_QUEUE=TR /
//                          UE -DRTR_NWK -DBLINK_LEDS "-DCONST=const __code"  /
//                          -DGENERIC=__generic) -f "C:\Texas Instruments     /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\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\hal\target\CC2430BB\hal_led.c" -D CC2430EB  /
//                          -D LOCATION_REFNODE -D xNV_RESTORE -D ZTOOL_P1    /
//                          -D MT_TASK -D POWER_SAVING -D                     /
//                          HAL_UART_BIG_TX_BUF=1 -D                          /
//                          SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D               /
//                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas          /
//                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack /
//                          \Project\Location\CC2430DB\RefNode\List\" -lA     /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\RefNode\List /
//                          \" --diag_suppress Pe001,Pa010 --diag_remark      /
//                          pe550 -o "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\RefNode\Obj\" -e                   /
//                          --require_prototypes -z9 --no_code_motion         /
//                          --debug --core=plain --dptr=16,1                  /
//                          --data_model=large --code_model=banked            /
//                          --calling_convention=xdata_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\..\..\..\..\ /
//                          ..\COMPONENTS\MT\" -I "C:\Texas Instruments       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\INCL /
//                          UDE\" -I "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\TARG /
//                          ET\CC2430BB\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\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\RefNode\List\ /
//                          hal_led.s51                                       /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME hal_led

        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 ??HalLedBlink?relay
        EXTERN ??HalLedOnOff?relay
        EXTERN ??HalLedSet?relay
        EXTERN ??HalLedUpdate?relay
        EXTERN ?ALLOC_XSTACK8
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN ?DEALLOC_XSTACK8
        EXTERN ?L_ADD_X
        EXTERN ?L_MOV_TO_X
        EXTERN ?L_MOV_X
        EXTERN ?L_MUL
        EXTERN ?UC_SWITCH_SPARSE
        EXTERN ?UL_DIV_MOD
        EXTERN ?UL_GT_X
        EXTERN ?V0
        EXTERN ?XSP
        EXTERN ?XSTACK_DISP0_8
        EXTERN __INIT_XDATA_I
        EXTERN __INIT_XDATA_Z

        PUBLIC ??HalLedBlink?relay
        FUNCTION ??HalLedBlink?relay,0203H
        PUBLIC ??HalLedEnterSleep?relay
        FUNCTION ??HalLedEnterSleep?relay,0203H
        PUBLIC ??HalLedExitSleep?relay
        FUNCTION ??HalLedExitSleep?relay,0203H
        PUBLIC ??HalLedInit?relay
        FUNCTION ??HalLedInit?relay,0203H
        PUBLIC ??HalLedOnOff?relay
        FUNCTION ??HalLedOnOff?relay,0203H
        PUBLIC ??HalLedSet?relay
        FUNCTION ??HalLedSet?relay,0203H
        PUBLIC ??HalLedUpdate?relay
        FUNCTION ??HalLedUpdate?relay,0203H
        PUBLIC HalLedBlink
        FUNCTION HalLedBlink,021203H
        ARGFRAME XSTACK, 11, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 20, STACK
        PUBLIC HalLedEnterSleep
        FUNCTION HalLedEnterSleep,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC HalLedExitSleep
        FUNCTION HalLedExitSleep,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC HalLedInit
        FUNCTION HalLedInit,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC HalLedOnOff
        FUNCTION HalLedOnOff,0203H
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC HalLedSet
        FUNCTION HalLedSet,0a1203H
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 11, STACK
        PUBLIC HalLedUpdate
        FUNCTION HalLedUpdate,021203H
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME XSTACK, 26, STACK
        PUBWEAK _A_P1
        PUBWEAK __Constant_64
        
        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
        
osal_GetSystemClock SYMBOL "osal_GetSystemClock"
osal_set_event      SYMBOL "osal_set_event"
osal_start_timerEx  SYMBOL "osal_start_timerEx"
??osal_GetSystemClock?relay SYMBOL "?relay", osal_GetSystemClock
??osal_set_event?relay SYMBOL "?relay", osal_set_event
??osal_start_timerEx?relay SYMBOL "?relay", osal_start_timerEx
HalLedBlink         SYMBOL "HalLedBlink"
??HalLedBlink?relay SYMBOL "?relay", HalLedBlink
HalLedEnterSleep    SYMBOL "HalLedEnterSleep"
??HalLedEnterSleep?relay SYMBOL "?relay", HalLedEnterSleep
HalLedExitSleep     SYMBOL "HalLedExitSleep"
??HalLedExitSleep?relay SYMBOL "?relay", HalLedExitSleep
HalLedInit          SYMBOL "HalLedInit"
??HalLedInit?relay  SYMBOL "?relay", HalLedInit
HalLedOnOff         SYMBOL "HalLedOnOff"
??HalLedOnOff?relay SYMBOL "?relay", HalLedOnOff
HalLedSet           SYMBOL "HalLedSet"
??HalLedSet?relay   SYMBOL "?relay", HalLedSet
HalLedUpdate        SYMBOL "HalLedUpdate"
??HalLedUpdate?relay SYMBOL "?relay", HalLedUpdate

        EXTERN osal_GetSystemClock
        FUNCTION osal_GetSystemClock,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN osal_set_event
        FUNCTION osal_set_event,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN osal_start_timerEx
        FUNCTION osal_start_timerEx,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN ??osal_GetSystemClock?relay
        FUNCTION ??osal_GetSystemClock?relay,00H
        EXTERN ??osal_set_event?relay
        FUNCTION ??osal_set_event?relay,00H
        EXTERN ??osal_start_timerEx?relay
        FUNCTION ??osal_start_timerEx?relay,00H
        EXTERN Hal_TaskID

// C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\hal\target\CC2430BB\hal_led.c
//    1 /**************************************************************************************************
//    2   Filename:       hal_led.c
//    3   Revised:        $Date: 2007-11-01 08:44:53 -0700 (Thu, 01 Nov 2007) $
//    4   Revision:       $Revision: 15821 $
//    5 
//    6   Description:    This file contains the interface to the HAL LED Service.
//    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 #include "hal_mcu.h"

        ASEGN SFR_AN:DATA:NOROOT,090H
// union <unnamed> volatile __sfr _A_P1
_A_P1:
        DS 1
//   44 #include "hal_defs.h"
//   45 #include "hal_types.h"
//   46 #include "hal_drivers.h"
//   47 #include "hal_led.h"
//   48 #include "osal.h"
//   49 #include "hal_board.h"
//   50 
//   51 /***************************************************************************************************
//   52  *                                             CONSTANTS
//   53  ***************************************************************************************************/
//   54 
//   55 /***************************************************************************************************
//   56  *                                              MACROS
//   57  ***************************************************************************************************/
//   58 
//   59 /***************************************************************************************************
//   60  *                                              TYPEDEFS
//   61  ***************************************************************************************************/
//   62 /* LED control structure */
//   63 typedef struct {
//   64   uint8 mode;       /* Operation mode */
//   65   uint8 todo;       /* Blink cycles left */
//   66   uint8 onPct;      /* On cycle percentage */
//   67   uint16 time;      /* On/off cycle time (msec) */
//   68   uint32 next;      /* Time for next change */
//   69 } HalLedControl_t;
//   70 
//   71 typedef struct
//   72 {
//   73   HalLedControl_t HalLedControlTable[HAL_LED_DEFAULT_MAX_LEDS];
//   74   uint8           sleepActive;
//   75 } HalLedStatus_t;
//   76 
//   77 
//   78 /***************************************************************************************************
//   79  *                                           GLOBAL VARIABLES
//   80  ***************************************************************************************************/
//   81 
//   82 

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   83 static uint8 HalLedState;              // LED state at last set/clr/blink update
HalLedState:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   84 static uint8 HalSleepLedState;         // LED state at last set/clr/blink update
HalSleepLedState:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   85 static uint8 preBlinkState;            // Original State before going to blink mode
preBlinkState:
        DS 1
        REQUIRE __INIT_XDATA_Z
//   86                                        // bit 0, 1, 2, 3 represent led 0, 1, 2, 3
//   87 
//   88 #ifdef BLINK_LEDS

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   89   static HalLedStatus_t HalLedStatusControl;
HalLedStatusControl:
        DS 37
        REQUIRE __INIT_XDATA_Z
//   90 #endif
//   91 
//   92 /***************************************************************************************************
//   93  *                                            LOCAL FUNCTION
//   94  ***************************************************************************************************/
//   95 #if (HAL_LED == TRUE)
//   96 void HalLedUpdate (void);
//   97 void HalLedOnOff (uint8 leds, uint8 mode);
//   98 #endif /* HAL_LED */
//   99 
//  100 /***************************************************************************************************
//  101  *                                            FUNCTIONS - API
//  102  ***************************************************************************************************/
//  103 
//  104 /***************************************************************************************************
//  105  * @fn      HalLedInit
//  106  *
//  107  * @brief   Initialize LED Service
//  108  *
//  109  * @param   init - pointer to void that contains the initialized value
//  110  *
//  111  * @return  None
//  112  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  113 void HalLedInit (void)
HalLedInit:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function HalLedInit
//  114 {
        FUNCALL HalLedInit, HalLedSet
        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
//  115 #if (HAL_LED == TRUE)
//  116   /* Initialize all LEDs to OFF */
//  117   HalLedSet (HAL_LED_ALL, HAL_LED_MODE_OFF);
        ; Setup parameters for call to function HalLedSet
        MOV     R2,#0x0
        MOV     R1,#0xf
        LCALL   ??HalLedSet?relay
//  118   /* Initialize sleepActive to FALSE */
//  119   HalLedStatusControl.sleepActive = FALSE;
        LJMP    ?Subroutine9 & 0xFFFF
        CFI EndBlock cfiBlock0
//  120 #endif /* HAL_LED */
//  121 }
//  122 
//  123 /***************************************************************************************************
//  124  * @fn      HalLedSet
//  125  *
//  126  * @brief   Tun ON/OFF/TOGGLE given LEDs
//  127  *
//  128  * @param   led - bit mask value of leds to be turned ON/OFF/TOGGLE
//  129  *          mode - BLINK, FLASH, TOGGLE, ON, OFF
//  130  * @return  None
//  131  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  132 uint8 HalLedSet (uint8 leds, uint8 mode)
HalLedSet:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function HalLedSet
//  133 {
        FUNCALL HalLedSet, HalLedBlink
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 11, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 11, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedSet, HalLedBlink
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 11, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 11, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedSet, HalLedOnOff
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 11, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 11, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xb
        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 V2 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 11)
        ; Saved register size: 11
        ; Auto size: 0
        MOV     ?V0 + 0,R1
        MOV     ?V0 + 1,R2
//  134 
//  135 #if (defined (BLINK_LEDS)) && (HAL_LED == TRUE)
//  136   uint8 led;
//  137   HalLedControl_t *sts;
//  138 
//  139   switch (mode)
        MOV     A,R2
        LCALL   ?UC_SWITCH_SPARSE
`?<Jumptable for HalLedSet>_0`:
        DATA
        DB        1
        DB        0
        DB        1
        DW        ??HalLedSet_0
        DB        3
        DB        2
        DW        ??HalLedSet_1
        DB        4
        DW        ??HalLedSet_2
        DB        8
        DW        ??HalLedSet_0
        DW        ??HalLedSet_3
        CODE
//  140   {
//  141     case HAL_LED_MODE_BLINK:
//  142       /* Default blink, 1 time, D% duty cycle */
//  143       HalLedBlink (leds, 1, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME);
??HalLedSet_1:
        ; Setup parameters for call to function HalLedBlink
        MOV     R4,#-0x18
        MOV     R5,#0x3
        MOV     R3,#0x5
        MOV     R2,#0x1
??HalLedSet_4:
        LCALL   ??HalLedBlink?relay
//  144       break;
//  145 
//  146     case HAL_LED_MODE_FLASH:
//  147       /* Default flash, N times, D% duty cycle */
//  148       HalLedBlink (leds, HAL_LED_DEFAULT_FLASH_COUNT, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME);
//  149       break;
//  150 
//  151     case HAL_LED_MODE_ON:
//  152     case HAL_LED_MODE_OFF:
//  153     case HAL_LED_MODE_TOGGLE:
//  154 
//  155       led = HAL_LED_1;
//  156       leds &= HAL_LED_ALL;
//  157       sts = HalLedStatusControl.HalLedControlTable;
//  158 
//  159       while (leds)
//  160       {
//  161         if (leds & led)
//  162         {
//  163           if (mode != HAL_LED_MODE_TOGGLE)
//  164           {
//  165             sts->mode = mode;  /* ON or OFF */
//  166           }
//  167           else
//  168           {
//  169             sts->mode ^= HAL_LED_MODE_ON;  /* Toggle */
//  170           }
//  171           HalLedOnOff (led, sts->mode);
//  172           leds ^= led;
//  173         }
//  174         led <<= 1;
//  175         sts++;
//  176       }
//  177       break;
//  178 
//  179     default:
//  180       break;
//  181   }
//  182 
//  183 #elif (HAL_LED == TRUE)
//  184   LedOnOff(leds, mode);
//  185 #endif /* BLINK_LEDS && HAL_LED   */
//  186 
//  187   return ( HalLedState );
??HalLedSet_3:
        MOV     DPTR,#HalLedState
        MOVX    A,@DPTR
        MOV     R1,A
        MOV     R7,#0x3
        LJMP    ?BANKED_LEAVE_XDATA
??HalLedSet_2:
        ; Setup parameters for call to function HalLedBlink
        MOV     R4,#-0x18
        MOV     R5,#0x3
        MOV     R3,#0x5
        MOV     R2,#0x32
        SJMP    ??HalLedSet_4
??HalLedSet_0:
        MOV     ?V0 + 2,#0x1
        ANL     ?V0 + 0,#0xf
        MOV     R6,#(HalLedStatusControl & 0xff)
        MOV     R7,#((HalLedStatusControl >> 8) & 0xff)
        SJMP    ??HalLedSet_5
??HalLedSet_6:
        MOVX    A,@DPTR
        XRL     A,#0x1
??HalLedSet_7:
        MOVX    @DPTR,A
        ; Setup parameters for call to function HalLedOnOff
        MOVX    A,@DPTR
        MOV     R2,A
        MOV     R1,?V0 + 2
        LCALL   ??HalLedOnOff?relay
        MOV     A,?V0 + 2
        XRL     ?V0 + 0,A
??HalLedSet_8:
        MOV     A,?V0 + 2
        CLR     C
        RLC     A
        MOV     ?V0 + 2,A
        MOV     A,R6
        ADD     A,#0x9
        MOV     R6,A
        MOV     A,R7
        ADDC    A,#0x0
        MOV     R7,A
??HalLedSet_5:
        MOV     A,?V0 + 0
        JZ      ??HalLedSet_3
        MOV     A,?V0 + 2
        ANL     A,?V0 + 0
        JZ      ??HalLedSet_8
        MOV     A,#0x8
        XRL     A,?V0 + 1
        MOV     DPL,R6
        MOV     DPH,R7
        JZ      ??HalLedSet_6
        MOV     A,?V0 + 1
        SJMP    ??HalLedSet_7
        CFI EndBlock cfiBlock1
//  188 
//  189 }
//  190 
//  191 /***************************************************************************************************
//  192  * @fn      HalLedBlink
//  193  *
//  194  * @brief   Blink the leds
//  195  *
//  196  * @param   leds       - bit mask value of leds to be blinked
//  197  *          numBlinks  - number of blinks
//  198  *          percent    - the percentage in each period where the led
//  199  *                       will be on
//  200  *          period     - length of each cycle in milliseconds
//  201  *
//  202  * @return  None
//  203  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  204 void HalLedBlink (uint8 leds, uint8 numBlinks, uint8 percent, uint16 period)
HalLedBlink:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function HalLedBlink
//  205 {
        FUNCALL HalLedBlink, osal_GetSystemClock
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedBlink, osal_set_event
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedBlink, HalLedSet
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedBlink, HalLedSet
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        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 V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 4
        MOV     A,#-0x4
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 20)
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R2
        MOVX    @DPTR,A
        MOV     A,R3
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    @DPTR,A
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R4
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R5
        MOVX    @DPTR,A
        MOV     ?V0 + 0,R1
//  206 #if (defined (BLINK_LEDS)) && (HAL_LED == TRUE)
//  207   uint8 led;
//  208   HalLedControl_t *sts;
//  209 
//  210   if (leds && percent && period)
        MOV     A,R1
        JNZ     $+5
        LJMP    ??HalLedBlink_0 & 0xFFFF
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        JNZ     $+5
        LJMP    ??HalLedBlink_0 & 0xFFFF
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??HalLedBlink_1
        INC     DPTR
        MOVX    A,@DPTR
??HalLedBlink_1:
        JNZ     $+5
        LJMP    ??HalLedBlink_0 & 0xFFFF
//  211   {
//  212     if (percent < 100)
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        CLR     C
        SUBB    A,#0x64
        JC      $+5
        LJMP    ??HalLedBlink_2 & 0xFFFF
//  213     {
//  214       led = HAL_LED_1;
        MOV     ?V0 + 1,#0x1
//  215       leds &= HAL_LED_ALL;
        ANL     ?V0 + 0,#0xf
//  216       sts = HalLedStatusControl.HalLedControlTable;
        MOV     ?V0 + 2,#(HalLedStatusControl & 0xff)
        MOV     ?V0 + 3,#((HalLedStatusControl >> 8) & 0xff)
        LJMP    ??HalLedBlink_3 & 0xFFFF
//  217 
//  218       while (leds)
//  219       {
//  220         if (leds & led)
??HalLedBlink_4:
        MOV     A,?V0 + 1
        ANL     A,?V0 + 0
        JZ      ??HalLedBlink_5
//  221         {
//  222           /* Store the current state of the led before going to blinking */
//  223           preBlinkState |= (led & HalLedState);
        MOV     DPTR,#HalLedState
        MOVX    A,@DPTR
        ANL     A,?V0 + 1
        MOV     R2,A
        MOV     DPTR,#preBlinkState
        MOVX    A,@DPTR
        ORL     A,R2
        MOVX    @DPTR,A
//  224           
//  225           sts->mode  = HAL_LED_MODE_OFF;                    /* Stop previous blink */
        CLR     A
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
        MOVX    @DPTR,A
//  226           sts->time  = period;                              /* Time for one on/off cycle */
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R1,A
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
//  227           sts->onPct = percent;                             /* % of cycle LED is on */
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_13:
        INC     DPTR
        MOVX    @DPTR,A
//  228           sts->todo  = numBlinks;                           /* Number of blink cycles */
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_14:
        MOVX    @DPTR,A
//  229           if (!numBlinks) sts->mode |= HAL_LED_MODE_FLASH;  /* Continuous */
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??HalLedBlink_6
        MOV     A,#0x4
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
        MOVX    @DPTR,A
//  230           sts->next = osal_GetSystemClock();                /* Start now */
??HalLedBlink_6:
        ; Setup parameters for call to function osal_GetSystemClock
        LCALL   ??osal_GetSystemClock?relay
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R4
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R5
        MOVX    @DPTR,A
//  231           sts->mode |= HAL_LED_MODE_BLINK;                  /* Enable blinking */
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
        MOVX    A,@DPTR
        SETB    0xE0 /* A   */.1
        MOVX    @DPTR,A
//  232           leds ^= led;
        MOV     A,?V0 + 1
        XRL     ?V0 + 0,A
//  233         }
//  234         led <<= 1;
??HalLedBlink_5:
        MOV     A,?V0 + 1
        CLR     C
        RLC     A
        MOV     ?V0 + 1,A
//  235         sts++;
        MOV     A,?V0 + 2
        ADD     A,#0x9
        MOV     ?V0 + 2,A
        MOV     A,?V0 + 3
        ADDC    A,#0x0
        MOV     ?V0 + 3,A
//  236       }
??HalLedBlink_3:
        MOV     A,?V0 + 0
        JZ      $+5
        LJMP    ??HalLedBlink_4 & 0xFFFF
//  237       osal_set_event (Hal_TaskID, HAL_LED_BLINK_EVENT);
        ; Setup parameters for call to function osal_set_event
        MOV     R2,#0x2
        MOV     R3,#0x0
        MOV     DPTR,#Hal_TaskID
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??osal_set_event?relay
        SJMP    ??HalLedBlink_7
//  238     }
//  239     else
//  240     {
//  241       HalLedSet (leds, HAL_LED_MODE_ON);                    /* >= 100%, turn on */
??HalLedBlink_2:
        ; Setup parameters for call to function HalLedSet
        MOV     R2,#0x1
        SJMP    ??HalLedBlink_8
//  242     }
//  243   }
//  244   else
//  245   {
//  246     HalLedSet (leds, HAL_LED_MODE_OFF);                     /* No on time, turn off */
??HalLedBlink_0:
        ; Setup parameters for call to function HalLedSet
        MOV     R2,#0x0
??HalLedBlink_8:
        LCALL   ??HalLedSet?relay
//  247   }
//  248 #elif (HAL_LED == TRUE)
//  249   percent = (leds & HalLedState) ? HAL_LED_MODE_OFF : HAL_LED_MODE_ON;
//  250   HalLedOnOff (leds, percent);                              /* Toggle */
//  251 #endif /* BLINK_LEDS && HAL_LED */
//  252 }
??HalLedBlink_7:
        MOV     A,#0x4
        CFI EndBlock cfiBlock2
        REQUIRE ?Subroutine10
        ; // Fall through to label ?Subroutine10

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine10:
        CFI Block cfiBlock3 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 20)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        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(-16)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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)))
        CFI Invalid
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 16)
        CFI Valid
        MOV     R7,#0x8
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock3

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine5:
        CFI Block cfiCond4 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_13
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 20)
        CFI Block cfiCond5 Using cfiCommon0
        CFI (cfiCond5) NoFunction
        CFI (cfiCond5) Conditional ??CrossCallReturnLabel_14
        CFI (cfiCond5) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond5) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond5) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond5) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond5) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond5) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond5) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond5) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond5) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond5) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond5) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond5) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond5) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond5) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond5) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond5) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond5) CFA_SP SP+0
        CFI (cfiCond5) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiPicker6 Using cfiCommon1
        CFI (cfiPicker6) NoFunction
        CFI (cfiPicker6) Picker
        MOVX    A,@DPTR
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
        INC     DPTR
        RET
        CFI EndBlock cfiCond4
        CFI EndBlock cfiCond5
        CFI EndBlock cfiPicker6
//  253 
//  254 #if (HAL_LED == TRUE)
//  255 /***************************************************************************************************
//  256  * @fn      HalLedUpdate
//  257  *
//  258  * @brief   Update leds to work with blink
//  259  *
//  260  * @param   none
//  261  *
//  262  * @return  none
//  263  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  264 void HalLedUpdate (void)
HalLedUpdate:
        CFI Block cfiBlock7 Using cfiCommon0
        CFI Function HalLedUpdate
//  265 {
        FUNCALL HalLedUpdate, osal_GetSystemClock
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedUpdate, HalLedOnOff
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedUpdate, HalLedOnOff
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedUpdate, HalLedSet
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL HalLedUpdate, osal_start_timerEx
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        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 V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 10
        MOV     A,#-0xa
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 26)
//  266   uint8 led;
//  267   uint8 pct;
//  268   uint8 leds;
//  269   HalLedControl_t *sts;
//  270   uint32 time;
//  271   uint16 next;
//  272   uint16 wait;
//  273 
//  274   next = 0;
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        CLR     A
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    @DPTR,A
//  275   led  = HAL_LED_1;
        MOV     A,#0x1
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    @DPTR,A
//  276   leds = HAL_LED_ALL;
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOV     A,#0xf
        MOVX    @DPTR,A
//  277   sts = HalLedStatusControl.HalLedControlTable;
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOV     A,#(HalLedStatusControl & 0xff)
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,#((HalLedStatusControl >> 8) & 0xff)
        MOVX    @DPTR,A
//  278 
//  279   /* Check if sleep is active or not */
//  280   if (!HalLedStatusControl.sleepActive)
        MOV     DPTR,#(HalLedStatusControl + 36)
        MOVX    A,@DPTR
        JZ      $+5
        LJMP    ??HalLedUpdate_0 & 0xFFFF
//  281   {
//  282     while (leds)
//  283     {
//  284       if (leds & led)
??HalLedUpdate_1:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        PUSH    A
        CFI CFA_SP SP+-1
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        POP     A
        CFI CFA_SP SP+0
        MOV     R2,A
        MOVX    A,@DPTR
        ANL     A,R2
        JNZ     $+5
        LJMP    ??HalLedUpdate_2 & 0xFFFF
//  285       {
//  286         if (sts->mode & HAL_LED_MODE_BLINK)
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_5:
        JC      $+5
        LJMP    ??HalLedUpdate_3 & 0xFFFF
//  287         {
//  288           time = osal_GetSystemClock();
        ; Setup parameters for call to function osal_GetSystemClock
        LCALL   ??osal_GetSystemClock?relay
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     ?V0 + 2,R4
        MOV     ?V0 + 3,R5
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
//  289           if (time >= sts->next)
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine1 & 0xFFFF
??CrossCallReturnLabel_2:
        LCALL   ?L_MOV_X
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        MOV     R0,#?V0 + 0
        LCALL   ?UL_GT_X
        MOV     A,#0x1
        JNC     $+5
        LJMP    ??HalLedUpdate_4 & 0xFFFF
//  290           {
//  291             if (sts->mode & HAL_LED_MODE_ON)
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_7:
        MOV     C,0xE0 /* A   */.0
        MOV     A,#0x1
        JNC     ??HalLedUpdate_5
//  292             {
//  293               pct = 100 - sts->onPct;               /* Percentage of cycle for off */
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine6 & 0xFFFF
??CrossCallReturnLabel_15:
        MOV     R2,A
        MOV     A,#0x64
        CLR     C
        SUBB    A,R2
        MOV     ?V0 + 4,A
//  294               sts->mode &= ~HAL_LED_MODE_ON;        /* Say it's not on */
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ??Subroutine7_0 & 0xFFFF
??CrossCallReturnLabel_17:
        CLR     0xE0 /* A   */.0
        MOVX    @DPTR,A
//  295               HalLedOnOff (led, HAL_LED_MODE_OFF);  /* Turn it off */
        ; Setup parameters for call to function HalLedOnOff
        MOV     R2,#0x0
        LCALL   ?Subroutine4 & 0xFFFF
//  296 
//  297               if (!(sts->mode & HAL_LED_MODE_FLASH))
??CrossCallReturnLabel_10:
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_8:
        MOV     C,0xE0 /* A   */.2
        JC      ??CrossCallReturnLabel_11
//  298               {
//  299                 sts->todo--;                        /* Not continuous, reduce count */
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        ADD     A,#0x1
        INC     R0
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,#0x0
        MOV     R1,A
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        DEC     A
        MOVX    @DPTR,A
//  300                 if (!sts->todo)
        JNZ     ??CrossCallReturnLabel_11
//  301                 {
//  302                   sts->mode ^= HAL_LED_MODE_BLINK;  /* No more blinks */
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_9:
        XRL     A,#0x2
        MOVX    @DPTR,A
        SJMP    ??CrossCallReturnLabel_11
//  303                 }
//  304               }
//  305             }
//  306             else
//  307             {
//  308               pct = sts->onPct;                     /* Percentage of cycle for on */
??HalLedUpdate_5:
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine6 & 0xFFFF
??CrossCallReturnLabel_16:
        MOV     ?V0 + 4,A
//  309               sts->mode |= HAL_LED_MODE_ON;         /* Say it's on */
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ??Subroutine7_0 & 0xFFFF
??CrossCallReturnLabel_18:
        SETB    0xE0 /* A   */.0
        MOVX    @DPTR,A
//  310               HalLedOnOff (led, HAL_LED_MODE_ON);   /* Turn it on */
        ; Setup parameters for call to function HalLedOnOff
        MOV     R2,#0x1
        LCALL   ?Subroutine4 & 0xFFFF
//  311             }
//  312 
//  313             if (sts->mode & HAL_LED_MODE_BLINK)
??CrossCallReturnLabel_11:
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_6:
        JNC     ??HalLedUpdate_6
//  314             {
//  315               wait = (((uint32)pct * (uint32)sts->time) / 100);
        MOV     ?V0 + 5,#0x0
        MOV     ?V0 + 6,#0x0
        MOV     ?V0 + 7,#0x0
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine8 & 0xFFFF
??CrossCallReturnLabel_21:
        MOVX    A,@DPTR
        MOV     ?V0 + 0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     ?V0 + 1,A
        MOV     ?V0 + 2,#0x0
        MOV     ?V0 + 3,#0x0
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?L_MUL
        MOV     DPTR,#__Constant_64
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?UL_DIV_MOD
        MOV     R6,?V0 + 4
        MOV     R7,?V0 + 5
//  316               sts->next = time + wait;
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOV     ?V0 + 0,R6
        MOV     ?V0 + 1,R7
        MOV     ?V0 + 2,#0x0
        MOV     ?V0 + 3,#0x0
        MOV     R0,#?V0 + 0
        LCALL   ?L_ADD_X
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine1 & 0xFFFF
??CrossCallReturnLabel_3:
        LCALL   ?L_MOV_TO_X
        SJMP    ??HalLedUpdate_7
//  317             }
//  318             else
//  319             {
//  320               /* no more blink, no more wait */
//  321               wait = 0;
??HalLedUpdate_6:
        MOV     R6,#0x0
        MOV     R7,#0x0
//  322               /* After blinking, set the LED back to the state before it blinks */
//  323               HalLedSet (led, ((preBlinkState & led)!=0)?HAL_LED_MODE_ON:HAL_LED_MODE_OFF);
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     DPTR,#preBlinkState
        MOV     R2,A
        MOVX    A,@DPTR
        ANL     A,R2
        JZ      ??HalLedUpdate_8
        MOV     R2,#0x1
        SJMP    ??HalLedUpdate_9
??HalLedUpdate_8:
        MOV     R2,#0x0
??HalLedUpdate_9:
        ; Setup parameters for call to function HalLedSet
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??HalLedSet?relay
//  324               /* Clear the saved bit */
//  325               preBlinkState &= ~led;
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        CPL     A
        MOV     R2,A
        MOV     DPTR,#preBlinkState
        MOVX    A,@DPTR
        ANL     A,R2
        MOVX    @DPTR,A
        SJMP    ??HalLedUpdate_7
//  326             }
//  327           }
//  328           else
//  329           {
//  330             wait = sts->next - time;  /* Time left */
??HalLedUpdate_4:
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine1 & 0xFFFF
??CrossCallReturnLabel_4:
        LCALL   ?L_MOV_X
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOV     R0,#?V0 + 4
        LCALL   ?L_MOV_X
        MOV     A,?V0 + 0
        CLR     C
        SUBB    A,?V0 + 4
        MOV     R6,A
        MOV     A,?V0 + 1
        SUBB    A,?V0 + 5
        MOV     R7,A
//  331           }
//  332 
//  333           if (!next || ( wait && (wait < next) ))
??HalLedUpdate_7:
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??HalLedUpdate_10
        INC     DPTR
        MOVX    A,@DPTR
??HalLedUpdate_10:
        JZ      ??HalLedUpdate_11
        MOV     A,R6
        JNZ     ??HalLedUpdate_12
        MOV     A,R7
??HalLedUpdate_12:
        JZ      ??HalLedUpdate_3
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R1,A
        CLR     C
        MOV     A,R6
        SUBB    A,R0
        MOV     A,R7
        SUBB    A,R1
        JNC     ??HalLedUpdate_3
//  334           {
//  335             next = wait;
??HalLedUpdate_11:
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R6
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R7
        MOVX    @DPTR,A
//  336           }
//  337         }
//  338         leds ^= led;
??HalLedUpdate_3:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     R2,A
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,R2
        MOVX    @DPTR,A
//  339       }
//  340       led <<= 1;
??HalLedUpdate_2:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        CLR     C
        RLC     A
        MOVX    @DPTR,A
//  341       sts++;
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        ADD     A,#0x9
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,#0x0
        MOV     R1,A
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
//  342     }
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JZ      $+5
        LJMP    ??HalLedUpdate_1 & 0xFFFF
//  343 
//  344     if (next)
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??HalLedUpdate_13
        INC     DPTR
        MOVX    A,@DPTR
??HalLedUpdate_13:
        JZ      ??HalLedUpdate_0
//  345     {
//  346       osal_start_timerEx(Hal_TaskID, HAL_LED_BLINK_EVENT, next);   /* Schedule event */
        ; Setup parameters for call to function osal_start_timerEx
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     R4,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R5,A
        MOV     R2,#0x2
        MOV     R3,#0x0
        MOV     DPTR,#Hal_TaskID
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??osal_start_timerEx?relay
//  347     }
//  348   }
//  349 }
??HalLedUpdate_0:
        MOV     A,#0xa
        LJMP    ?Subroutine10 & 0xFFFF
        CFI EndBlock cfiBlock7

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine6:
        CFI Block cfiCond8 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_15
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 26)
        CFI Block cfiCond9 Using cfiCommon0
        CFI (cfiCond9) NoFunction
        CFI (cfiCond9) Conditional ??CrossCallReturnLabel_16
        CFI (cfiCond9) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond9) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond9) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond9) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond9) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond9) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond9) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond9) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond9) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond9) V7 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, 26)
        CFI Block cfiPicker10 Using cfiCommon1
        CFI (cfiPicker10) NoFunction
        CFI (cfiPicker10) Picker
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R0
        INC     DPTR
        INC     DPTR
        MOVX    A,@DPTR
        RET
        CFI EndBlock cfiCond8
        CFI EndBlock cfiCond9
        CFI EndBlock cfiPicker10

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine4:
        CFI Block cfiCond11 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_10
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 26)
        CFI Block cfiCond12 Using cfiCommon0
        CFI (cfiCond12) NoFunction
        CFI (cfiCond12) Conditional ??CrossCallReturnLabel_11
        CFI (cfiCond12) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond12) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond12) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond12) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond12) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond12) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond12) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond12) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond12) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond12) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond12) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond12) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond12) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond12) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond12) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond12) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond12) CFA_SP SP+0
        CFI (cfiCond12) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker13 Using cfiCommon1
        CFI (cfiPicker13) NoFunction
        CFI (cfiPicker13) Picker
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        CFI Block cfiCond14 Using cfiCommon0
        CFI (cfiCond14) NoFunction
        CFI (cfiCond14) Conditional ??CrossCallReturnLabel_12
        CFI (cfiCond14) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond14) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond14) CFA_SP SP+-5
??Subroutine4_0:
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??HalLedOnOff?relay
        RET
        CFI EndBlock cfiCond11
        CFI EndBlock cfiCond12
        CFI EndBlock cfiPicker13
        CFI EndBlock cfiCond14

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine3:
        CFI Block cfiCond15 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_7
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 26)
        CFI Block cfiCond16 Using cfiCommon0
        CFI (cfiCond16) NoFunction
        CFI (cfiCond16) Conditional ??CrossCallReturnLabel_8
        CFI (cfiCond16) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond16) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond16) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond16) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond16) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond16) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond16) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond16) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond16) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond16) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond16) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond16) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond16) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond16) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond16) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond16) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond16) CFA_SP SP+0
        CFI (cfiCond16) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond17 Using cfiCommon0
        CFI (cfiCond17) NoFunction
        CFI (cfiCond17) Conditional ??CrossCallReturnLabel_9
        CFI (cfiCond17) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond17) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond17) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond17) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond17) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond17) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond17) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond17) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond17) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond17) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond17) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond17) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond17) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond17) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond17) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond17) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond17) CFA_SP SP+0
        CFI (cfiCond17) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker18 Using cfiCommon1
        CFI (cfiPicker18) NoFunction
        CFI (cfiPicker18) Picker
        LCALL   ?Subroutine7 & 0xFFFF
??CrossCallReturnLabel_20:
        RET
        CFI EndBlock cfiCond15
        CFI EndBlock cfiCond16
        CFI EndBlock cfiCond17
        CFI EndBlock cfiPicker18

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine7:
        CFI Block cfiCond19 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_20, ??CrossCallReturnLabel_7
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 26)
        CFI Block cfiCond20 Using cfiCommon0
        CFI (cfiCond20) NoFunction
        CFI (cfiCond20) Conditional ??CrossCallReturnLabel_20, ??CrossCallReturnLabel_8
        CFI (cfiCond20) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond20) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond20) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond20) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond20) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond20) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond20) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond20) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond20) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond20) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond20) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond20) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond20) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond20) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond20) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond20) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond20) CFA_SP SP+0
        CFI (cfiCond20) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond21 Using cfiCommon0
        CFI (cfiCond21) NoFunction
        CFI (cfiCond21) Conditional ??CrossCallReturnLabel_20, ??CrossCallReturnLabel_9
        CFI (cfiCond21) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond21) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond21) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond21) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond21) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond21) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond21) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond21) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond21) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond21) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond21) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond21) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond21) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond21) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond21) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond21) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond21) CFA_SP SP+0
        CFI (cfiCond21) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond22 Using cfiCommon0
        CFI (cfiCond22) NoFunction
        CFI (cfiCond22) Conditional ??CrossCallReturnLabel_19, ??CrossCallReturnLabel_5
        CFI (cfiCond22) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond22) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond22) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond22) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond22) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond22) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond22) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond22) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond22) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond22) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond22) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond22) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond22) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond22) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond22) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond22) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond22) CFA_SP SP+0
        CFI (cfiCond22) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond23 Using cfiCommon0
        CFI (cfiCond23) NoFunction
        CFI (cfiCond23) Conditional ??CrossCallReturnLabel_19, ??CrossCallReturnLabel_6
        CFI (cfiCond23) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond23) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond23) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond23) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond23) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond23) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond23) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond23) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond23) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond23) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond23) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond23) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond23) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond23) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond23) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond23) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond23) CFA_SP SP+0
        CFI (cfiCond23) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker24 Using cfiCommon1
        CFI (cfiPicker24) NoFunction
        CFI (cfiPicker24) Picker
        MOVX    A,@DPTR
        MOV     R0,A
        CFI Block cfiCond25 Using cfiCommon0
        CFI (cfiCond25) NoFunction
        CFI (cfiCond25) Conditional ??CrossCallReturnLabel_17
        CFI (cfiCond25) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond25) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond25) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond25) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond25) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond25) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond25) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond25) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond25) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond25) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond25) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond25) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond25) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond25) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond25) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond25) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond25) CFA_SP SP+0
        CFI (cfiCond25) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond26 Using cfiCommon0
        CFI (cfiCond26) NoFunction
        CFI (cfiCond26) Conditional ??CrossCallReturnLabel_18
        CFI (cfiCond26) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond26) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond26) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond26) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond26) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond26) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond26) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond26) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond26) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond26) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond26) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond26) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond26) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond26) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond26) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond26) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond26) CFA_SP SP+0
        CFI (cfiCond26) CFA_XSP16 add(XSP16, 26)
??Subroutine7_0:
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R0
        MOVX    A,@DPTR
        RET
        CFI EndBlock cfiCond19
        CFI EndBlock cfiCond20
        CFI EndBlock cfiCond21
        CFI EndBlock cfiCond22
        CFI EndBlock cfiCond23
        CFI EndBlock cfiPicker24
        CFI EndBlock cfiCond25
        CFI EndBlock cfiCond26

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiCond27 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_5
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 26)
        CFI Block cfiCond28 Using cfiCommon0
        CFI (cfiCond28) NoFunction
        CFI (cfiCond28) Conditional ??CrossCallReturnLabel_6
        CFI (cfiCond28) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond28) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond28) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond28) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond28) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond28) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond28) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond28) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond28) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond28) V7 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, 26)
        CFI Block cfiPicker29 Using cfiCommon1
        CFI (cfiPicker29) NoFunction
        CFI (cfiPicker29) Picker
        LCALL   ?Subroutine7 & 0xFFFF
??CrossCallReturnLabel_19:
        MOV     C,0xE0 /* A   */.1
        RET
        CFI EndBlock cfiCond27
        CFI EndBlock cfiCond28
        CFI EndBlock cfiPicker29

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiCond30 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_2
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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+-2
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond31 Using cfiCommon0
        CFI (cfiCond31) NoFunction
        CFI (cfiCond31) Conditional ??CrossCallReturnLabel_3
        CFI (cfiCond31) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond31) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond31) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond31) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond31) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond31) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond31) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond31) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond31) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond31) V7 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, 26)
        CFI Block cfiCond32 Using cfiCommon0
        CFI (cfiCond32) NoFunction
        CFI (cfiCond32) Conditional ??CrossCallReturnLabel_4
        CFI (cfiCond32) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond32) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond32) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond32) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond32) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond32) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond32) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond32) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond32) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond32) V7 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, 26)
        CFI Block cfiPicker33 Using cfiCommon1
        CFI (cfiPicker33) NoFunction
        CFI (cfiPicker33) Picker
        MOVX    A,@DPTR
        MOV     R0,A
        LCALL   ?Subroutine8 & 0xFFFF
??CrossCallReturnLabel_22:
        INC     DPTR
        INC     DPTR
        MOV     R0,#?V0 + 0
        RET
        CFI EndBlock cfiCond30
        CFI EndBlock cfiCond31
        CFI EndBlock cfiCond32
        CFI EndBlock cfiPicker33

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine8:
        CFI Block cfiCond34 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_21
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 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, 26)
        CFI Block cfiCond35 Using cfiCommon0
        CFI (cfiCond35) NoFunction
        CFI (cfiCond35) Conditional ??CrossCallReturnLabel_22, ??CrossCallReturnLabel_2
        CFI (cfiCond35) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond35) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond35) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond35) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond35) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond35) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond35) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond35) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond35) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond35) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond35) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond35) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond35) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond35) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond35) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond35) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond35) CFA_SP SP+-2
        CFI (cfiCond35) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond36 Using cfiCommon0
        CFI (cfiCond36) NoFunction
        CFI (cfiCond36) Conditional ??CrossCallReturnLabel_22, ??CrossCallReturnLabel_3
        CFI (cfiCond36) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond36) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond36) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond36) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond36) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond36) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond36) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond36) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond36) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond36) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond36) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond36) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond36) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond36) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond36) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond36) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond36) CFA_SP SP+0
        CFI (cfiCond36) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond37 Using cfiCommon0
        CFI (cfiCond37) NoFunction
        CFI (cfiCond37) Conditional ??CrossCallReturnLabel_22, ??CrossCallReturnLabel_4
        CFI (cfiCond37) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond37) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond37) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond37) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond37) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond37) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond37) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond37) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond37) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond37) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond37) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond37) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond37) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond37) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond37) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond37) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond37) CFA_SP SP+0
        CFI (cfiCond37) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker38 Using cfiCommon1
        CFI (cfiPicker38) NoFunction
        CFI (cfiPicker38) Picker
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R0
        INC     DPTR
        INC     DPTR
        INC     DPTR
        RET
        CFI EndBlock cfiCond34
        CFI EndBlock cfiCond35
        CFI EndBlock cfiCond36
        CFI EndBlock cfiCond37
        CFI EndBlock cfiPicker38
//  350 
//  351 /***************************************************************************************************
//  352  * @fn      HalLedOnOff
//  353  *
//  354  * @brief   Turns specified LED ON or OFF
//  355  *
//  356  * @param   leds - LED bit mask
//  357  *          mode - LED_ON,LED_OFF,
//  358  *
//  359  * @return  none
//  360  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  361 void HalLedOnOff (uint8 leds, uint8 mode)
HalLedOnOff:
        CFI Block cfiBlock39 Using cfiCommon0
        CFI Function HalLedOnOff
//  362 {
        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
//  363   if (leds & HAL_LED_1)
        MOV     A,R1
        MOV     C,0xE0 /* A   */.0
        JNC     ??HalLedOnOff_0
//  364   {
//  365     if (mode == HAL_LED_MODE_ON)
        MOV     A,#0x1
        XRL     A,R2
        JNZ     ??HalLedOnOff_1
//  366     {
//  367       HAL_TURN_ON_LED1();
        CLR     0x90.0
        SJMP    ??HalLedOnOff_0
//  368     }
//  369     else
//  370     {
//  371       HAL_TURN_OFF_LED1();
??HalLedOnOff_1:
        SETB    0x90.0
//  372     }
//  373   }
//  374 
//  375   if (leds & HAL_LED_2)
//  376   {
//  377     if (mode == HAL_LED_MODE_ON)
//  378     {
//  379       HAL_TURN_ON_LED2();
//  380     }
//  381     else
//  382     {
//  383       HAL_TURN_OFF_LED2();
//  384     }
//  385   }
//  386 
//  387   if (leds & HAL_LED_3)
??HalLedOnOff_0:
        MOV     A,R1
        MOV     C,0xE0 /* A   */.2
        JNC     ??HalLedOnOff_2
//  388   {
//  389     if (mode == HAL_LED_MODE_ON)
        MOV     A,#0x1
        XRL     A,R2
        JNZ     ??HalLedOnOff_3
//  390     {
//  391       HAL_TURN_ON_LED3();
        CLR     0x90.0
        SJMP    ??HalLedOnOff_4
//  392     }
//  393     else
//  394     {
//  395       HAL_TURN_OFF_LED3();
??HalLedOnOff_3:
        SETB    0x90.0
//  396     }
//  397   }
//  398 
//  399   if (leds & HAL_LED_4)
//  400   {
//  401     if (mode == HAL_LED_MODE_ON)
//  402     {
//  403       HAL_TURN_ON_LED4();
//  404     }
//  405     else
//  406     {
//  407       HAL_TURN_OFF_LED4();
//  408     }
//  409   }
//  410 
//  411   /* Remember current state */
//  412   if (mode)
??HalLedOnOff_2:
        MOV     A,R2
        JZ      ??HalLedOnOff_5
//  413   {
//  414     HalLedState |= leds;
??HalLedOnOff_4:
        MOV     DPTR,#HalLedState
        MOVX    A,@DPTR
        ORL     A,R1
        SJMP    ??HalLedOnOff_6
//  415   }
//  416   else
//  417   {
//  418     HalLedState &= ~leds;
??HalLedOnOff_5:
        MOV     A,R1
        CPL     A
        MOV     R2,A
        MOV     DPTR,#HalLedState
        MOVX    A,@DPTR
        ANL     A,R2
??HalLedOnOff_6:
        SJMP    ??Subroutine9_0
        CFI EndBlock cfiBlock39
        REQUIRE _A_P1
//  419   }
//  420 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine9:
        CFI Block cfiBlock40 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,#(HalLedStatusControl + 36)
??Subroutine9_0:
        MOVX    @DPTR,A
??Subroutine9_1:
        POP     DPH
        CFI CFA_SP SP+-4
        CFI DPH0 SameValue
        POP     DPL
        CFI CFA_SP SP+-3
        CFI DPL0 SameValue
        LJMP    ?BRET
        CFI EndBlock cfiBlock40
//  421 #endif /* HAL_LED */
//  422 
//  423 /***************************************************************************************************
//  424  * @fn      HalLedEnterSleep
//  425  *
//  426  * @brief   Store current LEDs state before sleep
//  427  *
//  428  * @param   none
//  429  *
//  430  * @return  none
//  431  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  432 void HalLedEnterSleep( void )
HalLedEnterSleep:
        CFI Block cfiBlock41 Using cfiCommon0
        CFI Function HalLedEnterSleep
//  433 {
        FUNCALL HalLedEnterSleep, HalLedOnOff
        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
//  434   /* Sleep ON */
//  435   HalLedStatusControl.sleepActive = TRUE;
        MOV     A,#0x1
        MOV     DPTR,#(HalLedStatusControl + 36)
        LCALL   ?Subroutine0 & 0xFFFF
//  436 
//  437 #if (HAL_LED == TRUE)
//  438   /* Save the state of each led */
//  439   HalSleepLedState = 0;
//  440   HalSleepLedState |= HAL_STATE_LED1();
??CrossCallReturnLabel_0:
        MOV     DPTR,#HalSleepLedState
        LCALL   ?Subroutine0 & 0xFFFF
//  441   HalSleepLedState |= HAL_STATE_LED2() << 1;
//  442   HalSleepLedState |= HAL_STATE_LED3() << 2;
??CrossCallReturnLabel_1:
        RLC     A
        RLC     A
        ANL     A,#0xfc
        MOV     R2,A
        MOVX    A,@DPTR
        ORL     A,R2
        MOVX    @DPTR,A
//  443   HalSleepLedState |= HAL_STATE_LED4() << 3;
//  444 
//  445   /* TURN OFF all LEDs to save power */
//  446   HalLedOnOff (HAL_LED_ALL, HAL_LED_MODE_OFF);
        ; Setup parameters for call to function HalLedOnOff
        MOV     R2,#0x0
        MOV     R1,#0xf
        LCALL   ??HalLedOnOff?relay
//  447 #endif /* HAL_LED */
//  448 
//  449 }
        SJMP    ??Subroutine9_1
        CFI EndBlock cfiBlock41
        REQUIRE _A_P1

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond42 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 cfiCond43 Using cfiCommon0
        CFI (cfiCond43) NoFunction
        CFI (cfiCond43) Conditional ??CrossCallReturnLabel_1
        CFI (cfiCond43) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond43) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond43) CFA_SP SP+-5
        CFI Block cfiPicker44 Using cfiCommon1
        CFI (cfiPicker44) NoFunction
        CFI (cfiPicker44) Picker
        MOVX    @DPTR,A
        MOV     C,0x90.0
        CLR     A
        MOV     0xE0 /* A   */.0,C
        CPL     A
        ANL     A,#0x1
        RET
        CFI EndBlock cfiCond42
        CFI EndBlock cfiCond43
        CFI EndBlock cfiPicker44
//  450 
//  451 /***************************************************************************************************
//  452  * @fn      HalLedExitSleep
//  453  *
//  454  * @brief   Restore current LEDs state after sleep
//  455  *
//  456  * @param   none
//  457  *
//  458  * @return  none
//  459  ***************************************************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  460 void HalLedExitSleep( void )
HalLedExitSleep:
        CFI Block cfiBlock45 Using cfiCommon0
        CFI Function HalLedExitSleep
//  461 {
        FUNCALL HalLedExitSleep, HalLedOnOff
        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 HalLedExitSleep, HalLedUpdate
        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
//  462 #if (HAL_LED == TRUE)
//  463   /* Load back the saved state */
//  464   HalLedOnOff(HalSleepLedState, HAL_LED_MODE_ON);
        ; Setup parameters for call to function HalLedOnOff
        MOV     R2,#0x1
        MOV     DPTR,#HalSleepLedState
        LCALL   ??Subroutine4_0 & 0xFFFF
//  465 
//  466   /* Restart - This takes care BLINKING LEDS */
//  467   HalLedUpdate();
??CrossCallReturnLabel_12:
        ; Setup parameters for call to function HalLedUpdate
        LCALL   ??HalLedUpdate?relay
//  468 #endif /* HAL_LED */
//  469 
//  470   /* Sleep OFF */
//  471   HalLedStatusControl.sleepActive = FALSE;
        SJMP    ?Subroutine9
        CFI EndBlock cfiBlock45
//  472 }

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
__Constant_64:
        DS 4
        REQUIRE `?<Initializer for __Constant_64>`
        REQUIRE __INIT_XDATA_I

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for __Constant_64>`:
        DD 100

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

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

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

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

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

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

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

        END
//  473 
//  474 /***************************************************************************************************
//  475 ***************************************************************************************************/
//  476 
//  477 
//  478 
//  479 
// 
// 1 217 bytes in segment BANKED_CODE
//    42 bytes in segment BANK_RELAYS
//     1 byte  in segment SFR_AN
//     4 bytes in segment XDATA_I
//     4 bytes in segment XDATA_ID
//    40 bytes in segment XDATA_Z
// 
// 1 259 bytes of CODE  memory (+ 4 bytes shared)
//     0 bytes of DATA  memory (+ 1 byte  shared)
//    40 bytes of XDATA memory (+ 4 bytes shared)
//
//Errors: none
//Warnings: none
