///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   12/Sep/2010  21:57:27 /
// 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\osal\common\OSAL_Timers.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\osal\common\OSAL_Timers.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\ /
//                          OSAL_Timers.s51                                   /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME OSAL_Timers

        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 ??osalAddTimer?relay
        EXTERN ??osalDeleteTimer?relay
        EXTERN ??osalFindTimer?relay
        EXTERN ??osalTimerUpdate?relay
        EXTERN ??osal_next_timeout?relay
        EXTERN ??osal_retune_timers?relay
        EXTERN ??osal_set_timer_interrupt?relay
        EXTERN ??osal_timer_activate?relay
        EXTERN ??osal_timer_hw_setup?relay
        EXTERN ??osal_timer_num_active?relay
        EXTERN ?ALLOC_XSTACK8
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN ?DEALLOC_XSTACK8
        EXTERN ?L_ADD_TO_X
        EXTERN ?L_MOV_TO_X
        EXTERN ?L_MOV_X
        EXTERN ?L_MUL
        EXTERN ?V0
        EXTERN ?XSP
        EXTERN __INIT_XDATA_I
        EXTERN __INIT_XDATA_Z

        PUBLIC ??osalAddTimer?relay
        FUNCTION ??osalAddTimer?relay,0203H
        PUBLIC ??osalDeleteTimer?relay
        FUNCTION ??osalDeleteTimer?relay,0203H
        PUBLIC ??osalFindTimer?relay
        FUNCTION ??osalFindTimer?relay,0203H
        PUBLIC ??osalTimerInit?relay
        FUNCTION ??osalTimerInit?relay,0203H
        FUNCTION ??osalTimerUpdate?relay,0203H
        PUBLIC ??osal_GetSystemClock?relay
        FUNCTION ??osal_GetSystemClock?relay,0203H
        PUBLIC ??osal_adjust_timers?relay
        FUNCTION ??osal_adjust_timers?relay,0203H
        PUBLIC ??osal_get_timeoutEx?relay
        FUNCTION ??osal_get_timeoutEx?relay,0203H
        PUBLIC ??osal_next_timeout?relay
        FUNCTION ??osal_next_timeout?relay,0203H
        PUBLIC ??osal_retune_timers?relay
        FUNCTION ??osal_retune_timers?relay,0203H
        PUBLIC ??osal_set_timer_interrupt?relay
        FUNCTION ??osal_set_timer_interrupt?relay,0203H
        PUBLIC ??osal_sleep_timers?relay
        FUNCTION ??osal_sleep_timers?relay,0203H
        PUBLIC ??osal_start_timerEx?relay
        FUNCTION ??osal_start_timerEx?relay,0203H
        PUBLIC ??osal_stop_timerEx?relay
        FUNCTION ??osal_stop_timerEx?relay,0203H
        PUBLIC ??osal_timer_activate?relay
        FUNCTION ??osal_timer_activate?relay,0203H
        PUBLIC ??osal_timer_hw_setup?relay
        FUNCTION ??osal_timer_hw_setup?relay,0203H
        PUBLIC ??osal_timer_num_active?relay
        FUNCTION ??osal_timer_num_active?relay,0203H
        PUBLIC ??osal_unsleep_timers?relay
        FUNCTION ??osal_unsleep_timers?relay,0203H
        PUBLIC ??osal_update_timers?relay
        FUNCTION ??osal_update_timers?relay,0203H
        PUBWEAK _A_IEN0
        PUBWEAK __Constant_0
        PUBWEAK __Constant_3e8
        PUBLIC osalAddTimer
        FUNCTION osalAddTimer,021203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 14, STACK
        PUBLIC osalDeleteTimer
        FUNCTION osalDeleteTimer,021203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 9, STACK
        PUBLIC osalFindTimer
        FUNCTION osalFindTimer,0203H
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 9, STACK
        PUBLIC osalTimerInit
        FUNCTION osalTimerInit,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        FUNCTION osalTimerUpdate,021203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 17, STACK
        PUBLIC osal_GetSystemClock
        FUNCTION osal_GetSystemClock,0203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC osal_adjust_timers
        FUNCTION osal_adjust_timers,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC osal_get_timeoutEx
        FUNCTION osal_get_timeoutEx,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC osal_next_timeout
        FUNCTION osal_next_timeout,0203H
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC osal_retune_timers
        FUNCTION osal_retune_timers,021203H
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 16, STACK
        PUBLIC osal_set_timer_interrupt
        FUNCTION osal_set_timer_interrupt,021203H
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC osal_sleep_timers
        FUNCTION osal_sleep_timers,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC osal_start_timerEx
        FUNCTION osal_start_timerEx,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC osal_stop_timerEx
        FUNCTION osal_stop_timerEx,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC osal_timer_activate
        FUNCTION osal_timer_activate,021203H
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 9, STACK
        PUBLIC osal_timer_hw_setup
        FUNCTION osal_timer_hw_setup,021203H
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 12, STACK
        PUBLIC osal_timer_num_active
        FUNCTION osal_timer_num_active,0203H
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC osal_unsleep_timers
        FUNCTION osal_unsleep_timers,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC osal_update_timers
        FUNCTION osal_update_timers,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC timerActive
        PUBLIC timerHead
        PUBLIC tmr_count
        PUBLIC tmr_decr_time
        
        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_mem_alloc      SYMBOL "osal_mem_alloc"
osal_mem_free       SYMBOL "osal_mem_free"
HalTimerStart       SYMBOL "HalTimerStart"
HalTimerStop        SYMBOL "HalTimerStop"
HalTimerInterruptEnable SYMBOL "HalTimerInterruptEnable"
osal_set_event      SYMBOL "osal_set_event"
TimerElapsed        SYMBOL "TimerElapsed"
??HalTimerInterruptEnable?relay SYMBOL "?relay", HalTimerInterruptEnable
??HalTimerStart?relay SYMBOL "?relay", HalTimerStart
??HalTimerStop?relay SYMBOL "?relay", HalTimerStop
??TimerElapsed?relay SYMBOL "?relay", TimerElapsed
??osal_mem_alloc?relay SYMBOL "?relay", osal_mem_alloc
??osal_mem_free?relay SYMBOL "?relay", osal_mem_free
??osal_set_event?relay SYMBOL "?relay", osal_set_event
osalAddTimer        SYMBOL "osalAddTimer"
??osalAddTimer?relay SYMBOL "?relay", osalAddTimer
osalDeleteTimer     SYMBOL "osalDeleteTimer"
??osalDeleteTimer?relay SYMBOL "?relay", osalDeleteTimer
osalFindTimer       SYMBOL "osalFindTimer"
??osalFindTimer?relay SYMBOL "?relay", osalFindTimer
osalTimerInit       SYMBOL "osalTimerInit"
??osalTimerInit?relay SYMBOL "?relay", osalTimerInit
osal_GetSystemClock SYMBOL "osal_GetSystemClock"
??osal_GetSystemClock?relay SYMBOL "?relay", osal_GetSystemClock
osal_adjust_timers  SYMBOL "osal_adjust_timers"
??osal_adjust_timers?relay SYMBOL "?relay", osal_adjust_timers
osal_get_timeoutEx  SYMBOL "osal_get_timeoutEx"
??osal_get_timeoutEx?relay SYMBOL "?relay", osal_get_timeoutEx
osal_next_timeout   SYMBOL "osal_next_timeout"
??osal_next_timeout?relay SYMBOL "?relay", osal_next_timeout
osal_retune_timers  SYMBOL "osal_retune_timers"
??osal_retune_timers?relay SYMBOL "?relay", osal_retune_timers
osal_set_timer_interrupt SYMBOL "osal_set_timer_interrupt"
??osal_set_timer_interrupt?relay SYMBOL "?relay", osal_set_timer_interrupt
osal_sleep_timers   SYMBOL "osal_sleep_timers"
??osal_sleep_timers?relay SYMBOL "?relay", osal_sleep_timers
osal_start_timerEx  SYMBOL "osal_start_timerEx"
??osal_start_timerEx?relay SYMBOL "?relay", osal_start_timerEx
osal_stop_timerEx   SYMBOL "osal_stop_timerEx"
??osal_stop_timerEx?relay SYMBOL "?relay", osal_stop_timerEx
osal_timer_activate SYMBOL "osal_timer_activate"
??osal_timer_activate?relay SYMBOL "?relay", osal_timer_activate
osal_timer_hw_setup SYMBOL "osal_timer_hw_setup"
??osal_timer_hw_setup?relay SYMBOL "?relay", osal_timer_hw_setup
osal_timer_num_active SYMBOL "osal_timer_num_active"
??osal_timer_num_active?relay SYMBOL "?relay", osal_timer_num_active
osal_unsleep_timers SYMBOL "osal_unsleep_timers"
??osal_unsleep_timers?relay SYMBOL "?relay", osal_unsleep_timers
osal_update_timers  SYMBOL "osal_update_timers"
??osal_update_timers?relay SYMBOL "?relay", osal_update_timers

        EXTERN osal_mem_alloc
        FUNCTION osal_mem_alloc,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN osal_mem_free
        FUNCTION osal_mem_free,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN HalTimerStart
        FUNCTION HalTimerStart,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN HalTimerStop
        FUNCTION HalTimerStop,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN HalTimerInterruptEnable
        FUNCTION HalTimerInterruptEnable,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, 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, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN TimerElapsed
        FUNCTION TimerElapsed,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN ??HalTimerInterruptEnable?relay
        FUNCTION ??HalTimerInterruptEnable?relay,00H
        EXTERN ??HalTimerStart?relay
        FUNCTION ??HalTimerStart?relay,00H
        EXTERN ??HalTimerStop?relay
        FUNCTION ??HalTimerStop?relay,00H
        EXTERN ??TimerElapsed?relay
        FUNCTION ??TimerElapsed?relay,00H
        EXTERN ??osal_mem_alloc?relay
        FUNCTION ??osal_mem_alloc?relay,00H
        EXTERN ??osal_mem_free?relay
        FUNCTION ??osal_mem_free?relay,00H
        EXTERN ??osal_set_event?relay
        FUNCTION ??osal_set_event?relay,00H

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

        ASEGN SFR_AN:DATA:NOROOT,0a8H
// union <unnamed> volatile __sfr _A_IEN0
_A_IEN0:
        DS 1
//   46 #include "OSAL.h"
//   47 #include "OSAL_Timers.h"
//   48 #include "hal_timer.h"
//   49 
//   50 /*********************************************************************
//   51  * MACROS
//   52  */
//   53 
//   54 /*********************************************************************
//   55  * CONSTANTS
//   56  */
//   57 
//   58 /*********************************************************************
//   59  * TYPEDEFS
//   60  */
//   61 
//   62 typedef struct
//   63 {
//   64   void *next;
//   65   UINT16 timeout;
//   66   UINT16 event_flag;
//   67   byte task_id;
//   68 } osalTimerRec_t;
//   69 
//   70 /*********************************************************************
//   71  * GLOBAL VARIABLES
//   72  */
//   73 

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   74 osalTimerRec_t *timerHead;
timerHead:
        DS 2
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   75 uint32 tmr_count;          // Amount of time per tick - in micro-sec
tmr_count:
        DS 4
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   76 uint16 tmr_decr_time;      // Decr_Time for system timer
tmr_decr_time:
        DS 2
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   77 byte timerActive;          // Flag if hw timer active
timerActive:
        DS 1
        REQUIRE __INIT_XDATA_Z
//   78 
//   79 /*********************************************************************
//   80  * EXTERNAL VARIABLES
//   81  */
//   82 
//   83 /*********************************************************************
//   84  * EXTERNAL FUNCTIONS
//   85  */
//   86 
//   87 /*********************************************************************
//   88  * LOCAL VARIABLES
//   89  */
//   90 // Milliseconds since last reboot

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   91 static uint32 osal_systemClock;
osal_systemClock:
        DS 4
        REQUIRE __INIT_XDATA_Z
//   92 
//   93 /*********************************************************************
//   94  * LOCAL FUNCTION PROTOTYPES
//   95  */
//   96 osalTimerRec_t  *osalAddTimer( byte task_id, UINT16 event_flag, UINT16 timeout );
//   97 osalTimerRec_t *osalFindTimer( byte task_id, uint16 event_flag );
//   98 void osalDeleteTimer( osalTimerRec_t *rmTimer );
//   99 static void osalTimerUpdate( uint16 time );
//  100 
//  101 void osal_timer_activate( byte turn_on );
//  102 void osal_timer_hw_setup( byte turn_on );
//  103 void osal_set_timer_interrupt( byte turn_on );
//  104 void osal_retune_timers( void );
//  105 
//  106 /*********************************************************************
//  107  * FUNCTIONS
//  108  *********************************************************************/
//  109 
//  110 /*********************************************************************
//  111  * @fn      osalTimerInit
//  112  *
//  113  * @brief   Initialization for the OSAL Timer System.
//  114  *
//  115  * @param   none
//  116  *
//  117  * @return
//  118  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  119 void osalTimerInit( void )
osalTimerInit:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function osalTimerInit
//  120 {
        FUNCALL osalTimerInit, osal_timer_activate
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  121   // Initialize the rollover modulo
//  122   tmr_count = TICK_TIME;
        MOV     DPTR,#__Constant_3e8
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     DPTR,#tmr_count
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
//  123   tmr_decr_time = TIMER_DECR_TIME;
        MOV     DPTR,#tmr_decr_time
        MOV     A,#0x1
        MOVX    @DPTR,A
        INC     DPTR
        CLR     A
        MOVX    @DPTR,A
//  124 
//  125   // Initialize the system timer
//  126   osal_timer_activate( false );
        ; Setup parameters for call to function osal_timer_activate
        MOV     R1,A
        LCALL   ??osal_timer_activate?relay
//  127   timerActive = false;
        CLR     A
        MOV     DPTR,#timerActive
        MOVX    @DPTR,A
//  128 
//  129   osal_systemClock = 0;
        MOV     DPTR,#__Constant_0
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     DPTR,#osal_systemClock
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
//  130 }
        LJMP    ?Subroutine4 & 0xFFFF
        CFI EndBlock cfiBlock0
//  131 
//  132 /*********************************************************************
//  133  * @fn      osalAddTimer
//  134  *
//  135  * @brief   Add a timer to the timer list.
//  136  *          Ints must be disabled.
//  137  *
//  138  * @param   task_id
//  139  * @param   event_flag
//  140  * @param   timeout
//  141  *
//  142  * @return  osalTimerRec_t * - pointer to newly created timer
//  143  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  144 osalTimerRec_t * osalAddTimer( byte task_id, UINT16 event_flag, UINT16 timeout )
osalAddTimer:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function osalAddTimer
//  145 {
        FUNCALL osalAddTimer, osalFindTimer
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osalAddTimer, osal_mem_alloc
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xe
        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 V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 14)
        ; Saved register size: 14
        ; Auto size: 0
        MOV     ?V0 + 2,R1
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     A,R4
        MOV     R6,A
        MOV     A,R5
        MOV     R7,A
//  146   osalTimerRec_t *newTimer;
//  147   osalTimerRec_t *srchTimer;
//  148 
//  149   // Look for an existing timer first
//  150   newTimer = osalFindTimer( task_id, event_flag );
        ; Setup parameters for call to function osalFindTimer
        LCALL   ??osalFindTimer?relay
//  151   if ( newTimer )
        MOV     A,R2
        JNZ     ??osalAddTimer_0
        MOV     A,R3
??osalAddTimer_0:
        JZ      ??osalAddTimer_1
//  152   {
//  153     // Timer is found - update it.
//  154     newTimer->timeout = timeout;
        MOV     DPL,R2
        MOV     DPH,R3
        INC     DPTR
        INC     DPTR
        MOV     A,R6
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R7
??osalAddTimer_2:
        MOVX    @DPTR,A
        SJMP    ??osalAddTimer_3
//  155 
//  156     return ( newTimer );
//  157   }
//  158   else
//  159   {
//  160     // New Timer
//  161     newTimer = osal_mem_alloc( sizeof( osalTimerRec_t ) );
??osalAddTimer_1:
        ; Setup parameters for call to function osal_mem_alloc
        MOV     R2,#0x7
        MOV     R3,#0x0
        LCALL   ??osal_mem_alloc?relay
//  162 
//  163     if ( newTimer )
        MOV     A,R2
        JNZ     ??osalAddTimer_4
        MOV     A,R3
??osalAddTimer_4:
        JZ      ??osalAddTimer_5
//  164     {
//  165       // Fill in new timer
//  166       newTimer->task_id = task_id;
        MOV     DPL,R2
        MOV     DPH,R3
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOV     A,?V0 + 2
        MOVX    @DPTR,A
//  167       newTimer->event_flag = event_flag;
        MOV     DPL,R2
        MOV     DPH,R3
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOV     A,?V0 + 0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,?V0 + 1
        MOVX    @DPTR,A
//  168       newTimer->timeout = timeout;
        MOV     DPL,R2
        MOV     DPH,R3
        INC     DPTR
        INC     DPTR
        MOV     A,R6
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R7
        MOVX    @DPTR,A
//  169       newTimer->next = (void *)NULL;
        MOV     DPL,R2
        MOV     DPH,R3
        CLR     A
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    @DPTR,A
//  170 
//  171       // Does the timer list already exist
//  172       if ( timerHead == NULL )
        MOV     DPTR,#timerHead
        MOVX    A,@DPTR
        JNZ     ??osalAddTimer_6
        INC     DPTR
        MOVX    A,@DPTR
??osalAddTimer_6:
        MOV     DPTR,#timerHead
??osalAddTimer_7:
        JNZ     ??osalAddTimer_8
//  173       {
//  174         // Start task list
//  175         timerHead = newTimer;
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        SJMP    ??osalAddTimer_2
//  176       }
//  177       else
//  178       {
//  179         // Add it to the end of the timer list
//  180         srchTimer = timerHead;
//  181 
//  182         // Stop at the last record
//  183         while ( srchTimer->next )
//  184           srchTimer = srchTimer->next;
??osalAddTimer_8:
        LCALL   ??Subroutine3_0 & 0xFFFF
??CrossCallReturnLabel_10:
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        JNZ     ??osalAddTimer_9
        INC     DPTR
        MOVX    A,@DPTR
??osalAddTimer_9:
        MOV     DPL,R0
        MOV     DPH,R1
        SJMP    ??osalAddTimer_7
//  185 
//  186         // Add to the list
//  187         srchTimer->next = newTimer;
//  188       }
//  189 
//  190       return ( newTimer );
//  191     }
//  192     else
//  193       return ( (osalTimerRec_t *)NULL );
??osalAddTimer_5:
        MOV     R2,#0x0
        MOV     R3,#0x0
??osalAddTimer_3:
        MOV     R7,#0x6
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock1
//  194   }
//  195 }
//  196 
//  197 /*********************************************************************
//  198  * @fn      osalFindTimer
//  199  *
//  200  * @brief   Find a timer in a timer list.
//  201  *          Ints must be disabled.
//  202  *
//  203  * @param   task_id
//  204  * @param   event_flag
//  205  *
//  206  * @return  osalTimerRec_t *
//  207  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  208 osalTimerRec_t *osalFindTimer( byte task_id, uint16 event_flag )
osalFindTimer:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function osalFindTimer
//  209 {
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
//  210   osalTimerRec_t *srchTimer;
//  211 
//  212   // Head of the timer list
//  213   srchTimer = timerHead;
        MOV     DPTR,#timerHead
        SJMP    ??osalFindTimer_0
//  214 
//  215   // Stop when found or at the end
//  216   while ( srchTimer )
//  217   {
//  218     if ( srchTimer->event_flag == event_flag &&
//  219          srchTimer->task_id == task_id )
//  220       break;
//  221 
//  222     // Not this one, check another
//  223     srchTimer = srchTimer->next;
??osalFindTimer_1:
        MOV     DPL,R4
        MOV     DPH,R5
??osalFindTimer_0:
        LCALL   ??Subroutine0_0 & 0xFFFF
??CrossCallReturnLabel_0:
        MOV     A,R4
        JNZ     ??osalFindTimer_2
        MOV     A,R5
??osalFindTimer_2:
        JZ      ??osalFindTimer_3
        MOV     DPL,R4
        MOV     DPH,R5
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R2
        JNZ     ??osalFindTimer_4
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R3
??osalFindTimer_4:
        JNZ     ??osalFindTimer_1
        MOV     DPL,R4
        MOV     DPH,R5
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
        JNZ     ??osalFindTimer_1
//  224   }
//  225 
//  226   return ( srchTimer );
??osalFindTimer_3:
        MOV     A,R4
        MOV     R2,A
        MOV     A,R5
        MOV     R3,A
        CFI EndBlock cfiBlock2
        REQUIRE ?Subroutine5
        ; // Fall through to label ?Subroutine5
//  227 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine5:
        CFI Block cfiBlock3 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x1
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock3
//  228 
//  229 /*********************************************************************
//  230  * @fn      osalDeleteTimer
//  231  *
//  232  * @brief   Delete a timer from a timer list.
//  233  *          Ints must be disabled.
//  234  *
//  235  * @param   table
//  236  * @param   rmTimer
//  237  *
//  238  * @return  none
//  239  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  240 void osalDeleteTimer( osalTimerRec_t *rmTimer )
osalDeleteTimer:
        CFI Block cfiBlock4 Using cfiCommon0
        CFI Function osalDeleteTimer
//  241 {
        FUNCALL osalDeleteTimer, osal_mem_free
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osalDeleteTimer, osal_mem_free
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
//  242   osalTimerRec_t *srchTimer;
//  243 
//  244   // Does the timer list really exist
//  245   if ( (timerHead != NULL) && rmTimer )
        MOV     DPTR,#timerHead
        MOVX    A,@DPTR
        JNZ     ??osalDeleteTimer_0
        INC     DPTR
        MOVX    A,@DPTR
??osalDeleteTimer_0:
        JZ      ??osalDeleteTimer_1
        MOV     A,R2
        JNZ     ??osalDeleteTimer_2
        MOV     A,R3
??osalDeleteTimer_2:
        JZ      ??osalDeleteTimer_1
//  246   {
//  247     // Add it to the end of the timer list
//  248     srchTimer = timerHead;
        MOV     DPTR,#timerHead
        LCALL   ??Subroutine3_0 & 0xFFFF
//  249 
//  250     // First element?
//  251     if ( srchTimer == rmTimer )
??CrossCallReturnLabel_11:
        MOV     A,R2
        XRL     A,R0
        JNZ     ??osalDeleteTimer_3
        MOV     A,R3
        XRL     A,R1
??osalDeleteTimer_3:
        JNZ     ??CrossCallReturnLabel_12
//  252     {
//  253       timerHead = rmTimer->next;
        MOV     DPL,R2
        MOV     DPH,R3
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_8:
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        SJMP    ??osalDeleteTimer_4
//  254       osal_mem_free( rmTimer );
//  255     }
//  256     else
//  257     {
//  258       // Stop when found or at the end
//  259       while ( srchTimer->next && srchTimer->next != rmTimer )
//  260         srchTimer = srchTimer->next;
??osalDeleteTimer_5:
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_12:
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        JNZ     ??osalDeleteTimer_6
        INC     DPTR
        MOVX    A,@DPTR
??osalDeleteTimer_6:
        JZ      ??osalDeleteTimer_7
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_1:
        MOV     A,R2
        XRL     A,R4
        JNZ     ??osalDeleteTimer_8
        MOV     A,R3
        XRL     A,R5
??osalDeleteTimer_8:
        JNZ     ??osalDeleteTimer_5
//  261 
//  262       // Found?
//  263       if ( srchTimer->next == rmTimer )
??osalDeleteTimer_7:
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_2:
        MOV     A,R2
        XRL     A,R4
        JNZ     ??osalDeleteTimer_9
        MOV     A,R3
        XRL     A,R5
??osalDeleteTimer_9:
        JNZ     ??osalDeleteTimer_1
//  264       {
//  265         // Fix pointers
//  266         srchTimer->next = rmTimer->next;
        MOV     DPL,R2
        MOV     DPH,R3
        LCALL   ??Subroutine0_0 & 0xFFFF
??CrossCallReturnLabel_3:
        MOV     DPL,R0
        MOV     DPH,R1
        MOV     A,R4
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R5
??osalDeleteTimer_4:
        MOVX    @DPTR,A
//  267 
//  268         // Deallocate the timer struct memory
//  269         osal_mem_free( rmTimer );
        ; Setup parameters for call to function osal_mem_free
        LCALL   ??osal_mem_free?relay
//  270       }
//  271     }
//  272   }
//  273 }
??osalDeleteTimer_1:
        SJMP    ?Subroutine5
        CFI EndBlock cfiBlock4

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond5 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_1
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond6 Using cfiCommon0
        CFI (cfiCond6) NoFunction
        CFI (cfiCond6) Conditional ??CrossCallReturnLabel_2
        CFI (cfiCond6) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond6) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond6) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond6) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond6) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond6) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond6) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond6) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond6) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond6) CFA_SP SP+0
        CFI (cfiCond6) CFA_XSP16 add(XSP16, 9)
        CFI Block cfiPicker7 Using cfiCommon1
        CFI (cfiPicker7) NoFunction
        CFI (cfiPicker7) Picker
        MOV     DPL,R0
        MOV     DPH,R1
        CFI Block cfiCond8 Using cfiCommon0
        CFI (cfiCond8) NoFunction
        CFI (cfiCond8) Conditional ??CrossCallReturnLabel_0
        CFI (cfiCond8) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond8) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond8) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond8) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond8) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond8) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond8) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond8) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond8) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond8) CFA_SP SP+0
        CFI (cfiCond8) CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond9 Using cfiCommon0
        CFI (cfiCond9) NoFunction
        CFI (cfiCond9) Conditional ??CrossCallReturnLabel_3
        CFI (cfiCond9) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond9) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond9) V0 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, 9)
??Subroutine0_0:
        MOVX    A,@DPTR
        MOV     R4,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R5,A
        RET
        CFI EndBlock cfiCond5
        CFI EndBlock cfiCond6
        CFI EndBlock cfiPicker7
        CFI EndBlock cfiCond8
        CFI EndBlock cfiCond9
//  274 
//  275 /*********************************************************************
//  276  * @fn      osal_start_timerEx
//  277  *
//  278  * @brief
//  279  *
//  280  *   This function is called to start a timer to expire in n mSecs.
//  281  *   When the timer expires, the calling task will get the specified event.
//  282  *
//  283  * @param   byte taskID - task id to set timer for
//  284  * @param   UINT16 event_id - event to be notified with
//  285  * @param   UNINT16 timeout_value - in milliseconds.
//  286  *
//  287  * @return  ZSUCCESS, or NO_TIMER_AVAIL.
//  288  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  289 byte osal_start_timerEx( byte taskID, UINT16 event_id, UINT16 timeout_value )
osal_start_timerEx:
        CFI Block cfiBlock10 Using cfiCommon0
        CFI Function osal_start_timerEx
//  290 {
        FUNCALL osal_start_timerEx, osalAddTimer
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_start_timerEx, osal_retune_timers
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_start_timerEx, osal_timer_activate
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  291   halIntState_t intState;
//  292   osalTimerRec_t *newTimer;
//  293 
//  294   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     ?V0 + 0,A
        CLR     0xa8.7
//  295 
//  296   // Add timer
//  297   newTimer = osalAddTimer( taskID, event_id, timeout_value );
        ; Setup parameters for call to function osalAddTimer
        LCALL   ??osalAddTimer?relay
        MOV     ?V0 + 2,R2
        MOV     ?V0 + 3,R3
        MOV     R6,?V0 + 2
        MOV     R7,?V0 + 3
//  298   if ( newTimer )
        MOV     A,R6
        JNZ     ??osal_start_timerEx_0
        MOV     A,R7
??osal_start_timerEx_0:
        JZ      ??osal_start_timerEx_1
//  299   {
//  300 #ifdef POWER_SAVING
//  301     // Update timer registers
//  302     osal_retune_timers();
        ; Setup parameters for call to function osal_retune_timers
        LCALL   ??osal_retune_timers?relay
//  303     (void)timerActive;
//  304 #endif
//  305     // Does the timer need to be started?
//  306     if ( timerActive == FALSE )
        MOV     DPTR,#timerActive
        MOVX    A,@DPTR
        JNZ     ??osal_start_timerEx_1
//  307     {
//  308       osal_timer_activate( TRUE );
        ; Setup parameters for call to function osal_timer_activate
        MOV     R1,#0x1
        LCALL   ??osal_timer_activate?relay
//  309     }
//  310   }
//  311 
//  312   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
??osal_start_timerEx_1:
        MOV     A,?V0 + 0
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  313 
//  314   return ( (newTimer != NULL) ? ZSUCCESS : NO_TIMER_AVAIL );
        MOV     A,R6
        JNZ     ??osal_start_timerEx_2
        MOV     A,R7
??osal_start_timerEx_2:
        JZ      ??osal_start_timerEx_3
        MOV     R1,#0x0
        SJMP    ??osal_start_timerEx_4
??osal_start_timerEx_3:
        MOV     R1,#0xc
??osal_start_timerEx_4:
        SJMP    ?Subroutine4
        CFI EndBlock cfiBlock10
        REQUIRE _A_IEN0
//  315 }
//  316 
//  317 /*********************************************************************
//  318  * @fn      osal_stop_timerEx
//  319  *
//  320  * @brief
//  321  *
//  322  *   This function is called to stop a timer that has already been started.
//  323  *   If ZSUCCESS, the function will cancel the timer and prevent the event
//  324  *   associated with the timer from being set for the calling task.
//  325  *
//  326  * @param   byte task_id - task id of timer to stop
//  327  * @param   UINT16 event_id - identifier of the timer that is to be stopped
//  328  *
//  329  * @return  ZSUCCESS or INVALID_EVENT_ID
//  330  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  331 byte osal_stop_timerEx( byte task_id, UINT16 event_id )
osal_stop_timerEx:
        CFI Block cfiBlock11 Using cfiCommon0
        CFI Function osal_stop_timerEx
//  332 {
        FUNCALL osal_stop_timerEx, osalFindTimer
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_stop_timerEx, osalDeleteTimer
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_stop_timerEx, osal_retune_timers
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  333   halIntState_t intState;
//  334   osalTimerRec_t *foundTimer;
//  335 
//  336   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     ?V0 + 0,A
        CLR     0xa8.7
//  337 
//  338   // Find the timer to stop
//  339   foundTimer = osalFindTimer( task_id, event_id );
        ; Setup parameters for call to function osalFindTimer
        LCALL   ??osalFindTimer?relay
        MOV     ?V0 + 2,R2
        MOV     ?V0 + 3,R3
        MOV     R6,?V0 + 2
        MOV     R7,?V0 + 3
//  340   if ( foundTimer )
        MOV     A,R6
        JNZ     ??osal_stop_timerEx_0
        MOV     A,R7
??osal_stop_timerEx_0:
        JZ      ??osal_stop_timerEx_1
//  341   {
//  342     osalDeleteTimer( foundTimer );
        ; Setup parameters for call to function osalDeleteTimer
        LCALL   ??osalDeleteTimer?relay
//  343 
//  344 #ifdef POWER_SAVING
//  345     osal_retune_timers();
        ; Setup parameters for call to function osal_retune_timers
        LCALL   ??osal_retune_timers?relay
//  346 #endif
//  347   }
//  348 
//  349   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
??osal_stop_timerEx_1:
        MOV     A,?V0 + 0
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  350 
//  351   return ( (foundTimer != NULL) ? ZSUCCESS : INVALID_EVENT_ID );
        MOV     A,R6
        JNZ     ??osal_stop_timerEx_2
        MOV     A,R7
??osal_stop_timerEx_2:
        JZ      ??osal_stop_timerEx_3
        MOV     R1,#0x0
        SJMP    ??osal_stop_timerEx_4
??osal_stop_timerEx_3:
        MOV     R1,#0x7
??osal_stop_timerEx_4:
        SJMP    ?Subroutine4
        CFI EndBlock cfiBlock11
        REQUIRE _A_IEN0
//  352 }
//  353 
//  354 /*********************************************************************
//  355  * @fn      osal_get_timeoutEx
//  356  *
//  357  * @brief
//  358  *
//  359  * @param   byte task_id - task id of timer to check
//  360  * @param   UINT16 event_id - identifier of timer to be checked
//  361  *
//  362  * @return  Return the timer's tick count if found, zero otherwise.
//  363  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  364 UINT16 osal_get_timeoutEx( byte task_id, UINT16 event_id )
osal_get_timeoutEx:
        CFI Block cfiBlock12 Using cfiCommon0
        CFI Function osal_get_timeoutEx
//  365 {
        FUNCALL osal_get_timeoutEx, osalFindTimer
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  366   halIntState_t intState;
//  367   uint16 rtrn = 0;
        MOV     R6,#0x0
        MOV     R7,#0x0
//  368   osalTimerRec_t *tmr;
//  369 
//  370   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     ?V0 + 0,A
        CLR     0xa8.7
//  371 
//  372   tmr = osalFindTimer( task_id, event_id );
        ; Setup parameters for call to function osalFindTimer
        LCALL   ??osalFindTimer?relay
        MOV     DPL,R2
        MOV     DPH,R3
//  373 
//  374   if ( tmr )
        MOV     A,DPL
        JNZ     ??osal_get_timeoutEx_0
        MOV     A,DPH
??osal_get_timeoutEx_0:
        JZ      ??osal_get_timeoutEx_1
//  375   {
//  376     rtrn = tmr->timeout;
        INC     DPTR
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R7,A
//  377   }
//  378 
//  379   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
??osal_get_timeoutEx_1:
        MOV     A,?V0 + 0
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  380 
//  381   return rtrn;
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        CFI EndBlock cfiBlock12
        REQUIRE ?Subroutine4
        REQUIRE _A_IEN0
        ; // Fall through to label ?Subroutine4
//  382 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine4:
        CFI Block cfiBlock13 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        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(-12)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x4
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock13
//  383 
//  384 /*********************************************************************
//  385  * @fn      osal_timer_activate
//  386  *
//  387  * @brief
//  388  *
//  389  *   Turns the hardware timer on or off
//  390  *
//  391  * @param  byte turn_on - false - turn off, true - turn on
//  392  *
//  393  * @return  none
//  394  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  395 void osal_timer_activate( byte turn_on )
osal_timer_activate:
        CFI Block cfiBlock14 Using cfiCommon0
        CFI Function osal_timer_activate
//  396 {
        FUNCALL osal_timer_activate, osal_timer_hw_setup
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 0
        MOV     A,R1
        MOV     R6,A
//  397   osal_timer_hw_setup( turn_on );
        ; Setup parameters for call to function osal_timer_hw_setup
        LCALL   ??osal_timer_hw_setup?relay
//  398   timerActive = turn_on;
        MOV     A,R6
        MOV     DPTR,#timerActive
        MOVX    @DPTR,A
//  399 }
        LJMP    ?Subroutine5 & 0xFFFF
        CFI EndBlock cfiBlock14
//  400 
//  401 /*********************************************************************
//  402  * @fn      osal_timer_num_active
//  403  *
//  404  * @brief
//  405  *
//  406  *   This function counts the number of active timers.
//  407  *
//  408  * @return  byte - number of timers
//  409  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  410 byte osal_timer_num_active( void )
osal_timer_num_active:
        CFI Block cfiBlock15 Using cfiCommon0
        CFI Function osal_timer_num_active
//  411 {
        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
//  412   halIntState_t intState;
//  413   byte num_timers = 0;
        MOV     R1,#0x0
//  414   osalTimerRec_t *srchTimer;
//  415 
//  416   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R4,A
        CLR     0xa8.7
//  417 
//  418   // Head of the timer list
//  419   srchTimer = timerHead;
        MOV     DPTR,#timerHead
        SJMP    ??osal_timer_num_active_0
//  420 
//  421   // Count timers in the list
//  422   while ( srchTimer != NULL )
//  423   {
//  424     num_timers++;
??osal_timer_num_active_1:
        INC     R1
//  425     srchTimer = srchTimer->next;
??osal_timer_num_active_0:
        LCALL   ??Subroutine1_0 & 0xFFFF
??CrossCallReturnLabel_4:
        MOV     DPL,R2
        MOV     DPH,R3
//  426   }
        MOV     A,DPL
        JNZ     ??osal_timer_num_active_2
        MOV     A,DPH
??osal_timer_num_active_2:
        JNZ     ??osal_timer_num_active_1
//  427 
//  428   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
        MOV     A,R4
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  429 
//  430   return num_timers;
        SJMP    ?Subroutine6
        CFI EndBlock cfiBlock15
        REQUIRE _A_IEN0
//  431 }
//  432 
//  433 /*********************************************************************
//  434  * @fn      osal_timer_hw_setup
//  435  *
//  436  * @brief
//  437  *
//  438  *   Setup the timer hardware.
//  439  *
//  440  * @param  byte turn_on
//  441  *
//  442  * @return  void
//  443  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  444 void osal_timer_hw_setup( byte turn_on )
osal_timer_hw_setup:
        CFI Block cfiBlock16 Using cfiCommon0
        CFI Function osal_timer_hw_setup
//  445 {
        FUNCALL osal_timer_hw_setup, HalTimerStart
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_timer_hw_setup, HalTimerStop
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  446   if (turn_on)
        MOV     A,R1
        JZ      ??osal_timer_hw_setup_0
//  447   {
//  448     HalTimerStart (OSAL_TIMER, tmr_count );
        ; Setup parameters for call to function HalTimerStart
        MOV     DPTR,#tmr_count
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        MOV     R1,#0x2
        LCALL   ??HalTimerStart?relay
        SJMP    ??osal_timer_hw_setup_1
//  449   }
//  450   else
//  451   {
//  452     HalTimerStop (OSAL_TIMER);
??osal_timer_hw_setup_0:
        ; Setup parameters for call to function HalTimerStop
        MOV     R1,#0x2
        LCALL   ??HalTimerStop?relay
//  453   }
//  454 }
??osal_timer_hw_setup_1:
        SJMP    ?Subroutine4
        CFI EndBlock cfiBlock16
//  455 
//  456 #if defined( POWER_SAVING )
//  457 /*********************************************************************
//  458  * @fn      osal_sleep_timers
//  459  *
//  460  * @brief
//  461  *
//  462  *   This function will enable interrupts if timers are running.
//  463  *
//  464  * @param  none
//  465  *
//  466  * @return  none
//  467  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  468 void osal_sleep_timers( void )
osal_sleep_timers:
        CFI Block cfiBlock17 Using cfiCommon0
        CFI Function osal_sleep_timers
//  469 {
        FUNCALL osal_sleep_timers, osal_timer_num_active
        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 osal_sleep_timers, osal_set_timer_interrupt
        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
//  470 #ifndef TIMER_INT
//  471   if ( osal_timer_num_active() )
        ; Setup parameters for call to function osal_timer_num_active
        LCALL   ??osal_timer_num_active?relay
        MOV     A,R1
        JZ      ??osal_sleep_timers_0
//  472     osal_set_timer_interrupt( TRUE );
        ; Setup parameters for call to function osal_set_timer_interrupt
        MOV     R1,#0x1
        LCALL   ??osal_set_timer_interrupt?relay
//  473 #endif
//  474 }
??osal_sleep_timers_0:
        SJMP    ?Subroutine6
        CFI EndBlock cfiBlock17
//  475 
//  476 /*********************************************************************
//  477  * @fn      osal_unsleep_timers
//  478  *
//  479  * @brief
//  480  *
//  481  *   This function will disable interrupts if timers are running.
//  482  *
//  483  * @param  none
//  484  *
//  485  * @return  none
//  486  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  487 void osal_unsleep_timers( void )
osal_unsleep_timers:
        CFI Block cfiBlock18 Using cfiCommon0
        CFI Function osal_unsleep_timers
//  488 {
        FUNCALL osal_unsleep_timers, osal_set_timer_interrupt
        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
//  489 #ifndef TIMER_INT
//  490   osal_set_timer_interrupt( FALSE );
        ; Setup parameters for call to function osal_set_timer_interrupt
        MOV     R1,#0x0
        LCALL   ??osal_set_timer_interrupt?relay
//  491 #endif
//  492 }
        SJMP    ?Subroutine6
        CFI EndBlock cfiBlock18
//  493 #endif
//  494 
//  495 /*********************************************************************
//  496  * @fn      osal_set_timer_interrupt
//  497  *
//  498  * @brief
//  499  *
//  500  *   Setup the timer hardware interrupt.
//  501  *
//  502  * @param  byte turn_on
//  503  *
//  504  * @return  void
//  505  *********************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  506 void osal_set_timer_interrupt( byte turn_on )
osal_set_timer_interrupt:
        CFI Block cfiBlock19 Using cfiCommon0
        CFI Function osal_set_timer_interrupt
//  507 {
        FUNCALL osal_set_timer_interrupt, HalTimerInterruptEnable
        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
//  508   // Enable or disable timer interrupts
//  509   HalTimerInterruptEnable ( OSAL_TIMER, HAL_TIMER_CH_MODE_OUTPUT_COMPARE, turn_on);
        ; Setup parameters for call to function HalTimerInterruptEnable
        MOV     A,R1
        MOV     R3,A
        MOV     R2,#0x2
        MOV     R1,#0x2
        LCALL   ??HalTimerInterruptEnable?relay
        CFI EndBlock cfiBlock19
//  510 }
        REQUIRE ?Subroutine6
        ; // Fall through to label ?Subroutine6

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine6:
        CFI Block cfiBlock20 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+-5
        CFI DPL0 Frame(CFA_SP, 4)
        CFI DPH0 Frame(CFA_SP, 5)
        POP     DPH
        CFI CFA_SP SP+-4
        CFI DPH0 SameValue
        POP     DPL
        CFI CFA_SP SP+-3
        CFI DPL0 SameValue
        LJMP    ?BRET
        CFI EndBlock cfiBlock20
//  511 
//  512 /*********************************************************************
//  513  * @fn      osalTimerUpdate
//  514  *
//  515  * @brief   Update the timer structures for a timer tick.
//  516  *
//  517  * @param   none
//  518  *
//  519  * @return  none
//  520  *********************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  521 static void osalTimerUpdate( uint16 updateTime )
osalTimerUpdate:
        CFI Block cfiBlock21 Using cfiCommon0
        CFI Function osalTimerUpdate
//  522 {
        FUNCALL osalTimerUpdate, osal_set_event
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 17, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osalTimerUpdate, osal_mem_free
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 17, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osalTimerUpdate, osal_retune_timers
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 17, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, 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: 1
        MOV     A,#-0x1
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 17)
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
//  523   halIntState_t intState;
//  524   osalTimerRec_t *srchTimer;
//  525   osalTimerRec_t *prevTimer;
//  526   osalTimerRec_t *saveTimer;
//  527 
//  528   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    @DPTR,A
        CLR     0xa8.7
//  529 
//  530   // Update the system time
//  531   osal_systemClock += updateTime;
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
        MOV     ?V0 + 6,#0x0
        MOV     ?V0 + 7,#0x0
        MOV     DPTR,#osal_systemClock
        MOV     R0,#?V0 + 4
        LCALL   ?L_ADD_TO_X
//  532 
//  533   // Look for open timer slot
//  534   if ( timerHead != NULL )
        MOV     DPTR,#timerHead
        MOVX    A,@DPTR
        JNZ     ??osalTimerUpdate_0
        INC     DPTR
        MOVX    A,@DPTR
??osalTimerUpdate_0:
        JNZ     $+5
        LJMP    ??osalTimerUpdate_1 & 0xFFFF
//  535   {
//  536     // Add it to the end of the timer list
//  537     srchTimer = timerHead;
        MOV     DPTR,#timerHead
        MOVX    A,@DPTR
        MOV     R6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R7,A
//  538     prevTimer = (void *)NULL;
        MOV     ?V0 + 2,#0x0
        MOV     ?V0 + 3,#0x0
//  539 
//  540     // Look for open timer slot
//  541     while ( srchTimer )
//  542     {
//  543       // Decrease the correct amount of time
//  544       if (srchTimer->timeout <= updateTime)
??osalTimerUpdate_2:
        MOV     DPL,R6
        MOV     DPH,R7
        INC     DPTR
        INC     DPTR
        LCALL   ??Subroutine3_0 & 0xFFFF
??CrossCallReturnLabel_13:
        CLR     C
        MOV     A,?V0 + 0
        SUBB    A,R0
        MOV     A,?V0 + 1
        SUBB    A,R1
        JC      ??osalTimerUpdate_3
//  545         srchTimer->timeout = 0;
        MOV     DPL,R6
        MOV     DPH,R7
        INC     DPTR
        INC     DPTR
        CLR     A
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    @DPTR,A
        SJMP    ??osalTimerUpdate_4
//  546       else
//  547         srchTimer->timeout = srchTimer->timeout - updateTime;
??osalTimerUpdate_3:
        MOV     A,R6
        ADD     A,#0x2
        MOV     R0,A
        MOV     A,R7
        ADDC    A,#0x0
        MOV     R1,A
        MOV     DPL,R0
        MOV     DPH,R1
        CLR     C
        MOVX    A,@DPTR
        SUBB    A,?V0 + 0
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    A,@DPTR
        SUBB    A,?V0 + 1
        MOVX    @DPTR,A
//  548 
//  549       // When timeout, execute the task
//  550       if ( srchTimer->timeout == 0 )
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        JNZ     ??osalTimerUpdate_5
        INC     DPTR
        MOVX    A,@DPTR
??osalTimerUpdate_5:
        JNZ     ??osalTimerUpdate_6
//  551       {
//  552         osal_set_event( srchTimer->task_id, srchTimer->event_flag );
??osalTimerUpdate_4:
        ; Setup parameters for call to function osal_set_event
        MOV     DPL,R6
        MOV     DPH,R7
        INC     DPTR
        INC     DPTR
        LCALL   ?Subroutine1 & 0xFFFF
??CrossCallReturnLabel_5:
        MOV     DPL,R6
        MOV     DPH,R7
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??osal_set_event?relay
//  553 
//  554         // Take out of list
//  555         if ( prevTimer == NULL )
        MOV     A,?V0 + 2
        JNZ     ??osalTimerUpdate_7
        MOV     A,?V0 + 3
??osalTimerUpdate_7:
        MOV     DPL,R6
        MOV     DPH,R7
        JNZ     ??osalTimerUpdate_8
//  556           timerHead = srchTimer->next;
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_9:
        SJMP    ??osalTimerUpdate_9
//  557         else
//  558           prevTimer->next = srchTimer->next;
??osalTimerUpdate_8:
        LCALL   ??Subroutine3_0 & 0xFFFF
??CrossCallReturnLabel_14:
        MOV     DPL,?V0 + 2
        MOV     DPH,?V0 + 3
??osalTimerUpdate_9:
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
//  559 
//  560         // Next
//  561         saveTimer = srchTimer->next;
        MOV     DPL,R6
        MOV     DPH,R7
        MOVX    A,@DPTR
        MOV     ?V0 + 4,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     ?V0 + 5,A
//  562 
//  563         // Free memory
//  564         osal_mem_free( srchTimer );
        ; Setup parameters for call to function osal_mem_free
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        LCALL   ??osal_mem_free?relay
//  565 
//  566         srchTimer = saveTimer;
        MOV     R6,?V0 + 4
        MOV     R7,?V0 + 5
        SJMP    ??osalTimerUpdate_10
//  567       }
//  568       else
//  569       {
//  570         // Get next
//  571         prevTimer = srchTimer;
??osalTimerUpdate_6:
        MOV     ?V0 + 2,R6
        MOV     ?V0 + 3,R7
//  572         srchTimer = srchTimer->next;
        MOV     DPL,R6
        MOV     DPH,R7
        MOVX    A,@DPTR
        MOV     R6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R7,A
//  573       }
//  574     }
??osalTimerUpdate_10:
        MOV     A,R6
        JNZ     ??osalTimerUpdate_11
        MOV     A,R7
??osalTimerUpdate_11:
        JZ      $+5
        LJMP    ??osalTimerUpdate_2 & 0xFFFF
//  575 
//  576 #ifdef POWER_SAVING
//  577     osal_retune_timers();
        ; Setup parameters for call to function osal_retune_timers
        LCALL   ??osal_retune_timers?relay
//  578 #endif
//  579   }
//  580 
//  581   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
??osalTimerUpdate_1:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  582 }
        MOV     A,#0x1
        LCALL   ?DEALLOC_XSTACK8
        CFI EndBlock cfiBlock21
        REQUIRE ?Subroutine7
        REQUIRE _A_IEN0
        ; // Fall through to label ?Subroutine7

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine7:
        CFI Block cfiBlock22 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        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)))
        MOV     R7,#0x8
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock22

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine3:
        CFI Block cfiCond23 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_12
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond24 Using cfiCommon0
        CFI (cfiCond24) NoFunction
        CFI (cfiCond24) Conditional ??CrossCallReturnLabel_16
        CFI (cfiCond24) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond24) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond24) CFA_SP SP+-5
        CFI Block cfiPicker25 Using cfiCommon1
        CFI (cfiPicker25) NoFunction
        CFI (cfiPicker25) Picker
        MOV     DPL,R0
        MOV     DPH,R1
        CFI Block cfiCond26 Using cfiCommon0
        CFI (cfiCond26) NoFunction
        CFI (cfiCond26) Conditional ??CrossCallReturnLabel_10
        CFI (cfiCond26) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond26) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond26) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond26) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond26) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond26) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond26) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond26) V5 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, 14)
        CFI Block cfiCond27 Using cfiCommon0
        CFI (cfiCond27) NoFunction
        CFI (cfiCond27) Conditional ??CrossCallReturnLabel_11
        CFI (cfiCond27) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond27) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond27) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond27) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond27) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond27) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond27) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond27) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond27) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond27) CFA_SP SP+0
        CFI (cfiCond27) CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond28 Using cfiCommon0
        CFI (cfiCond28) NoFunction
        CFI (cfiCond28) Conditional ??CrossCallReturnLabel_13
        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, 17)
        CFI Block cfiCond29 Using cfiCommon0
        CFI (cfiCond29) NoFunction
        CFI (cfiCond29) Conditional ??CrossCallReturnLabel_14
        CFI (cfiCond29) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond29) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond29) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond29) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond29) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond29) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond29) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond29) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond29) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond29) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond29) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond29) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond29) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond29) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond29) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond29) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond29) CFA_SP SP+0
        CFI (cfiCond29) CFA_XSP16 add(XSP16, 17)
        CFI Block cfiCond30 Using cfiCommon0
        CFI (cfiCond30) NoFunction
        CFI (cfiCond30) Conditional ??CrossCallReturnLabel_15
        CFI (cfiCond30) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond30) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond30) CFA_SP SP+-5
??Subroutine3_0:
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R1,A
        RET
        CFI EndBlock cfiCond23
        CFI EndBlock cfiCond24
        CFI EndBlock cfiPicker25
        CFI EndBlock cfiCond26
        CFI EndBlock cfiCond27
        CFI EndBlock cfiCond28
        CFI EndBlock cfiCond29
        CFI EndBlock cfiCond30

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiCond31 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_8
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Block cfiCond32 Using cfiCommon0
        CFI (cfiCond32) NoFunction
        CFI (cfiCond32) Conditional ??CrossCallReturnLabel_9
        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, 17)
        CFI Block cfiPicker33 Using cfiCommon1
        CFI (cfiPicker33) NoFunction
        CFI (cfiPicker33) Picker
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R1,A
        MOV     DPTR,#timerHead
        RET
        CFI EndBlock cfiCond31
        CFI EndBlock cfiCond32
        CFI EndBlock cfiPicker33

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiCond34 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, 17)
        CFI Block cfiCond35 Using cfiCommon0
        CFI (cfiCond35) NoFunction
        CFI (cfiCond35) Conditional ??CrossCallReturnLabel_7
        CFI (cfiCond35) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond35) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond35) CFA_SP SP+-5
        CFI Block cfiPicker36 Using cfiCommon1
        CFI (cfiPicker36) NoFunction
        CFI (cfiPicker36) Picker
        INC     DPTR
        INC     DPTR
        CFI Block cfiCond37 Using cfiCommon0
        CFI (cfiCond37) NoFunction
        CFI (cfiCond37) Conditional ??CrossCallReturnLabel_4
        CFI (cfiCond37) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond37) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond37) CFA_SP SP+-5
        CFI Block cfiCond38 Using cfiCommon0
        CFI (cfiCond38) NoFunction
        CFI (cfiCond38) Conditional ??CrossCallReturnLabel_6
        CFI (cfiCond38) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond38) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond38) CFA_SP SP+-5
??Subroutine1_0:
        MOVX    A,@DPTR
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R3,A
        RET
        CFI EndBlock cfiCond34
        CFI EndBlock cfiCond35
        CFI EndBlock cfiPicker36
        CFI EndBlock cfiCond37
        CFI EndBlock cfiCond38
//  583 
//  584 /*********************************************************************
//  585  * @fn      osal_update_timers
//  586  *
//  587  * @brief   Update the timer structures for timer ticks.
//  588  *
//  589  * @param   none
//  590  *
//  591  * @return  none
//  592  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  593 void osal_update_timers( void )
osal_update_timers:
        CFI Block cfiBlock39 Using cfiCommon0
        CFI Function osal_update_timers
//  594 {
        FUNCALL osal_update_timers, osalTimerUpdate
        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
//  595   osalTimerUpdate( tmr_decr_time );
        ; Setup parameters for call to function osalTimerUpdate
        MOV     DPTR,#tmr_decr_time
        LCALL   ??Subroutine1_0 & 0xFFFF
??CrossCallReturnLabel_6:
        LCALL   ??osalTimerUpdate?relay
//  596 }
        LJMP    ?Subroutine6 & 0xFFFF
        CFI EndBlock cfiBlock39
//  597 
//  598 #ifdef POWER_SAVING
//  599 /*********************************************************************
//  600  * @fn      osal_adjust_timers
//  601  *
//  602  * @brief   Update the timer structures for elapsed ticks.
//  603  *
//  604  * @param   none
//  605  *
//  606  * @return  none
//  607  *********************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  608 void osal_adjust_timers( void )
osal_adjust_timers:
        CFI Block cfiBlock40 Using cfiCommon0
        CFI Function osal_adjust_timers
//  609 {
        FUNCALL osal_adjust_timers, TimerElapsed
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_adjust_timers, osalTimerUpdate
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  610   uint16 eTime;
//  611 
//  612   if ( timerHead != NULL )
        MOV     DPTR,#timerHead
        MOVX    A,@DPTR
        JNZ     ??osal_adjust_timers_0
        INC     DPTR
        MOVX    A,@DPTR
??osal_adjust_timers_0:
        JZ      ??osal_adjust_timers_1
//  613   {
//  614     // Compute elapsed time (msec)
//  615     eTime = TimerElapsed() /  TICK_COUNT;
        ; Setup parameters for call to function TimerElapsed
        LCALL   ??TimerElapsed?relay
//  616 
//  617     if ( eTime )
        MOV     A,R2
        JNZ     ??osal_adjust_timers_2
        MOV     A,R3
??osal_adjust_timers_2:
        JZ      ??osal_adjust_timers_1
//  618       osalTimerUpdate( eTime );
        ; Setup parameters for call to function osalTimerUpdate
        LCALL   ??osalTimerUpdate?relay
//  619   }
//  620 }
??osal_adjust_timers_1:
        LJMP    ?Subroutine4 & 0xFFFF
        CFI EndBlock cfiBlock40
//  621 #endif
//  622 
//  623 #ifdef POWER_SAVING
//  624 /*********************************************************************
//  625  * @fn      osal_retune_timers
//  626  *
//  627  * @brief
//  628  *
//  629  *   Adjust CPU sleep time to the lowest timeout value. If the timeout
//  630  *   value is more then RETUNE_THRESHOLD, then the sleep time will be
//  631  *   RETUNE_THRESHOLD.
//  632  *
//  633  * @param   none
//  634  *
//  635  * @return  none
//  636  *********************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  637 void osal_retune_timers( void )
osal_retune_timers:
        CFI Block cfiBlock41 Using cfiCommon0
        CFI Function osal_retune_timers
//  638 {
        FUNCALL osal_retune_timers, osal_next_timeout
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_retune_timers, osal_timer_activate
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_retune_timers, osal_timer_activate
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, 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: 0
//  639   halIntState_t intState;
//  640   uint16 nextTimeout;
//  641 
//  642   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  643 
//  644   // Next occuring timeout
//  645   nextTimeout = osal_next_timeout();
        ; Setup parameters for call to function osal_next_timeout
        LCALL   ??osal_next_timeout?relay
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
//  646 
//  647   // Make sure timer counter can handle it
//  648   if ( !nextTimeout || (nextTimeout > RETUNE_THRESHOLD) )
        MOV     A,R2
        JNZ     ??osal_retune_timers_0
        MOV     A,R3
??osal_retune_timers_0:
        JZ      ??osal_retune_timers_1
        CLR     C
        MOV     A,R2
        SUBB    A,#0x2
        MOV     A,R3
        SUBB    A,#0x0
        JC      ??osal_retune_timers_2
//  649     nextTimeout = RETUNE_THRESHOLD;
??osal_retune_timers_1:
        MOV     ?V0 + 4,#0x1
        MOV     ?V0 + 5,#0x0
//  650 
//  651   if (nextTimeout != tmr_decr_time)
??osal_retune_timers_2:
        MOV     DPTR,#tmr_decr_time
        MOVX    A,@DPTR
        XRL     A,?V0 + 4
        JNZ     ??osal_retune_timers_3
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,?V0 + 5
??osal_retune_timers_3:
        JZ      ??osal_retune_timers_4
//  652   {
//  653     // Stop the clock
//  654     osal_timer_activate( FALSE );
        ; Setup parameters for call to function osal_timer_activate
        MOV     R1,#0x0
        LCALL   ??osal_timer_activate?relay
//  655 
//  656     // Alter the rolling time
//  657     tmr_decr_time = nextTimeout;
        MOV     DPTR,#tmr_decr_time
        MOV     A,?V0 + 4
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,?V0 + 5
        MOVX    @DPTR,A
//  658     tmr_count = (uint32)nextTimeout * TICK_TIME;
        MOV     ?V0 + 6,#0x0
        MOV     ?V0 + 7,#0x0
        MOV     DPTR,#__Constant_3e8
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?L_MUL
        MOV     DPTR,#tmr_count
        MOV     R0,#?V0 + 4
        LCALL   ?L_MOV_TO_X
//  659 
//  660     // Restart the clock
//  661     osal_timer_activate( TRUE );
        ; Setup parameters for call to function osal_timer_activate
        MOV     R1,#0x1
        LCALL   ??osal_timer_activate?relay
//  662   }
//  663 
//  664   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
??osal_retune_timers_4:
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  665 }
        LJMP    ?Subroutine7 & 0xFFFF
        CFI EndBlock cfiBlock41
        REQUIRE _A_IEN0
//  666 
//  667 /*********************************************************************
//  668  * @fn      osal_next_timeout
//  669  *
//  670  * @brief
//  671  *
//  672  *   Search timer table to return the lowest timeout value. If the
//  673  *   timer list is empty, then the returned timeout will be zero.
//  674  *
//  675  * @param   none
//  676  *
//  677  * @return  none
//  678  *********************************************************************/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  679 uint16 osal_next_timeout( void )
osal_next_timeout:
        CFI Block cfiBlock42 Using cfiCommon0
        CFI Function osal_next_timeout
//  680 {
        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
//  681   uint16 nextTimeout;
//  682   osalTimerRec_t *srchTimer;
//  683 
//  684   if ( timerHead != NULL )
        MOV     DPTR,#timerHead
        MOVX    A,@DPTR
        JNZ     ??osal_next_timeout_0
        INC     DPTR
        MOVX    A,@DPTR
??osal_next_timeout_0:
        JZ      ??osal_next_timeout_1
//  685   {
//  686     // Head of the timer list
//  687     srchTimer = timerHead;
        MOV     DPTR,#timerHead
        LCALL   ??Subroutine3_0 & 0xFFFF
//  688     nextTimeout = OSAL_TIMERS_MAX_TIMEOUT;
??CrossCallReturnLabel_15:
        MOV     R2,#-0x1
        MOV     R3,#-0x1
//  689 
//  690     // Look for the next timeout timer
//  691     while ( srchTimer != NULL )
//  692     {
//  693       if (srchTimer->timeout < nextTimeout)
??osal_next_timeout_2:
        MOV     DPL,R0
        MOV     DPH,R1
        INC     DPTR
        INC     DPTR
        CLR     C
        MOVX    A,@DPTR
        SUBB    A,R2
        INC     DPTR
        MOVX    A,@DPTR
        SUBB    A,R3
        JNC     ??CrossCallReturnLabel_7
//  694       {
//  695         nextTimeout = srchTimer->timeout;
        MOV     DPL,R0
        MOV     DPH,R1
        LCALL   ?Subroutine1 & 0xFFFF
//  696       }
//  697       // Check next timer
//  698       srchTimer = srchTimer->next;
??CrossCallReturnLabel_7:
        LCALL   ?Subroutine3 & 0xFFFF
//  699     }
??CrossCallReturnLabel_16:
        MOV     A,R0
        JNZ     ??osal_next_timeout_3
        MOV     A,R1
??osal_next_timeout_3:
        JZ      ??osal_next_timeout_4
        SJMP    ??osal_next_timeout_2
//  700   }
//  701   else
//  702   {
//  703     // No timers
//  704     nextTimeout = 0;
??osal_next_timeout_1:
        MOV     R2,#0x0
        MOV     R3,#0x0
//  705   }
//  706 
//  707   return ( nextTimeout );
??osal_next_timeout_4:
        LJMP    ?Subroutine6 & 0xFFFF
        CFI EndBlock cfiBlock42
//  708 }
//  709 #endif // POWER_SAVING
//  710 
//  711 /*********************************************************************
//  712  * @fn      osal_GetSystemClock()
//  713  *
//  714  * @brief   Read the local system clock.
//  715  *
//  716  * @param   none
//  717  *
//  718  * @return  local clock in milliseconds
//  719  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  720 uint32 osal_GetSystemClock( void )
osal_GetSystemClock:
        CFI Block cfiBlock43 Using cfiCommon0
        CFI Function osal_GetSystemClock
//  721 {
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  722   return ( osal_systemClock );
        MOV     DPTR,#osal_systemClock
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LJMP    ?Subroutine4 & 0xFFFF
        CFI EndBlock cfiBlock43
//  723 }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        END
//  724 
//  725 /*********************************************************************
//  726 *********************************************************************/
// 
// 1 235 bytes in segment BANKED_CODE
//   114 bytes in segment BANK_RELAYS
//     1 byte  in segment SFR_AN
//     8 bytes in segment XDATA_I
//     8 bytes in segment XDATA_ID
//    13 bytes in segment XDATA_Z
// 
// 1 349 bytes of CODE  memory (+ 8 bytes shared)
//     0 bytes of DATA  memory (+ 1 byte  shared)
//    13 bytes of XDATA memory (+ 8 bytes shared)
//
//Errors: none
//Warnings: none
