###############################################################################
#                                                                             #
# IAR 8051 C/C++ Compiler V7.30B/W32                    19/May/2010  09:38:54 #
# Copyright 2004-2007 IAR Systems. All rights reserved.                       #
#                                                                             #
#    Core               =  plain                                              #
#    Code model         =  banked                                             #
#    Data model         =  large                                              #
#    Calling convention =  xdata reentrant                                    #
#    Constant location  =  data                                               #
#    Dptr setup         =  1,16                                               #
#    Source file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Components #
#                          \hal\common\hal_drivers.c                          #
#    Command line       =  -f "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\..\..\..\Tools #
#                          \CC2430DB\f8wCoord.cfg" (-DCPU32MHZ                #
#                          -DFORCE_MAC_NEAR -DROOT=__near_func                #
#                          -DMAC_CFG_APP_PENDING_QUEUE=TRUE                   #
#                          -DZDO_COORDINATOR -DRTR_NWK -DBLINK_LEDS           #
#                          "-DCONST=const __code" -DGENERIC=__generic) -f     #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\..\..\..\Tools\CC #
#                          2430DB\f8wConfig.cfg" (-DSECURE=1                  #
#                          -DDEFAULT_CHANLIST=0x04000000                      #
#                          -DZDAPP_CONFIG_PAN_ID=0x00FF                       #
#                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_MA #
#                          SK=0x007F -DBEACON_REQUEST_DELAY=100               #
#                          -DBEACON_REQ_DELAY_MASK=0x00FF                     #
#                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_PO #
#                          LLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7             #
#                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3   #
#                          -DNWK_MAX_DATA_RETRIES=2                           #
#                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9         #
#                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20           #
#                          -DNWK_MAX_BINDING_ENTRIES=10                       #
#                          -DMAX_BINDING_CLUSTER_IDS=5 "-DDEFAULT_KEY={0x02,  #
#                          0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00,    #
#                          0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"         #
#                          -DRFD_RCVC_ALWAYS_ON=FALSE -DPOLL_RATE=1000        #
#                          -DQUEUED_POLL_RATE=100 -DRESPONSE_POLL_RATE=100)   #
#                          -DREJOIN_POLL_RATE=440 "C:\Texas                   #
#                          Instruments\ZStack-1.4.3-1.2.1\Components\hal\comm #
#                          on\hal_drivers.c" -D CC2430EB -D ZTOOL_P1 -D       #
#                          LOCATION_DONGLE -D MT_TASK -D xNV_RESTORE -D       #
#                          INT_HEAP_LEN=4608 -D HAL_UART_BIG_TX_BUF=1 -D      #
#                          SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D                #
#                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas           #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\LocDongle\List\" -lA        #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\LocDongle\List\"  #
#                          --diag_suppress Pe001,Pa010 --diag_remark pe550    #
#                          -o "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\LocDongle\Obj\ #
#                          " -e --require_prototypes -z9 --no_code_motion     #
#                          --debug --core=plain --dptr=16,1                   #
#                          --data_model=large --code_model=banked             #
#                          --calling_convention=xdata_reentrant               #
#                          --place_constants=data --nr_virtual_regs 8 -I      #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\SOURCE\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\"   #
#                          -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\..\..\..\..\WX #
#                          L\INCLUDE\" -I "C:\Texas                           #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          T\" -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Pr #
#                          ojects\zstack\Samples\Location\CC2430DB\..\..\..\. #
#                          .\..\COMPONENTS\HAL\INCLUDE\" -I "C:\Texas         #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\H #
#                          AL\TARGET\CC2430EB\" -I "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\O #
#                          SAL\MCU\CCSOC\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\O #
#                          SAL\INCLUDE\" -I "C:\Texas                         #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\AF\" -I "C:\Texas Instruments\ZStack-1.4.3-1. #
#                          2.1\Projects\zstack\Samples\Location\CC2430DB\..\. #
#                          .\..\..\..\COMPONENTS\STACK\NWK\" -I "C:\Texas     #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\SEC\" -I "C:\Texas Instruments\ZStack-1.4.3-1 #
#                          .2.1\Projects\zstack\Samples\Location\CC2430DB\..\ #
#                          ..\..\..\..\COMPONENTS\STACK\SYS\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\ZDO\" -I "C:\Texas Instruments\ZStack-1.4.3-1 #
#                          .2.1\Projects\zstack\Samples\Location\CC2430DB\..\ #
#                          ..\..\..\..\COMPONENTS\ZMAC\F8W\" -I "C:\Texas     #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\Z #
#                          MAC\" -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\ #
#                          Projects\zstack\Samples\Location\CC2430DB\..\..\.. #
#                          \..\..\COMPONENTS\SERVICES\SADDR\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          ERVICES\SDATA\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\INCLUDE\" -I "C:\Texas                          #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\HIGH_LEVEL\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\LOW_LEVEL\SRF03\" -I "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\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\ZStack-1.4.3-1.2.1\Projects\z #
#                          stack\Samples\Location\CC2430DB\LocDongle\List\hal #
#                          _drivers.lst                                       #
#    Object file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\z #
#                          stack\Samples\Location\CC2430DB\LocDongle\Obj\hal_ #
#                          drivers.r51                                        #
#                                                                             #
#                                                                             #
###############################################################################

C:\Texas Instruments\ZStack-1.4.3-1.2.1\Components\hal\common\hal_drivers.c
      1          /**************************************************************************************************
      2            Filename:       hal_drivers.c
      3            Revised:        $Date: 2007-07-06 10:42:24 -0700 (Fri, 06 Jul 2007) $
      4            Revision:       $Revision: 13579 $
      5          
      6            Description:    This file contains the interface to the Drivers Service.
      7          
      8          
      9            Copyright 2005-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          /**************************************************************************************************
     42           *                                            INCLUDES
     43           **************************************************************************************************/
     44          #include "hal_types.h"
     45          #include "OSAL.h"
     46          #include "hal_drivers.h"
     47          #include "hal_adc.h"
     48          #if (defined HAL_DMA) && (HAL_DMA == TRUE)
     49            #include "hal_dma.h"
     50          #endif
     51          #include "hal_key.h"
     52          //#include "hal_lcd.h"
     53          #ifdef LCD_SUPPORTED
     54            #include "lcd128_64.h"
     55          #endif
     56          #include "hal_led.h"
     57          #include "hal_timer.h"
     58          #include "hal_uart.h"
     59          #include "hal_sleep.h"
     60          #if (defined HAL_AES) && (HAL_AES == TRUE)
     61            #include "hal_aes.h"
     62          #endif
     63          
     64          /**************************************************************************************************
     65           *                                            MACROS
     66           **************************************************************************************************/
     67          
     68          
     69          
     70          /**************************************************************************************************
     71           *                                          CONSTANTS
     72           **************************************************************************************************/
     73          
     74          
     75          /**************************************************************************************************
     76           *                                          TYPEDEFS
     77           **************************************************************************************************/
     78          
     79          
     80          /**************************************************************************************************
     81           *                                      GLOBAL VARIABLES
     82           **************************************************************************************************/

   \                                 In  segment XDATA_Z, align 1, keep-with-next
     83          uint8 Hal_TaskID;
   \                     Hal_TaskID:
   \   000000                DS 1
   \   000001                REQUIRE __INIT_XDATA_Z
     84          
     85          extern void HalLedUpdate( void ); /* Notes: This for internal only so it shouldn't be in hal_led.h */
     86          
     87          /**************************************************************************************************
     88           *                                      FUNCTIONS - API
     89           **************************************************************************************************/
     90          
     91          /**************************************************************************************************
     92           * @fn      Hal_Init
     93           *
     94           * @brief   Hal Initialization function.
     95           *
     96           * @param   task_id - Hal TaskId
     97           *
     98           * @return  None
     99           **************************************************************************************************/

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    100          void Hal_Init( uint8 task_id )
   \                     Hal_Init:
    101          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    102            /* Register task ID */
    103            Hal_TaskID = task_id;
   \   000004   E9           MOV     A,R1
   \   000005   90....       MOV     DPTR,#Hal_TaskID
   \   000008   F0           MOVX    @DPTR,A
    104          
    105          }
   \   000009                REQUIRE ?Subroutine0
   \   000009                ; // Fall through to label ?Subroutine0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   D083         POP     DPH
   \   000002   D082         POP     DPL
   \   000004   02....       LJMP    ?BRET
    106          
    107          /**************************************************************************************************
    108           * @fn      Hal_DriverInit
    109           *
    110           * @brief   Initialize HW - These need to be initialized before anyone.
    111           *
    112           * @param   task_id - Hal TaskId
    113           *
    114           * @return  None
    115           **************************************************************************************************/

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    116          void HalDriverInit (void)
   \                     HalDriverInit:
    117          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    118            /* TIMER */
    119            HalTimerInit();
   \   000004                ; Setup parameters for call to function HalTimerInit
   \   000004   12....       LCALL   ??HalTimerInit?relay
    120          
    121            /* ADC */
    122          #if (defined HAL_ADC) && (HAL_ADC == TRUE)
    123            HalAdcInit();
   \   000007                ; Setup parameters for call to function HalAdcInit
   \   000007   12....       LCALL   ??HalAdcInit?relay
    124          #endif
    125          
    126            /* DMA */
    127          #if (defined HAL_DMA) && (HAL_DMA == TRUE)
    128            // Must be called before the init call to any module that uses DMA.
    129            HalDmaInit();
   \   00000A                ; Setup parameters for call to function HalDmaInit
   \   00000A   12....       LCALL   ??HalDmaInit?relay
    130          #endif
    131          
    132            /* AES */
    133          #if (defined HAL_AES) && (HAL_AES == TRUE)
    134            HalAesInit();
   \   00000D                ; Setup parameters for call to function HalAesInit
   \   00000D   12....       LCALL   ??HalAesInit?relay
    135          #endif
    136          
    137            /* LCD */
    138          #ifdef LCD_SUPPORTED
    139            #if (defined HAL_LCD) && (HAL_LCD == TRUE)
    140              HalLcdInit();
    141            #endif
    142          #endif
    143          
    144            /* LED */
    145          #if (defined HAL_LED) && (HAL_LED == TRUE)
    146            HalLedInit();
   \   000010                ; Setup parameters for call to function HalLedInit
   \   000010   12....       LCALL   ??HalLedInit?relay
    147          #endif
    148          
    149            /* UART */
    150          #if (defined HAL_UART) && (HAL_UART == TRUE)
    151            HalUARTInit();
   \   000013                ; Setup parameters for call to function HalUARTInit
   \   000013   12....       LCALL   ??HalUARTInit?relay
    152          #endif
    153          
    154            /* KEY */
    155          #if (defined HAL_KEY) && (HAL_KEY == TRUE)
    156            HalKeyInit();
   \   000016                ; Setup parameters for call to function HalKeyInit
   \   000016   12....       LCALL   ??HalKeyInit?relay
    157          #endif
    158          }
   \   000019   80..         SJMP    ?Subroutine0
    159          
    160          
    161          /**************************************************************************************************
    162           * @fn      Hal_ProcessEvent
    163           *
    164           * @brief   Hal Process Event
    165           *
    166           * @param   task_id - Hal TaskId
    167           *          events - events
    168           *
    169           * @return  None
    170           **************************************************************************************************/

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    171          uint16 Hal_ProcessEvent( uint8 task_id, uint16 events )
   \                     Hal_ProcessEvent:
    172          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
    173            uint8 *msgPtr;
    174          
    175            if ( events & SYS_EVENT_MSG )
   \   000009   7480         MOV     A,#-0x80
   \   00000B   5F           ANL     A,R7
   \   00000C   F9           MOV     R1,A
   \   00000D   E4           CLR     A
   \   00000E   7001         JNZ     ??Hal_ProcessEvent_0
   \   000010   E9           MOV     A,R1
   \                     ??Hal_ProcessEvent_0:
   \   000011   7013         JNZ     ??Hal_ProcessEvent_1
    176            {
    177              msgPtr = osal_msg_receive(Hal_TaskID);
    178          
    179              while (msgPtr)
    180              {
    181                /* Do something here - for now, just deallocate the msg and move on */
    182          
    183                /* De-allocate */
    184                osal_msg_deallocate( msgPtr );
    185                /* Next */
    186                msgPtr = osal_msg_receive( Hal_TaskID );
    187              }
    188              return events ^ SYS_EVENT_MSG;
    189            }
    190          
    191            if ( events & HAL_LED_BLINK_EVENT )
   \   000013   EE           MOV     A,R6
   \   000014   5402         ANL     A,#0x2
   \   000016   6023         JZ      ??Hal_ProcessEvent_2
    192            {
    193          #if (defined (BLINK_LEDS)) && (HAL_LED == TRUE)
    194              HalLedUpdate();
   \   000018                ; Setup parameters for call to function HalLedUpdate
   \   000018   12....       LCALL   ??HalLedUpdate?relay
    195          #endif /* BLINK_LEDS && HAL_LED */
    196              return events ^ HAL_LED_BLINK_EVENT;
   \   00001B   7402         MOV     A,#0x2
   \   00001D   6E           XRL     A,R6
   \   00001E   FA           MOV     R2,A
   \   00001F   EF           MOV     A,R7
   \                     ??Hal_ProcessEvent_3:
   \   000020   FB           MOV     R3,A
   \   000021   8042         SJMP    ??Hal_ProcessEvent_4
    197            }
   \                     ??Hal_ProcessEvent_5:
   \   000023                ; Setup parameters for call to function osal_msg_deallocate
   \   000023   12....       LCALL   ??osal_msg_deallocate?relay
   \                     ??Hal_ProcessEvent_1:
   \   000026                ; Setup parameters for call to function osal_msg_receive
   \   000026   90....       MOV     DPTR,#Hal_TaskID
   \   000029   E0           MOVX    A,@DPTR
   \   00002A   F9           MOV     R1,A
   \   00002B   12....       LCALL   ??osal_msg_receive?relay
   \   00002E   EA           MOV     A,R2
   \   00002F   7001         JNZ     ??Hal_ProcessEvent_6
   \   000031   EB           MOV     A,R3
   \                     ??Hal_ProcessEvent_6:
   \   000032   70EF         JNZ     ??Hal_ProcessEvent_5
   \   000034   EE           MOV     A,R6
   \   000035   FA           MOV     R2,A
   \   000036   7480         MOV     A,#-0x80
   \   000038   6F           XRL     A,R7
   \   000039   80E5         SJMP    ??Hal_ProcessEvent_3
    198          
    199            if (events & HAL_KEY_EVENT)
   \                     ??Hal_ProcessEvent_2:
   \   00003B   EE           MOV     A,R6
   \   00003C   A2E0         MOV     C,0xE0 /* A   */.0
   \   00003E   5021         JNC     ??Hal_ProcessEvent_7
    200            {
    201          
    202          #if (defined HAL_KEY) && (HAL_KEY == TRUE)
    203              /* Check for keys */
    204              HalKeyPoll();
   \   000040                ; Setup parameters for call to function HalKeyPoll
   \   000040   12....       LCALL   ??HalKeyPoll?relay
    205          
    206              /* if interrupt disabled, do next polling */
    207              if (!Hal_KeyIntEnable)
   \   000043   90....       MOV     DPTR,#Hal_KeyIntEnable
   \   000046   E0           MOVX    A,@DPTR
   \   000047   7010         JNZ     ??Hal_ProcessEvent_8
    208              {
    209                osal_start_timerEx( Hal_TaskID, HAL_KEY_EVENT, 100);
   \   000049                ; Setup parameters for call to function osal_start_timerEx
   \   000049   7C64         MOV     R4,#0x64
   \   00004B   7D00         MOV     R5,#0x0
   \   00004D   7A01         MOV     R2,#0x1
   \   00004F   7B00         MOV     R3,#0x0
   \   000051   90....       MOV     DPTR,#Hal_TaskID
   \   000054   E0           MOVX    A,@DPTR
   \   000055   F9           MOV     R1,A
   \   000056   12....       LCALL   ??osal_start_timerEx?relay
    210              }
    211          #endif // HAL_KEY
    212          
    213              return events ^ HAL_KEY_EVENT;
   \                     ??Hal_ProcessEvent_8:
   \   000059   7401         MOV     A,#0x1
   \   00005B   6E           XRL     A,R6
   \   00005C   FA           MOV     R2,A
   \   00005D   EF           MOV     A,R7
   \   00005E   FB           MOV     R3,A
   \   00005F   8004         SJMP    ??Hal_ProcessEvent_4
    214            }
    215          
    216          #ifdef POWER_SAVING
    217            if ( events & HAL_SLEEP_TIMER_EVENT )
    218            {
    219              halRestoreSleepLevel();
    220              return events ^ HAL_SLEEP_TIMER_EVENT;
    221            }
    222          #endif
    223          
    224            /* Nothing interested, discard the message */
    225            return 0;
   \                     ??Hal_ProcessEvent_7:
   \   000061   7A00         MOV     R2,#0x0
   \   000063   7B00         MOV     R3,#0x0
   \                     ??Hal_ProcessEvent_4:
   \   000065   7F02         MOV     R7,#0x2
   \   000067   02....       LJMP    ?BANKED_LEAVE_XDATA
    226          
    227          }
    228          
    229          /**************************************************************************************************
    230           * @fn      Hal_ProcessPoll
    231           *
    232           * @brief   This routine will be called by OSAL to poll UART, TIMER...
    233           *
    234           * @param   task_id - Hal TaskId
    235           *
    236           * @return  None
    237           **************************************************************************************************/

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    238          void Hal_ProcessPoll ()
   \                     Hal_ProcessPoll:
    239          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    240          
    241            /* Timer Poll */
    242            HalTimerTick();
   \   000004                ; Setup parameters for call to function HalTimerTick
   \   000004   12....       LCALL   ??HalTimerTick?relay
    243          
    244            /* UART Poll */
    245          #if (defined HAL_UART) && (HAL_UART == TRUE)
    246            HalUARTPoll();
   \   000007                ; Setup parameters for call to function HalUARTPoll
   \   000007   12....       LCALL   ??HalUARTPoll?relay
    247          #endif
    248          
    249          }
   \   00000A   02....       LJMP    ?Subroutine0 & 0xFFFF

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

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

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

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??Hal_ProcessPoll?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    Hal_ProcessPoll
    250          
    251          
    252          /**************************************************************************************************
    253          **************************************************************************************************/
    254          

   Maximum stack usage in bytes:

     Function                 ISTACK PSTACK XSTACK
     --------                 ------ ------ ------
     HalDriverInit                2      0      0
       -> HalTimerInit            4      0      0
       -> HalAdcInit              4      0      0
       -> HalDmaInit              4      0      0
       -> HalAesInit              4      0      0
       -> HalLedInit              4      0      0
       -> HalUARTInit             4      0      0
       -> HalKeyInit              4      0      0
     Hal_Init                     2      0      0
     Hal_ProcessEvent             0      0     10
       -> HalLedUpdate            0      0     20
       -> osal_msg_deallocate     0      0     20
       -> osal_msg_receive        0      0     20
       -> HalKeyPoll              0      0     20
       -> osal_start_timerEx      0      0     20
     Hal_ProcessPoll              2      0      0
       -> HalTimerTick            4      0      0
       -> HalUARTPoll             4      0      0


   Segment part sizes:

     Function/Label           Bytes
     --------------           -----
     Hal_TaskID                  1
     Hal_Init                    9
     ?Subroutine0                7
     HalDriverInit              27
     Hal_ProcessEvent          106
     Hal_ProcessPoll            13
     ??Hal_Init?relay            6
     ??HalDriverInit?relay       6
     ??Hal_ProcessEvent?relay    6
     ??Hal_ProcessPoll?relay     6

 
 162 bytes in segment BANKED_CODE
  24 bytes in segment BANK_RELAYS
   1 byte  in segment XDATA_Z
 
 186 bytes of CODE  memory
   1 byte  of XDATA memory

Errors: none
Warnings: none
