///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR ANSI C/C++ Compiler V6.30.1.53127/W32 for ARM    08/Mar/2012  18:18:25 /
// Copyright 1999-2011 IAR Systems AB.                                        /
//                                                                            /
//    Cpu mode     =  thumb                                                   /
//    Endian       =  little                                                  /
//    Source file  =  D:\Profiles\b01252\My Documents\Freescale\P0\software\s /
//                    ample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_ /
//                    sc\src\projects\TWRK20D50M_Demo\protocol\protocol.c     /
//    Command line =  "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\src\projects\TWRK20D50M_Demo\protocol\protocol.c"   /
//                    -D IAR -D TOWER -D TWR_K20D50M -lCN                     /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\FLASH_128KB_PFLASH\List\" /
//                     -lB "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\FLASH_128KB_PFLASH\List\" -o          /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\FLASH_128KB_PFLASH\Obj\"  /
//                    --no_cse --no_unroll --no_inline --no_code_motion       /
//                    --no_tbaa --no_clustering --no_scheduling --debug       /
//                    --endian=little --cpu=Cortex-M4 -e --fpu=None           /
//                    --dlib_config "C:\Program Files\IAR Systems\Embedded    /
//                    Workbench 6.0_5\arm\INC\c\DLib_Config_Normal.h" -I      /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\common\" -I  /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\cpu\" -I     /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\cpu\headers\ /
//                    " -I "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\drivers\uart\" -I        /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\drivers\mcg\ /
//                    " -I "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\drivers\wdog\" -I        /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\drivers\rcm\ /
//                    " -I "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\drivers\lptmr\" -I       /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\platforms\"  /
//                    -I "D:\Profiles\b01252\My Documents\Freescale\P0\softwa /
//                    re\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50 /
//                    MHz_sc\build\iar\TWRK20D50M_Demo\..\" -I                /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\projects\TWR /
//                    K20D50M_Demo\" -I "D:\Profiles\b01252\My                /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \dma\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \adc16\" -I "D:\Profiles\b01252\My                      /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \i2c\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \tsi\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \adc_test\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \angle_calculation\" -I "D:\Profiles\b01252\My          /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \buzzer\" -I "D:\Profiles\b01252\My                     /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \fft_test\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \irda_test\" -I "D:\Profiles\b01252\My                  /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \cmt_test\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \protocol\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \task_mgr\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \TWRK20_specific\" -I "D:\Profiles\b01252\My            /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \rtc\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\CMSIS\DSP_Lib\Lib\interm /
//                    ediateFiles\" -I "D:\Profiles\b01252\My                 /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\CMSIS\DSP_Lib\Include\"  /
//                    -I "D:\Profiles\b01252\My Documents\Freescale\P0\softwa /
//                    re\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50 /
//                    MHz_sc\build\iar\TWRK20D50M_Demo\..\..\..\src\CMSIS\CM4 /
//                    \DeviceSupport\ARM\ARMCM4\" -I "D:\Profiles\b01252\My   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\CMSIS\CM4\CoreSupport\"  /
//                    -I "D:\Profiles\b01252\My Documents\Freescale\P0\softwa /
//                    re\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50 /
//                    MHz_sc\build\iar\TWRK20D50M_Demo\..\..\..\src\CMSIS\CM4 /
//                    \CoreSupportLiker Options-Library\" -I                  /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\CMSIS\DSP_Li /
//                    b\Lib\intermediateFiles\arm_cortexM4_math.lib\" -I      /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\build\" -Ol      /
//                    --use_c++_inline -I "C:\Program Files\IAR               /
//                    Systems\Embedded Workbench 6.0_5\arm\CMSIS\Include\"    /
//                    -D ARM_MATH_CM4                                         /
//    List file    =  D:\Profiles\b01252\My Documents\Freescale\P0\software\s /
//                    ample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_ /
//                    sc\build\iar\TWRK20D50M_Demo\FLASH_128KB_PFLASH\List\pr /
//                    otocol.s                                                /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME protocol

        #define SHT_PROGBITS 0x1

        EXTERN DMA_errorCount
        EXTERN HELPMSG
        EXTERN TouchEvent
        EXTERN adc_buffer
        EXTERN base_time125m
        EXTERN clap_counter
        EXTERN clap_energy
        EXTERN clap_peak_energy
        EXTERN cmt_init
        EXTERN cmt_tx_data
        EXTERN current_time
        EXTERN display_fft_info
        EXTERN dmaIsrCount
        EXTERN enable_irq
        EXTERN input_rise
        EXTERN irda_get_char
        EXTERN irda_test_init
        EXTERN lcd_print
        EXTERN make_argv
        EXTERN median
        EXTERN median_energy
        EXTERN peak_table
        EXTERN printf
        EXTERN ptr_next_task
        EXTERN putchar
        EXTERN rfft128Magnitud
        EXTERN seconds_count
        EXTERN set_date
        EXTERN set_time
        EXTERN sscanf
        EXTERN strcasecmp
        EXTERN strcpy
        EXTERN ti_test_adc
        EXTERN ti_test_leds
        EXTERN tone
        EXTERN uif_cmd_help
        EXTERN xy_angle
        EXTERN xy_mag
        EXTERN xz_angle
        EXTERN xz_mag
        EXTERN yz_angle
        EXTERN yz_mag

        PUBLIC BANNER
        PUBLIC INVCMD
        PUBLIC PROMPT
        PUBLIC SYNTAX
        PUBLIC UIF_CMDTAB
        PUBLIC UIF_NUM_CMD
        PUBLIC UIF_NUM_SETCMD
        PUBLIC UIF_SETCMDTAB
        PUBLIC arr_medianas2
        PUBLIC arr_medianasClap
        PUBLIC auxdisp1
        PUBLIC get_line2
        PUBLIC irda_tx_counter
        PUBLIC max_adc
        PUBLIC median_adc
        PUBLIC myCmdline1
        PUBLIC pfunc
        PUBLIC run_cmd_not_blocking
        PUBLIC uart_app_init
        PUBLIC uif_cmd_date
        PUBLIC uif_cmd_disp
        PUBLIC uif_cmd_time
        PUBLIC vfnUART_Rx_Isrv
        PUBLIC vfn_tsk_accel
        PUBLIC vfn_tsk_adc
        PUBLIC vfn_tsk_buttons
        PUBLIC vfn_tsk_leds
        PUBLIC vfn_tsk_null
        PUBLIC vfn_tsk_rtc
        PUBLIC vfn_tst_adc_buf
        PUBLIC vfn_tst_clap_detec
        PUBLIC vfn_tst_dma_stat
        PUBLIC vfn_tst_fft
        PUBLIC vfn_tst_harmonic
        PUBLIC vfn_tst_irda
        PUBLIC vfn_tst_tone_detec

// D:\Profiles\b01252\My Documents\Freescale\P0\software\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\src\projects\TWRK20D50M_Demo\protocol\protocol.c
//    1 /****************************************************************************************************/
//    2 /**
//    3 Copyright (c) 2011 Freescale Semiconductor
//    4 Freescale Confidential Proprietary
//    5 \file    protocol.c
//    6 \brief   check for sci input data and process command
//    7 \brief   command format >Tnn CR 
//    8 \author     
//    9 \author     
//   10 \version    1.0
//   11 \date       Sep 26, 2011
//   12 */
//   13 #include "common.h"
//   14 #include "uif.h"
//   15 #include "stdio.h"
//   16 #include "uart.h"
//   17 
//   18 
//   19 #include "TWR_K20D50M_DEF.h"
//   20 #include "buzzer.h"
//   21 #include "rtc.h"
//   22 #include "hal_i2c.h"
//   23 #include "hal_dev_mma8451.h"
//   24 #include "adc_test.h"
//   25 #include "angle_cal.h"
//   26 #include "fft_test.h"
//   27 #include "irda_test.h"
//   28 #include "protocol.h"
//   29 #include "median.h"
//   30 #include "task_mgr.h"
//   31 #include "irda_test.h"
//   32 #include "tsi.h"
//   33 #include "cmt_test.h"
//   34 
//   35 
//   36 /* Test functions */
//   37 
//   38 void vfn_tsk_rtc(void);
//   39 void vfn_tsk_buttons(void);
//   40 void vfn_tsk_adc(void);
//   41 void vfn_tsk_accel(void);
//   42 void vfn_tsk_accel(void);
//   43 void vfn_tst_dma_stat(void);
//   44 void vfn_tst_fft(void);
//   45 void vfn_tst_harmonic(void);
//   46 void vfn_tst_adc_buf(void);
//   47 void vfn_tst_irda(void);
//   48 void vfn_tst_tone_detec(void);
//   49 void vfn_tsk_null(void);
//   50 void vfn_tsk_leds(void);
//   51 void vfn_tst_clap_detec(void);
//   52 

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   53 char auxdisp1;
auxdisp1:
        DS8 1
//   54 

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   55 void (*pfunc[])(void)=
pfunc:
        DATA
        DC32 vfn_tsk_null, vfn_tsk_rtc, vfn_tsk_buttons, vfn_tsk_leds
        DC32 vfn_tsk_accel, vfn_tst_irda, vfn_tst_adc_buf, vfn_tst_harmonic
        DC32 vfn_tst_dma_stat, vfn_tst_clap_detec, vfn_tst_fft
        DC32 vfn_tst_tone_detec
//   56  {
//   57    vfn_tsk_null, //0
//   58    vfn_tsk_rtc,  //1   32 KHz
//   59    vfn_tsk_buttons, //2  SW1, SW 2 y electrodes
//   60    vfn_tsk_leds, //3  
//   61    vfn_tsk_accel,  //4
//   62    vfn_tst_irda,     //5
//   63    vfn_tst_adc_buf,  //6
//   64    
//   65    vfn_tst_harmonic, //7
//   66    vfn_tst_dma_stat, //8
//   67    vfn_tst_clap_detec,//9
//   68    vfn_tst_fft,     //10
//   69    vfn_tst_tone_detec, //11
//   70  };
//   71 
//   72 
//   73 #define DISPLAY_FLAG1  input_rise(base_time125m&0x1,&auxdisp1)
//   74 #define DISPLAY_FLAG  input_rise(base_time125m&0x2,&auxdisp1)
//   75 
//   76 extern void display_mode(char mode);

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   77 char irda_tx_counter;
irda_tx_counter:
        DS8 1
//   78 
//   79 

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   80 struct tipo_mediana arr_medianas2[2];
arr_medianas2:
        DS8 72
//   81 

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   82 struct tipo_mediana arr_medianasClap[2];
arr_medianasClap:
        DS8 72
//   83 

        SECTION `.bss`:DATA:REORDER:NOROOT(1)
//   84 uint16 median_adc;
median_adc:
        DS8 2

        SECTION `.bss`:DATA:REORDER:NOROOT(1)
//   85 uint16 max_adc;
max_adc:
        DS8 2
//   86 
//   87 

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   88 char myCmdline1 [80];
myCmdline1:
        DS8 80

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "help">`:
        DATA
        DC8 "help"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "Display this help">`:
        DATA
        DC8 "Display this help"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "<>">`:
        DATA
        DC8 "<>"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "Disp">`:
        DATA
        DC8 "Disp"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "select display fucntion">`:
        DATA
        DC8 "select display fucntion"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "disp nn">`:
        DATA
        DC8 "disp nn"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "time">`:
        DATA
        DC8 "time"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "select set/display time">`:
        DATA
        DC8 "select set/display time"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "time hr min sec ">`:
        DATA
        DC8 "time hr min sec "
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "date">`:
        DATA
        DC8 "date"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "select set/display date">`:
        DATA
        DC8 "select set/display date"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "date dd mm yyyy ">`:
        DATA
        DC8 "date dd mm yyyy "
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "sysclk">`:
        DATA
        DC8 "sysclk"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(0)
`?<Constant "">`:
        DATA
        DC8 ""

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
        DATA
        DC8 "%i"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r Available function...">`:
        DATA
        DC8 "\012\015 Available functions: disp n"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 0: restore display">`:
        DATA
        DC8 "\012\015 0: restore display"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 1: rtc  nnn       ...">`:
        DATA
        DC8 "\012\015 1: rtc  nnn        ; shows RTC seconds"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 2: Electrodes/sw B...">`:
        DATA
        DC8 0AH, 0DH, 20H, 32H, 3AH, 20H, 45H, 6CH
        DC8 65H, 63H, 74H, 72H, 6FH, 64H, 65H, 73H
        DC8 2FH, 73H, 77H, 20H, 42H, 20H, 6EH, 6EH
        DC8 20H, 3BH, 20H, 73H, 68H, 6FH, 77H, 73H
        DC8 20H, 77H, 68H, 69H, 63H, 68H, 20H, 45H
        DC8 6CH, 65H, 63H, 74H, 72H, 6FH, 64H, 65H
        DC8 2FH, 62H, 75H, 74H, 74H, 6FH, 6EH, 20H
        DC8 75H, 73H, 20H, 70H, 72H, 65H, 73H, 73H
        DC8 65H, 64H, 20H, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 3: leds         Le...">`:
        DATA
        DC8 "\012\015 3: leds         Led nn "
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 4: Accelerometer  ...">`:
        DATA
        DC8 0AH, 0DH, 20H, 34H, 3AH, 20H, 41H, 63H
        DC8 63H, 65H, 6CH, 65H, 72H, 6FH, 6DH, 65H
        DC8 74H, 65H, 72H, 20H, 20H, 53H, 68H, 6FH
        DC8 77H, 20H, 20H, 5BH, 6DH, 61H, 67H, 6EH
        DC8 69H, 74H, 75H, 64H, 65H, 5DH, 20H, 61H
        DC8 6EH, 64H, 20H, 3CH, 61H, 6EH, 67H, 6CH
        DC8 65H, 20H, 69H, 6EH, 20H, 64H, 65H, 67H
        DC8 72H, 65H, 65H, 73H, 2AH, 31H, 30H, 20H
        DC8 0
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 5: irda  IR port: ...">`:
        DATA
        DC8 "\012\015 5: irda  IR port:  Tx =   2,     Rx=   0 "
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 6: ADC Potentiomet...">`:
        DATA
        DC8 "\012\015 6: ADC Potentiometer  POT = 1425"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 7: FFT harmonics  ...">`:
        DATA
        DC8 0AH, 0DH, 20H, 37H, 3AH, 20H, 46H, 46H
        DC8 54H, 20H, 68H, 61H, 72H, 6DH, 6FH, 6EH
        DC8 69H, 63H, 73H, 20H, 20H, 66H, 66H, 74H
        DC8 5BH, 20H, 68H, 61H, 72H, 6DH, 6FH, 6EH
        DC8 69H, 63H, 20H, 4EH, 5DH, 4DH, 61H, 63H
        DC8 67H, 6EH, 69H, 74H, 75H, 64H, 65H, 20H
        DC8 4EH, 2CH, 2EH, 2EH, 2EH, 2EH, 20H, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 8: DMA  transactio...">`:
        DATA
        DC8 "\012\015 8: DMA  transactions, errors "
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r 9: Clap analysis ">`:
        DATA
        DC8 "\012\015 9: Clap analysis "
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
        DATA
        DC8 "\012\015"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r time   hr mm ss">`:
        DATA
        DC8 "\012\015 time   hr mm ss"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "time: %02i:%02i:%02i ...">`:
        DATA
        DC8 "time: %02i:%02i:%02i  %02i/%02i/%02i "
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r error format date ">`:
        DATA
        DC8 "\012\015 error format date "
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\rformat error, use d...">`:
        DATA
        DC8 "\012\015format error, use date dd mm yyyy"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r LEDs %02x  ">`:
        DATA
        DC8 "\015 LEDs %02x  "
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r rtc %4i  ;   elapse...">`:
        DATA
        DC8 "\015 rtc %4i  ;   elapsed time with Vbat %6i"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r B %02x">`:
        DATA
        DC8 "\015 B %02x"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r adc = %04i, med= %0...">`:
        DATA
        DC8 "\015 adc = %04i, med= %04i , Max = %i"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r xy=[%3d]<%3d,  xz=[...">`:
        DATA
        DC8 "\015 xy=[%3d]<%3d,  xz=[%3d]<%3d,  yz =[%3d]<%3d "
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r Status DMA %i,  %i,   ">`:
        DATA
        DC8 "\015 Status DMA %i,  %i,   "
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r fft">`:
        DATA
        DC8 "\015 fft"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "[%2i]%4i,">`:
        DATA
        DC8 "[%2i]%4i,"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r ADC  POT = %05i  ;">`:
        DATA
        DC8 "\015 ADC  POT = %05i  ;"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r IR port:  Tx = %03i...">`:
        DATA
        DC8 "\015 IR port:  Tx = %03i,     Rx= %03i ;"
        DC8 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r Max ">`:
        DATA
        DC8 "\015 Max "
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant " %i,">`:
        DATA
        DC8 " %i,"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\r Clap Peak energy=%7...">`:
        DATA
        DC8 0DH, 20H, 43H, 6CH, 61H, 70H, 20H, 50H
        DC8 65H, 61H, 6BH, 20H, 65H, 6EH, 65H, 72H
        DC8 67H, 79H, 3DH, 25H, 37H, 69H, 20H, 20H
        DC8 65H, 6EH, 65H, 72H, 67H, 79H, 3DH, 25H
        DC8 37H, 69H, 20H, 20H, 20H, 20H, 6DH, 65H
        DC8 64H, 69H, 61H, 6EH, 20H, 25H, 35H, 69H
        DC8 20H, 63H, 6CH, 61H, 70H, 20H, 63H, 6FH
        DC8 75H, 6EH, 74H, 3DH, 20H, 25H, 33H, 69H
        DC8 0
        DC8 0, 0, 0
//   89 extern char cmdline2 [];

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//   90 const char SYNTAX[] = "Syntax error";
SYNTAX:
        DATA
        DC8 "Syntax error"
        DC8 0, 0, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//   91 const char INVCMD[] = "Invalid command";
INVCMD:
        DATA
        DC8 "Invalid command"
//   92 

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//   93 const char BANNER[] = "\n TWR-K20D50M Test 01 \n";
BANNER:
        DATA
        DC8 "\012 TWR-K20D50M Test 01 \012"

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//   94 const char PROMPT[] = "\r\n K20_Demo >";
PROMPT:
        DATA
        DC8 "\015\012 K20_Demo >"
        DC8 0, 0
//   95 void   run_cmd_not_blocking(char *line);
//   96 
//   97 /*UIF Function prototypes */
//   98 void uif_cmd_disp (int argc, char **argv );
//   99 void lcd_print (int argc, char **argv ); //Print a message in the LCD
//  100 void uif_cmd_time (int argc, char **argv );
//  101 void uif_cmd_date (int argc, char **argv );
//  102 
//  103 void   print_lcd_status(void);
//  104 

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//  105 UIF_CMD UIF_CMDTAB[] =
UIF_CMDTAB:
        DATA
        DC32 `?<Constant "help">`, 0, 1, 0, uif_cmd_help
        DC32 `?<Constant "Display this help">`, `?<Constant "<>">`
        DC32 `?<Constant "Disp">`, 0, 1, 0, uif_cmd_disp
        DC32 `?<Constant "select display fucntion">`, `?<Constant "disp nn">`
        DC32 `?<Constant "time">`, 0, 4, 0, uif_cmd_time
        DC32 `?<Constant "select set/display time">`
        DC32 `?<Constant "time hr min sec ">`, `?<Constant "date">`, 0, 4, 0
        DC32 uif_cmd_date, `?<Constant "select set/display date">`
        DC32 `?<Constant "date dd mm yyyy ">`
//  106 {
//  107          {  "help" ,0 ,1 ,0 ,uif_cmd_help ,"Display this help" ,"<>"  },
//  108          {  "Disp" ,0 ,1 ,0 ,uif_cmd_disp ,"select display fucntion" ,"disp nn"  },
//  109          {  "time" ,0 ,4 ,0 ,uif_cmd_time ,"select set/display time" ,"time hr min sec "  },
//  110          {  "date" ,0 ,4 ,0 ,uif_cmd_date ,"select set/display date" ,"date dd mm yyyy "  },
//  111 
//  112   };
//  113 
//  114 

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//  115 UIF_SETCMD UIF_SETCMDTAB[] =
UIF_SETCMDTAB:
        DATA
        DC32 `?<Constant "sysclk">`, 0, 1, lcd_print, `?<Constant "">`
//  116 {
//  117     {"sysclk", 0,1,lcd_print,""},
//  118 };
//  119 
//  120 
//  121 

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//  122 const int UIF_NUM_CMD    = UIF_CMDTAB_SIZE;
UIF_NUM_CMD:
        DATA
        DC32 4

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
//  123 const int UIF_NUM_SETCMD = UIF_SETCMDTAB_SIZE;
UIF_NUM_SETCMD:
        DATA
        DC32 1
//  124 
//  125 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  126 void
//  127 uif_cmd_disp (int argc, char **argv )
//  128  {
uif_cmd_disp:
        PUSH     {R7,LR}
        MOVS     R3,R1
//  129     uint32  result;
//  130    
//  131     if (argc>1)
        CMP      R0,#+2
        BLT.N    ??uif_cmd_disp_0
//  132     {  
//  133      sscanf(argv[1],"%i",&result);
        ADD      R2,SP,#+0
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R3, #+4]
        BL       sscanf
//  134      if (result>sizeof(pfunc)) result=0;
        LDR      R0,[SP, #+0]
        CMP      R0,#+49
        BCC.N    ??uif_cmd_disp_1
        MOVS     R0,#+0
        STR      R0,[SP, #+0]
//  135       next_task(*pfunc[result]);
??uif_cmd_disp_1:
        LDR      R0,[SP, #+0]
        LDR.W    R1,??DataTable18
        LDR      R0,[R1, R0, LSL #+2]
        LDR.W    R1,??DataTable18_1
        STR      R0,[R1, #+0]
        B.N      ??uif_cmd_disp_2
//  136     }
//  137     else
//  138      {
//  139    printf ("\n\r Available functions: disp n");
??uif_cmd_disp_0:
        LDR.W    R0,??DataTable18_2
        BL       printf
//  140    printf ("\n\r 0: restore display"); //0
        LDR.W    R0,??DataTable18_3
        BL       printf
//  141    printf ("\n\r 1: rtc  nnn        ; shows RTC seconds");  //1   32 KHz
        LDR.W    R0,??DataTable18_4
        BL       printf
//  142    printf ("\n\r 2: Electrodes/sw B nn ; shows which Electrode/button us pressed "); //2  SW1, SW 2 y electrodes
        LDR.W    R0,??DataTable18_5
        BL       printf
//  143    printf ("\n\r 3: leds         Led nn "); //3  
        LDR.W    R0,??DataTable18_6
        BL       printf
//  144    printf ("\n\r 4: Accelerometer  Show  [magnitude] and <angle in degrees*10 ");  //4
        LDR.W    R0,??DataTable18_7
        BL       printf
//  145    printf ("\n\r 5: irda  IR port:  Tx =   2,     Rx=   0 ");    //5
        LDR.W    R0,??DataTable18_8
        BL       printf
//  146    printf ("\n\r 6: ADC Potentiometer  POT = 1425");  //6  
        LDR.W    R0,??DataTable18_9
        BL       printf
//  147    printf ("\n\r 7: FFT harmonics  fft[ harmonic N]Macgnitude N,.... "); //7
        LDR.W    R0,??DataTable18_10
        BL       printf
//  148    printf ("\n\r 8: DMA  transactions, errors "); //8
        LDR.W    R0,??DataTable18_11
        BL       printf
//  149    printf ("\n\r 9: Clap analysis "); //8
        LDR.W    R0,??DataTable18_12
        BL       printf
//  150    printf ("\n\r"); //8
        ADR.N    R0,??DataTable6  ;; 0x0A, 0x0D, 0x00, 0x00
        BL       printf
//  151 //   printf ("\n\r 9 vfn_tst_fft");     //9
//  152 //   printf ("\n\r 10 vfn_tst_tone_detec, //10      
//  153      }
//  154     }
??uif_cmd_disp_2:
        POP      {R0,PC}          ;; return
//  155 
//  156 
//  157 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  158 void
//  159 uif_cmd_time (int argc, char **argv )
//  160  {
uif_cmd_time:
        PUSH     {R4-R7,LR}
        SUB      SP,SP,#+20
        MOVS     R4,R1
//  161     uint32  result;
//  162     char sec,min,hr,error=0;
        MOVS     R7,#+0
//  163    
//  164     if (argc > 3)
        CMP      R0,#+4
        BLT.N    ??uif_cmd_time_0
//  165     {  
//  166       sscanf(argv[1],"%i",&result);
        ADD      R2,SP,#+12
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R4, #+4]
        BL       sscanf
//  167        hr = result;
        LDR      R6,[SP, #+12]
//  168        if (hr>23) error = 1;
        UXTB     R6,R6            ;; ZeroExt  R6,R6,#+24,#+24
        CMP      R6,#+24
        BCC.N    ??uif_cmd_time_1
        MOVS     R7,#+1
//  169       
//  170       sscanf(argv[2],"%i",&result);
??uif_cmd_time_1:
        ADD      R2,SP,#+12
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R4, #+8]
        BL       sscanf
//  171       min = result;
        LDR      R5,[SP, #+12]
//  172       if (min>59) error = 1;
        UXTB     R5,R5            ;; ZeroExt  R5,R5,#+24,#+24
        CMP      R5,#+60
        BCC.N    ??uif_cmd_time_2
        MOVS     R7,#+1
//  173 
//  174       sscanf(argv[3],"%i",&result);      
??uif_cmd_time_2:
        ADD      R2,SP,#+12
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R4, #+12]
        BL       sscanf
//  175       sec = result;
        LDR      R3,[SP, #+12]
//  176       if (sec>59) error = 1;
        UXTB     R3,R3            ;; ZeroExt  R3,R3,#+24,#+24
        CMP      R3,#+60
        BCC.N    ??uif_cmd_time_3
        MOVS     R7,#+1
//  177       if (!error)set_time(current_time, hr, min, sec);
??uif_cmd_time_3:
        UXTB     R7,R7            ;; ZeroExt  R7,R7,#+24,#+24
        CMP      R7,#+0
        BNE.N    ??uif_cmd_time_4
        UXTB     R3,R3            ;; ZeroExt  R3,R3,#+24,#+24
        MOVS     R2,R5
        UXTB     R2,R2            ;; ZeroExt  R2,R2,#+24,#+24
        MOVS     R1,R6
        UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        BL       set_time
        B.N      ??uif_cmd_time_4
//  178     }
//  179     else
//  180     {
//  181       printf ("\n\r time   hr mm ss");
??uif_cmd_time_0:
        LDR.W    R0,??DataTable18_14
        BL       printf
//  182       
//  183     }
//  184       printf("time: %02i:%02i:%02i  %02i/%02i/%02i ",current_time->hours, current_time->minutes, current_time->seconds,
//  185       current_time->day, current_time->month, current_time->year );    
??uif_cmd_time_4:
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDR      R0,[R0, #+8]
        STR      R0,[SP, #+8]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R0,[R0, #+5]
        STR      R0,[SP, #+4]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R0,[R0, #+4]
        STR      R0,[SP, #+0]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R3,[R0, #+0]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R2,[R0, #+1]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R1,[R0, #+2]
        LDR.W    R0,??DataTable18_15
        BL       printf
//  186  }
        ADD      SP,SP,#+20
        POP      {R4-R7,PC}       ;; return
//  187 
//  188 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  189 void
//  190 uif_cmd_date (int argc, char **argv )
//  191  {
uif_cmd_date:
        PUSH     {R4-R7,LR}
        SUB      SP,SP,#+20
        MOVS     R4,R1
//  192     uint32  result;
//  193     char day, month, error=0;
        MOVS     R7,#+0
//  194     int year;
//  195    
//  196     if (argc > 3)
        CMP      R0,#+4
        BLT.N    ??uif_cmd_date_0
//  197     {  
//  198       sscanf(argv[1],"%i",&result);
        ADD      R2,SP,#+12
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R4, #+4]
        BL       sscanf
//  199       day = result;
        LDR      R5,[SP, #+12]
//  200       if (day<1 || day>31) error = 1;
        SUBS     R0,R5,#+1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+31
        BCC.N    ??uif_cmd_date_1
        MOVS     R7,#+1
//  201 
//  202       sscanf(argv[2],"%i",&result);
??uif_cmd_date_1:
        ADD      R2,SP,#+12
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R4, #+8]
        BL       sscanf
//  203       month = result;
        LDR      R6,[SP, #+12]
//  204       if (month<1 || month>12) error = 1;
        SUBS     R0,R6,#+1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+12
        BCC.N    ??uif_cmd_date_2
        MOVS     R7,#+1
//  205 
//  206       sscanf(argv[3],"%i",&result);      
??uif_cmd_date_2:
        ADD      R2,SP,#+12
        ADR.N    R1,??DataTable2  ;; 0x25, 0x69, 0x00, 0x00
        LDR      R0,[R4, #+12]
        BL       sscanf
//  207       year = result;
        LDR      R3,[SP, #+12]
//  208       if (year<2000 || year>2100) error = 1;
        SUBS     R0,R3,#+2000
        CMP      R0,#+101
        BCC.N    ??uif_cmd_date_3
        MOVS     R7,#+1
//  209       if (!error) set_date(current_time, day, month, year);
??uif_cmd_date_3:
        UXTB     R7,R7            ;; ZeroExt  R7,R7,#+24,#+24
        CMP      R7,#+0
        BNE.N    ??uif_cmd_date_4
        MOVS     R2,R6
        UXTB     R2,R2            ;; ZeroExt  R2,R2,#+24,#+24
        MOVS     R1,R5
        UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        BL       set_date
        B.N      ??uif_cmd_date_5
//  210       else printf("\n\r error format date ");
??uif_cmd_date_4:
        LDR.W    R0,??DataTable18_16
        BL       printf
        B.N      ??uif_cmd_date_5
//  211     }
//  212     else
//  213     {
//  214       printf ("\n\rformat error, use date dd mm yyyy");
??uif_cmd_date_0:
        LDR.W    R0,??DataTable18_17
        BL       printf
//  215       
//  216     }
//  217       printf("time: %02i:%02i:%02i  %02i/%02i/%02i ",current_time->hours, current_time->minutes, current_time->seconds,
//  218       current_time->day, current_time->month, current_time->year );    
??uif_cmd_date_5:
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDR      R0,[R0, #+8]
        STR      R0,[SP, #+8]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R0,[R0, #+5]
        STR      R0,[SP, #+4]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R0,[R0, #+4]
        STR      R0,[SP, #+0]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R3,[R0, #+0]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R2,[R0, #+1]
        LDR.W    R0,??DataTable18_13
        LDR      R0,[R0, #+0]
        LDRB     R1,[R0, #+2]
        LDR.W    R0,??DataTable18_15
        BL       printf
//  219  }
        ADD      SP,SP,#+20
        POP      {R4-R7,PC}       ;; return

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable2:
        DC8      0x25, 0x69, 0x00, 0x00
//  220 
//  221 
//  222 
//  223 #include "common.h"
//  224 
//  225 
//  226 
//  227 
//  228 
//  229 
//  230 /****
//  231 
//  232 Return 0 
//  233 Return 1 if line is complete
//  234 
//  235 line is the buffer where the command is received
//  236 
//  237 ****************************************************************/

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  238 char 
//  239 get_line2 (char ch, char *line)
//  240 {
get_line2:
        PUSH     {R7,LR}
//  241   static int pos;     
//  242     if (ch == 27 /* LF/NL */)
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+27
        BNE.N    ??get_line2_0
//  243      {line[0] = 'D';
        MOVS     R2,#+68
        STRB     R2,[R1, #+0]
//  244       line[1] = 'i';
        MOVS     R2,#+105
        STRB     R2,[R1, #+1]
//  245       line[2] = 's';
        MOVS     R2,#+115
        STRB     R2,[R1, #+2]
//  246       line[3] = 'p';
        MOVS     R2,#+112
        STRB     R2,[R1, #+3]
//  247       line[4] = ' ';      
        MOVS     R2,#+32
        STRB     R2,[R1, #+4]
//  248       line[5] = '0';
        MOVS     R2,#+48
        STRB     R2,[R1, #+5]
//  249       pos = 6;
        LDR.W    R2,??DataTable18_18
        MOVS     R3,#+6
        STR      R3,[R2, #+0]
//  250      }
//  251     if ( (ch != 0x0D /* CR */) &&
//  252          (ch != 0x0A /* LF/NL */) &&
//  253          (ch != 27 /* LF/NL */) &&  
//  254          (pos < UIF_MAX_LINE))
??get_line2_0:
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+13
        BEQ.N    ??get_line2_1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+10
        BEQ.N    ??get_line2_1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+27
        BEQ.N    ??get_line2_1
        LDR.W    R2,??DataTable18_18
        LDR      R2,[R2, #+0]
        CMP      R2,#+80
        BGE.N    ??get_line2_1
//  255     {
//  256         switch (ch)
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        MOVS     R2,R0
        CMP      R2,#+8
        BEQ.N    ??get_line2_2
        CMP      R2,#+127
        BNE.N    ??get_line2_3
//  257         {
//  258             case 0x08:      /* Backspace */
//  259             case 0x7F:      /* Delete */
//  260                 if (pos > 0)
??get_line2_2:
        LDR.W    R0,??DataTable18_18
        LDR      R0,[R0, #+0]
        CMP      R0,#+1
        BLT.N    ??get_line2_4
//  261                 {
//  262                     pos -= 1;
        LDR.W    R0,??DataTable18_18
        LDR      R0,[R0, #+0]
        SUBS     R0,R0,#+1
        LDR.W    R1,??DataTable18_18
        STR      R0,[R1, #+0]
//  263                     out_char(0x08);    /* backspace */
        MOVS     R0,#+8
        BL       putchar
//  264                     out_char(' ');
        MOVS     R0,#+32
        BL       putchar
//  265                     out_char(0x08);    /* backspace */
        MOVS     R0,#+8
        BL       putchar
//  266                 }
//  267                 break;
??get_line2_4:
        B.N      ??get_line2_5
//  268             default:
//  269                 if ((pos+1) < UIF_MAX_LINE)
??get_line2_3:
        LDR.W    R2,??DataTable18_18
        LDR      R2,[R2, #+0]
        ADDS     R2,R2,#+1
        CMP      R2,#+80
        BGE.N    ??get_line2_6
//  270                 {
//  271                     if ((ch > 0x1f) && (ch < 0x80))
        SUBS     R2,R0,#+32
        UXTB     R2,R2            ;; ZeroExt  R2,R2,#+24,#+24
        CMP      R2,#+96
        BCS.N    ??get_line2_6
//  272                     {
//  273                         line[pos++] = (char)ch;
        LDR.W    R2,??DataTable18_18
        LDR      R2,[R2, #+0]
        STRB     R0,[R2, R1]
        LDR.W    R1,??DataTable18_18
        LDR      R1,[R1, #+0]
        ADDS     R1,R1,#+1
        LDR.W    R2,??DataTable18_18
        STR      R1,[R2, #+0]
//  274                         out_char((char)ch);
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        BL       putchar
//  275                     }
//  276                 }
//  277                 break;
//  278         }
//  279     }
//  280     else
//  281     {  
//  282      line[pos] = '\0';
//  283      out_char(0x0D);    /* CR */
//  284      out_char(0x0A);    /* LF */
//  285      pos=0; // prepare for next command
//  286      return 1;
//  287     } 
//  288    return 0; 
??get_line2_6:
??get_line2_5:
        MOVS     R0,#+0
        B.N      ??get_line2_7
??get_line2_1:
        LDR.W    R0,??DataTable18_18
        LDR      R0,[R0, #+0]
        MOVS     R2,#+0
        STRB     R2,[R0, R1]
        MOVS     R0,#+13
        BL       putchar
        MOVS     R0,#+10
        BL       putchar
        LDR.W    R0,??DataTable18_18
        MOVS     R1,#+0
        STR      R1,[R0, #+0]
        MOVS     R0,#+1
??get_line2_7:
        POP      {R1,PC}          ;; return
//  289 }

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
??pos:
        DS8 4
//  290 
//  291 /*
//  292   Check if there a character from UART
//  293   if a character is available procces it
//  294   if a line is complete
//  295 */

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  296 void
//  297 run_cmd_not_blocking (char *cmdline1)
//  298 {
run_cmd_not_blocking:
        PUSH     {R4,R5,LR}
        SUB      SP,SP,#+124
        MOVS     R5,R0
//  299     /*
//  300      * Global array of pointers to emulate C argc,argv interface
//  301      */
//  302     int argc;
//  303     char cmdline2[80];
//  304     char *argv[UIF_MAX_ARGS + 1];   /* one extra for null terminator */
//  305     
//  306     
//  307     if (!(argc = make_argv(cmdline1,argv)))
        ADD      R1,SP,#+0
        MOVS     R0,R5
        BL       make_argv
        MOVS     R4,R0
        CMP      R4,#+0
        BNE.N    ??run_cmd_not_blocking_0
//  308     {
//  309         /* no command entered, just a blank line */
//  310         strcpy(cmdline1,cmdline2);
        ADD      R1,SP,#+44
        MOVS     R0,R5
        BL       strcpy
//  311         argc = make_argv(cmdline1,argv);
        ADD      R1,SP,#+0
        MOVS     R0,R5
        BL       make_argv
        MOVS     R4,R0
//  312     }
//  313     cmdline2[0] = '\0';
??run_cmd_not_blocking_0:
        MOVS     R0,#+0
        STRB     R0,[SP, #+44]
//  314 
//  315     if (argc)
        CMP      R4,#+0
        BEQ.N    ??run_cmd_not_blocking_1
//  316     {
//  317         int i;
//  318         for (i = 0; i < UIF_NUM_CMD; i++)
        MOVS     R5,#+0
        B.N      ??run_cmd_not_blocking_2
??run_cmd_not_blocking_3:
        ADDS     R5,R5,#+1
??run_cmd_not_blocking_2:
        LDR.W    R0,??DataTable18_19
        LDR      R0,[R0, #+0]
        CMP      R5,R0
        BGE.N    ??run_cmd_not_blocking_4
//  319         {
//  320             if (strcasecmp(UIF_CMDTAB[i].cmd,argv[0]) == 0)
        LDR      R1,[SP, #+0]
        MOVS     R0,#+28
        LDR.W    R2,??DataTable18_20
        MLA      R0,R0,R5,R2
        LDR      R0,[R0, #+0]
        BL       strcasecmp
        CMP      R0,#+0
        BNE.N    ??run_cmd_not_blocking_3
//  321             {
//  322                 if (((argc-1) >= UIF_CMDTAB[i].min_args) &&
//  323                     ((argc-1) <= UIF_CMDTAB[i].max_args))
        SUBS     R0,R4,#+1
        MOVS     R1,#+28
        LDR.W    R2,??DataTable18_20
        MLA      R1,R1,R5,R2
        LDR      R1,[R1, #+4]
        CMP      R0,R1
        BLT.N    ??run_cmd_not_blocking_5
        MOVS     R0,#+28
        LDR.W    R1,??DataTable18_20
        MLA      R0,R0,R5,R1
        LDR      R0,[R0, #+8]
        SUBS     R1,R4,#+1
        CMP      R0,R1
        BLT.N    ??run_cmd_not_blocking_5
//  324                 {
//  325                     if (UIF_CMDTAB[i].flags & UIF_CMD_FLAG_REPEAT)
        MOVS     R0,#+28
        LDR.W    R1,??DataTable18_20
        MLA      R0,R0,R5,R1
        LDRB     R0,[R0, #+12]
        LSLS     R0,R0,#+31
        BPL.N    ??run_cmd_not_blocking_6
//  326                     {
//  327                         strcpy(cmdline2,argv[0]);
        LDR      R1,[SP, #+0]
        ADD      R0,SP,#+44
        BL       strcpy
//  328                     }
//  329                     UIF_CMDTAB[i].func(argc,argv);
??run_cmd_not_blocking_6:
        ADD      R1,SP,#+0
        MOVS     R0,R4
        MOVS     R2,#+28
        LDR.W    R3,??DataTable18_20
        MLA      R2,R2,R5,R3
        LDR      R2,[R2, #+16]
        BLX      R2
//  330                     printf(PROMPT);
        LDR.W    R0,??DataTable18_21
        BL       printf
//  331                     return;
        B.N      ??run_cmd_not_blocking_7
//  332                 }
//  333                 else
//  334                 {
//  335                     printf(SYNTAX,argv[0]);
??run_cmd_not_blocking_5:
        LDR      R1,[SP, #+0]
        LDR.W    R0,??DataTable18_22
        BL       printf
//  336                     return;
        B.N      ??run_cmd_not_blocking_7
//  337                 }
//  338             }
//  339         }
//  340         printf(INVCMD,argv[0]);
??run_cmd_not_blocking_4:
        LDR      R1,[SP, #+0]
        LDR.W    R0,??DataTable18_23
        BL       printf
//  341         printf(HELPMSG);
        LDR.W    R0,??DataTable18_24
        BL       printf
//  342     }
//  343 }
??run_cmd_not_blocking_1:
??run_cmd_not_blocking_7:
        ADD      SP,SP,#+124
        POP      {R4,R5,PC}       ;; return
//  344 
//  345 
//  346 
//  347 /*
//  348   provides a UART RX service
//  349 */
//  350 
//  351 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  352 void vfnUART_Rx_Isrv(void)
//  353 {
vfnUART_Rx_Isrv:
        PUSH     {R7,LR}
//  354   char RxCh;
//  355     while (!(UART_S1_REG(TERM_PORT) & UART_S1_RDRF_MASK));  //  To clear proper flag
??vfnUART_Rx_Isrv_0:
        LDR.W    R0,??DataTable18_25  ;; 0x4006b004
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+26
        BPL.N    ??vfnUART_Rx_Isrv_0
//  356     /* Return the 8-bit data from the receiver */
//  357     RxCh = UART_D_REG(TERM_PORT);
        LDR.W    R0,??DataTable18_26  ;; 0x4006b007
        LDRB     R0,[R0, #+0]
//  358     if (get_line2(RxCh,myCmdline1)) run_cmd_not_blocking(myCmdline1);
        LDR.W    R1,??DataTable18_27
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        BL       get_line2
        CMP      R0,#+0
        BEQ.N    ??vfnUART_Rx_Isrv_1
        LDR.W    R0,??DataTable18_27
        BL       run_cmd_not_blocking
//  359   
//  360 }
??vfnUART_Rx_Isrv_1:
        POP      {R0,PC}          ;; return
//  361 
//  362 
//  363 /*
//  364 initialize UART to work with Reception interrupts
//  365 */
//  366 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  367 void  uart_app_init(void)
//  368 {
uart_app_init:
        PUSH     {R7,LR}
//  369     enable_irq(INT_UART1_RX_TX - 16);
        MOVS     R0,#+18
        BL       enable_irq
//  370     UART_C2_REG(TERM_PORT)|= UART_C2_RIE_MASK;
        LDR.W    R0,??DataTable18_28  ;; 0x4006b003
        LDRB     R0,[R0, #+0]
        ORRS     R0,R0,#0x20
        LDR.W    R1,??DataTable18_28  ;; 0x4006b003
        STRB     R0,[R1, #+0]
//  371 
//  372 }   
        POP      {R0,PC}          ;; return

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable6:
        DC8      0x0A, 0x0D, 0x00, 0x00
//  373 
//  374 /**************************************************/
//  375 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  376 void vfn_tsk_null(void)
//  377 {
//  378 };
vfn_tsk_null:
        BX       LR               ;; return
//  379 
//  380 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  381 void vfn_tsk_leds(void)
//  382 {
vfn_tsk_leds:
        PUSH     {R7,LR}
//  383   static char led_count;
//  384    // Pin multilplexing configuration  J7 ON,  J4 OFF
//  385   if (((PORTC_PCR7 & PORT_PCR_MUX_MASK)>>PORT_PCR_MUX_SHIFT)!= 1)
        LDR.W    R0,??DataTable18_29  ;; 0x4004b01c
        LDR      R0,[R0, #+0]
        UBFX     R0,R0,#+8,#+3
        CMP      R0,#+1
        BEQ.N    ??vfn_tsk_leds_0
//  386   {
//  387     PORTC_PCR7 &= ~PORT_PCR_MUX_MASK;  
        LDR.W    R0,??DataTable18_29  ;; 0x4004b01c
        LDR      R0,[R0, #+0]
        BICS     R0,R0,#0x700
        LDR.W    R1,??DataTable18_29  ;; 0x4004b01c
        STR      R0,[R1, #+0]
//  388     PORTC_PCR7 |= PORT_PCR_MUX(1);  // pin for   LED output
        LDR.W    R0,??DataTable18_29  ;; 0x4004b01c
        LDR      R0,[R0, #+0]
        MOV      R1,#+256
        ORRS     R0,R1,R0
        LDR.W    R1,??DataTable18_29  ;; 0x4004b01c
        STR      R0,[R1, #+0]
//  389    };
//  390   
//  391   ti_test_leds = 2000;
??vfn_tsk_leds_0:
        LDR.W    R0,??DataTable18_30
        MOV      R1,#+2000
        STRH     R1,[R0, #+0]
//  392   if (DISPLAY_FLAG)
        LDR.W    R1,??DataTable18_31
        LDR.W    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_leds_1
//  393   {
//  394     led_count++;
        LDR.W    R0,??DataTable18_33
        LDRB     R0,[R0, #+0]
        ADDS     R0,R0,#+1
        LDR.W    R1,??DataTable18_33
        STRB     R0,[R1, #+0]
//  395     printf("\r LEDs %02x  ",led_count);
        LDR.W    R0,??DataTable18_33
        LDRB     R1,[R0, #+0]
        LDR.W    R0,??DataTable18_34
        BL       printf
//  396     if  (led_count&0x01) LED1_ON;else LED1_OFF;  //Orange
        LDR.W    R0,??DataTable18_33
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+31
        BPL.N    ??vfn_tsk_leds_2
        LDR.W    R0,??DataTable18_35  ;; 0x400ff088
        LDR      R0,[R0, #+0]
        ORRS     R0,R0,#0x400
        LDR.W    R1,??DataTable18_35  ;; 0x400ff088
        STR      R0,[R1, #+0]
        B.N      ??vfn_tsk_leds_3
??vfn_tsk_leds_2:
        LDR.W    R0,??DataTable18_36  ;; 0x400ff084
        LDR      R0,[R0, #+0]
        ORRS     R0,R0,#0x400
        LDR.W    R1,??DataTable18_36  ;; 0x400ff084
        STR      R0,[R1, #+0]
//  397     if  (led_count&0x02) LED2_ON;else LED2_OFF;  //Yellow
??vfn_tsk_leds_3:
        LDR.W    R0,??DataTable18_33
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+30
        BPL.N    ??vfn_tsk_leds_4
        LDR.W    R0,??DataTable18_35  ;; 0x400ff088
        LDR      R0,[R0, #+0]
        MOV      R1,#+512
        ORRS     R0,R1,R0
        LDR.W    R1,??DataTable18_35  ;; 0x400ff088
        STR      R0,[R1, #+0]
        B.N      ??vfn_tsk_leds_5
??vfn_tsk_leds_4:
        LDR.W    R0,??DataTable18_36  ;; 0x400ff084
        LDR      R0,[R0, #+0]
        MOV      R1,#+512
        ORRS     R0,R1,R0
        LDR.W    R1,??DataTable18_36  ;; 0x400ff084
        STR      R0,[R1, #+0]
//  398     if  (led_count&0x04) LED4_ON;else LED4_OFF;  //blue
??vfn_tsk_leds_5:
        LDR.W    R0,??DataTable18_33
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+29
        BPL.N    ??vfn_tsk_leds_6
        LDR.W    R0,??DataTable18_36  ;; 0x400ff084
        LDR      R0,[R0, #+0]
        MOV      R1,#+256
        ORRS     R0,R1,R0
        LDR.W    R1,??DataTable18_36  ;; 0x400ff084
        STR      R0,[R1, #+0]
        B.N      ??vfn_tsk_leds_7
??vfn_tsk_leds_6:
        LDR.W    R0,??DataTable18_35  ;; 0x400ff088
        LDR      R0,[R0, #+0]
        MOV      R1,#+256
        ORRS     R0,R1,R0
        LDR.W    R1,??DataTable18_35  ;; 0x400ff088
        STR      R0,[R1, #+0]
//  399     if  (led_count&0x08) LED3_ON;else LED3_OFF;  //green
??vfn_tsk_leds_7:
        LDR.W    R0,??DataTable18_33
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+28
        BPL.N    ??vfn_tsk_leds_8
        LDR.W    R0,??DataTable18_36  ;; 0x400ff084
        LDR      R0,[R0, #+0]
        ORRS     R0,R0,#0x80
        LDR.W    R1,??DataTable18_36  ;; 0x400ff084
        STR      R0,[R1, #+0]
        B.N      ??vfn_tsk_leds_1
??vfn_tsk_leds_8:
        LDR.W    R0,??DataTable18_35  ;; 0x400ff088
        LDR      R0,[R0, #+0]
        ORRS     R0,R0,#0x80
        LDR.W    R1,??DataTable18_35  ;; 0x400ff088
        STR      R0,[R1, #+0]
//  400   }
//  401   
//  402   
//  403 }
??vfn_tsk_leds_1:
        POP      {R0,PC}          ;; return

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??led_count:
        DS8 1
//  404 
//  405 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  406 void vfn_tsk_rtc(void)
//  407 {
vfn_tsk_rtc:
        PUSH     {R7,LR}
//  408   printf("\r rtc %4i  ;   elapsed time with Vbat %6i", seconds_count,RTC_TSR);
        LDR.W    R0,??DataTable18_37  ;; 0x4003d000
        LDR      R2,[R0, #+0]
        LDR.W    R0,??DataTable18_38
        LDR      R1,[R0, #+0]
        LDR.W    R0,??DataTable18_39
        BL       printf
//  409  /* 
//  410   printf("time: %02i:%02i:%02i  day,mm,year: %02i/%02i/%02i  delta seg = %i",current_time->hours, current_time->minutes, current_time->seconds,
//  411          current_time->day, current_time->month, current_time->year,RFVBAT_REG7 );
//  412    */
//  413   
//  414 }
        POP      {R0,PC}          ;; return
//  415 
//  416 
//  417 
//  418 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  419 void vfn_tsk_buttons(void)
//  420 { char buttons=0;
vfn_tsk_buttons:
        PUSH     {R4,LR}
        MOVS     R4,#+0
//  421   static char aux1, aux2, aux3, aux4;
//  422 
//  423  
//  424   if (SW1_ON) buttons |= 0x01;
        LDR.W    R0,??DataTable18_40  ;; 0x400ff090
        LDR      R0,[R0, #+0]
        LSLS     R0,R0,#+30
        BMI.N    ??vfn_tsk_buttons_0
        ORRS     R4,R4,#0x1
//  425   if (SW2_ON) buttons |= 0x02;
??vfn_tsk_buttons_0:
        LDR.W    R0,??DataTable18_40  ;; 0x400ff090
        LDR      R0,[R0, #+0]
        LSLS     R0,R0,#+29
        BMI.N    ??vfn_tsk_buttons_1
        ORRS     R4,R4,#0x2
//  426   if (ELECTRODE1_ON) buttons |= 0x04;
??vfn_tsk_buttons_1:
        LDR.W    R0,??DataTable18_41
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+31
        BPL.N    ??vfn_tsk_buttons_2
        ORRS     R4,R4,#0x4
//  427   if (ELECTRODE2_ON) buttons |= 0x08;
??vfn_tsk_buttons_2:
        LDR.W    R0,??DataTable18_41
        LDRB     R0,[R0, #+0]
        LSLS     R0,R0,#+30
        BPL.N    ??vfn_tsk_buttons_3
        ORRS     R4,R4,#0x8
//  428   
//  429   
//  430   if (DISPLAY_FLAG)
??vfn_tsk_buttons_3:
        LDR.W    R1,??DataTable18_31
        LDR.W    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_buttons_4
//  431   printf("\r B %02x", buttons);
        UXTB     R4,R4            ;; ZeroExt  R4,R4,#+24,#+24
        MOVS     R1,R4
        LDR.W    R0,??DataTable18_42
        BL       printf
//  432   
//  433   if (input_rise(SW1_ON,&aux1)) tone(_C5,160,10);    
??vfn_tsk_buttons_4:
        LDR.W    R1,??DataTable18_43
        LDR.W    R0,??DataTable18_40  ;; 0x400ff090
        LDR      R0,[R0, #+0]
        UBFX     R0,R0,#+1,#+1
        ANDS     R0,R0,#0x1
        EORS     R0,R0,#0x1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_buttons_5
        MOVS     R2,#+10
        MOVS     R1,#+160
        MOVS     R0,#+5
        BL       tone
//  434   if (input_rise(SW2_ON,&aux2)) tone(_E5,160,10);    
??vfn_tsk_buttons_5:
        LDR.W    R1,??DataTable18_44
        LDR.N    R0,??DataTable18_40  ;; 0x400ff090
        LDR      R0,[R0, #+0]
        UBFX     R0,R0,#+2,#+1
        ANDS     R0,R0,#0x1
        EORS     R0,R0,#0x1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_buttons_6
        MOVS     R2,#+10
        MOVS     R1,#+160
        MOVS     R0,#+9
        BL       tone
//  435   if (input_rise(ELECTRODE1_ON,&aux3)) tone(_G5,160,10);    //tone on tsi_test_service
??vfn_tsk_buttons_6:
        LDR.N    R1,??DataTable18_45
        LDR.N    R0,??DataTable18_41
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x1
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_buttons_7
        MOVS     R2,#+10
        MOVS     R1,#+160
        MOVS     R0,#+12
        BL       tone
//  436   if (input_rise(ELECTRODE2_ON,&aux4)) tone(_C6,160,10);    //tone on tsi_test_service
??vfn_tsk_buttons_7:
        LDR.N    R1,??DataTable18_46
        LDR.N    R0,??DataTable18_41
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_buttons_8
        MOVS     R2,#+10
        MOVS     R1,#+160
        MOVS     R0,#+17
        BL       tone
//  437 }                       
??vfn_tsk_buttons_8:
        POP      {R4,PC}          ;; return

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux1:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux2:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux3:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux4:
        DS8 1
//  438 
//  439 
//  440 
//  441 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  442 void vfn_tsk_adc(void)
//  443 {
vfn_tsk_adc:
        PUSH     {R7,LR}
//  444 
//  445          median_adc = median(adc_buffer[0], &arr_medianas2[0]);
        LDR.N    R1,??DataTable18_47
        LDR.N    R0,??DataTable18_48
        LDR      R0,[R0, #+0]
        BL       median
        LDR.N    R1,??DataTable18_49
        STRH     R0,[R1, #+0]
//  446          if (adc_buffer[0]>max_adc)max_adc = adc_buffer[0];
        LDR.N    R0,??DataTable18_50
        LDRH     R0,[R0, #+0]
        LDR.N    R1,??DataTable18_48
        LDR      R1,[R1, #+0]
        CMP      R0,R1
        BCS.N    ??vfn_tsk_adc_0
        LDR.N    R0,??DataTable18_50
        LDR.N    R1,??DataTable18_48
        LDR      R1,[R1, #+0]
        STRH     R1,[R0, #+0]
//  447          
//  448          if (DISPLAY_FLAG)
??vfn_tsk_adc_0:
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_adc_1
//  449          printf("\r adc = %04i, med= %04i , Max = %i" ,adc_buffer[0],median_adc,max_adc);
        LDR.N    R0,??DataTable18_50
        LDRH     R3,[R0, #+0]
        LDR.N    R0,??DataTable18_49
        LDRH     R2,[R0, #+0]
        LDR.N    R0,??DataTable18_48
        LDR      R1,[R0, #+0]
        LDR.N    R0,??DataTable18_51
        BL       printf
//  450 }
??vfn_tsk_adc_1:
        POP      {R0,PC}          ;; return
//  451 
//  452 
//  453 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  454 void vfn_tsk_accel(void)
//  455 {
vfn_tsk_accel:
        PUSH     {R5-R7,LR}
//  456   if (DISPLAY_FLAG1)
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x1
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tsk_accel_0
//  457   printf("\r xy=[%3d]<%3d,  xz=[%3d]<%3d,  yz =[%3d]<%3d ",xy_mag, xy_angle,xz_mag, xz_angle,yz_mag, yz_angle);
        LDR.N    R0,??DataTable18_52
        LDR      R0,[R0, #+0]
        STR      R0,[SP, #+8]
        LDR.N    R0,??DataTable18_53
        LDR      R0,[R0, #+0]
        STR      R0,[SP, #+4]
        LDR.N    R0,??DataTable18_54
        LDR      R0,[R0, #+0]
        STR      R0,[SP, #+0]
        LDR.N    R0,??DataTable18_55
        LDR      R3,[R0, #+0]
        LDR.N    R0,??DataTable18_56
        LDR      R2,[R0, #+0]
        LDR.N    R0,??DataTable18_57
        LDR      R1,[R0, #+0]
        LDR.N    R0,??DataTable18_58
        BL       printf
//  458 }
??vfn_tsk_accel_0:
        POP      {R0-R2,PC}       ;; return
//  459 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  460 void vfn_tst_dma_stat(void)
//  461 {
vfn_tst_dma_stat:
        PUSH     {R7,LR}
//  462   if (DISPLAY_FLAG)
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_dma_stat_0
//  463   printf("\r Status DMA %i,  %i,   ",dmaIsrCount, DMA_errorCount);
        LDR.N    R0,??DataTable18_59
        LDRH     R2,[R0, #+0]
        LDR.N    R0,??DataTable18_60
        LDRH     R1,[R0, #+0]
        LDR.N    R0,??DataTable18_61
        BL       printf
//  464 }
??vfn_tst_dma_stat_0:
        POP      {R0,PC}          ;; return
//  465 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  466 void vfn_tst_fft(void)
//  467 {
vfn_tst_fft:
        PUSH     {R7,LR}
//  468   if (DISPLAY_FLAG)
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_fft_0
//  469   display_fft_info();    
        BL       display_fft_info
//  470 }
??vfn_tst_fft_0:
        POP      {R0,PC}          ;; return
//  471 
//  472 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  473 void vfn_tst_harmonic(void)
//  474 {   int i;
vfn_tst_harmonic:
        PUSH     {R4,LR}
//  475    static char aux3;
//  476    static char harmonic_group;
//  477 // ´print initial 10 harmonics
//  478      // printf("\033[2J"); Home and clear screen
//  479      if (DISPLAY_FLAG)
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_harmonic_0
//  480      {  
//  481       printf("\r fft");
        LDR.N    R0,??DataTable18_62
        BL       printf
//  482        if (input_rise(SW1_ON,&aux3)) 
        LDR.N    R1,??DataTable18_63
        LDR.N    R0,??DataTable18_40  ;; 0x400ff090
        LDR      R0,[R0, #+0]
        UBFX     R0,R0,#+1,#+1
        ANDS     R0,R0,#0x1
        EORS     R0,R0,#0x1
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_harmonic_1
//  483        {
//  484          harmonic_group+=8;
        LDR.N    R0,??DataTable18_64
        LDRB     R0,[R0, #+0]
        ADDS     R0,R0,#+8
        LDR.N    R1,??DataTable18_64
        STRB     R0,[R1, #+0]
//  485          if(harmonic_group>=64)harmonic_group=0;
        LDR.N    R0,??DataTable18_64
        LDRB     R0,[R0, #+0]
        CMP      R0,#+64
        BCC.N    ??vfn_tst_harmonic_1
        LDR.N    R0,??DataTable18_64
        MOVS     R1,#+0
        STRB     R1,[R0, #+0]
//  486        }
//  487       for (i=1;i<9;i++)
??vfn_tst_harmonic_1:
        MOVS     R4,#+1
        B.N      ??vfn_tst_harmonic_2
//  488       {   
//  489         printf("[%2i]%4i,",i+harmonic_group,rfft128Magnitud[i+harmonic_group]);
??vfn_tst_harmonic_3:
        LDR.N    R0,??DataTable18_64
        LDRB     R0,[R0, #+0]
        ADDS     R0,R4,R0
        LDR.N    R1,??DataTable18_65
        LDRSH    R2,[R1, R0, LSL #+1]
        LDR.N    R0,??DataTable18_64
        LDRB     R0,[R0, #+0]
        ADDS     R1,R4,R0
        LDR.N    R0,??DataTable18_66
        BL       printf
//  490       }
        ADDS     R4,R4,#+1
??vfn_tst_harmonic_2:
        CMP      R4,#+9
        BLT.N    ??vfn_tst_harmonic_3
//  491      } 
//  492 }
??vfn_tst_harmonic_0:
        POP      {R4,PC}          ;; return

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux3_1:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??harmonic_group:
        DS8 1
//  493 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  494 void vfn_tst_adc_buf(void)
//  495 {   
vfn_tst_adc_buf:
        PUSH     {R7,LR}
//  496 
//  497      ti_test_adc = 2000;   // force to read POT signal while in this tsk
        LDR.N    R0,??DataTable18_67
        MOV      R1,#+2000
        STRH     R1,[R0, #+0]
//  498      if (DISPLAY_FLAG)
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x2
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_adc_buf_0
//  499      printf("\r ADC  POT = %05i  ;", adc_buffer[0]);
        LDR.N    R0,??DataTable18_48
        LDR      R1,[R0, #+0]
        LDR.N    R0,??DataTable18_68
        BL       printf
//  500       
//  501 }
??vfn_tst_adc_buf_0:
        POP      {R0,PC}          ;; return
//  502 
//  503 
//  504 
//  505 
//  506 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  507 void vfn_tst_irda(void)
//  508 {
vfn_tst_irda:
        PUSH     {R7,LR}
//  509   static char aux2;
//  510   static char rx_ch;
//  511   char ch;
//  512 
//  513        // Pin multilplexing configuration  J4 OFF  J7 ON
//  514   if (((PORTC_PCR7 & PORT_PCR_MUX_MASK)>>PORT_PCR_MUX_SHIFT)!= 0)
        LDR.N    R0,??DataTable18_29  ;; 0x4004b01c
        LDR      R0,[R0, #+0]
        LSRS     R0,R0,#+8
        ANDS     R0,R0,#0x7
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_irda_0
//  515   {
//  516     cmt_init();
        BL       cmt_init
//  517     irda_test_init();
        BL       irda_test_init
//  518    };
//  519   
//  520      if (input_rise(seconds_count&0x1,&aux2))
??vfn_tst_irda_0:
        LDR.N    R1,??DataTable18_69
        LDR.N    R0,??DataTable18_38
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x1
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_irda_1
//  521        {
//  522      //   irda_tx(++irda_tx_counter);
//  523         cmt_tx_data(++irda_tx_counter);
        LDR.N    R0,??DataTable18_70
        LDRB     R0,[R0, #+0]
        ADDS     R0,R0,#+1
        LDR.N    R1,??DataTable18_70
        STRB     R0,[R1, #+0]
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        BL       cmt_tx_data
//  524         }
//  525         ch = irda_get_char();
??vfn_tst_irda_1:
        BL       irda_get_char
//  526         if (ch) rx_ch = ch;  //%store last received value
        UXTB     R0,R0            ;; ZeroExt  R0,R0,#+24,#+24
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_irda_2
        LDR.N    R1,??DataTable18_71
        STRB     R0,[R1, #+0]
//  527         
//  528         if (DISPLAY_FLAG1)
??vfn_tst_irda_2:
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x1
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_irda_3
//  529         printf("\r IR port:  Tx = %03i,     Rx= %03i ;",irda_tx_counter, rx_ch);      
        LDR.N    R0,??DataTable18_71
        LDRB     R2,[R0, #+0]
        LDR.N    R0,??DataTable18_70
        LDRB     R1,[R0, #+0]
        LDR.N    R0,??DataTable18_72
        BL       printf
//  530   
//  531 }
??vfn_tst_irda_3:
        POP      {R0,PC}          ;; return

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux2_1:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??rx_ch:
        DS8 1
//  532 
//  533 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  534 void vfn_tst_tone_detec(void)
//  535 {   char i;
vfn_tst_tone_detec:
        PUSH     {R4,LR}
//  536     // tone_filter.filter_output
//  537     // clap_filter.filter_output
//  538       printf("\r Max ");
        LDR.N    R0,??DataTable18_73
        BL       printf
//  539       for (i=0;i<6;i++)
        MOVS     R4,#+0
        B.N      ??vfn_tst_tone_detec_0
//  540       {
//  541         printf(" %i,", peak_table[i].magnitud);
??vfn_tst_tone_detec_1:
        UXTB     R4,R4            ;; ZeroExt  R4,R4,#+24,#+24
        LDR.N    R0,??DataTable18_74
        LDRSH    R1,[R0, R4, LSL #+2]
        LDR.N    R0,??DataTable18_75
        BL       printf
//  542       }
        ADDS     R4,R4,#+1
??vfn_tst_tone_detec_0:
        UXTB     R4,R4            ;; ZeroExt  R4,R4,#+24,#+24
        CMP      R4,#+6
        BCC.N    ??vfn_tst_tone_detec_1
//  543      //   printf("Tone detection T= %i, C = %i, filter %i",tone_filter.filter_output, clap_filter.filter_output,  clap_filter.filter_count);
//  544       
//  545 }
        POP      {R4,PC}          ;; return
//  546 
//  547 
//  548 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  549 void vfn_tst_clap_detec(void)
//  550 {   
vfn_tst_clap_detec:
        PUSH     {R7,LR}
//  551 
//  552     
//  553   if (DISPLAY_FLAG1)   
        LDR.N    R1,??DataTable18_31
        LDR.N    R0,??DataTable18_32
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x1
        BL       input_rise
        CMP      R0,#+0
        BEQ.N    ??vfn_tst_clap_detec_0
//  554   {
//  555    printf("\r Clap Peak energy=%7i  energy=%7i    median %5i clap count= %3i", clap_peak_energy/2,clap_energy/2,median_energy,clap_counter);  
        LDR.N    R0,??DataTable18_76
        LDRB     R0,[R0, #+0]
        STR      R0,[SP, #+0]
        LDR.N    R0,??DataTable18_77
        LDRH     R3,[R0, #+0]
        LDR.N    R0,??DataTable18_78
        LDR      R0,[R0, #+0]
        MOVS     R1,#+2
        SDIV     R2,R0,R1
        LDR.N    R0,??DataTable18_79
        LDR      R0,[R0, #+0]
        MOVS     R1,#+2
        SDIV     R1,R0,R1
        LDR.N    R0,??DataTable18_80
        BL       printf
//  556   }
//  557   
//  558 
//  559   
//  560 }
??vfn_tst_clap_detec_0:
        POP      {R0,PC}          ;; return

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18:
        DC32     pfunc

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_1:
        DC32     ptr_next_task

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_2:
        DC32     `?<Constant "\\n\\r Available function...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_3:
        DC32     `?<Constant "\\n\\r 0: restore display">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_4:
        DC32     `?<Constant "\\n\\r 1: rtc  nnn       ...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_5:
        DC32     `?<Constant "\\n\\r 2: Electrodes/sw B...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_6:
        DC32     `?<Constant "\\n\\r 3: leds         Le...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_7:
        DC32     `?<Constant "\\n\\r 4: Accelerometer  ...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_8:
        DC32     `?<Constant "\\n\\r 5: irda  IR port: ...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_9:
        DC32     `?<Constant "\\n\\r 6: ADC Potentiomet...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_10:
        DC32     `?<Constant "\\n\\r 7: FFT harmonics  ...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_11:
        DC32     `?<Constant "\\n\\r 8: DMA  transactio...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_12:
        DC32     `?<Constant "\\n\\r 9: Clap analysis ">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_13:
        DC32     current_time

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_14:
        DC32     `?<Constant "\\n\\r time   hr mm ss">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_15:
        DC32     `?<Constant "time: %02i:%02i:%02i ...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_16:
        DC32     `?<Constant "\\n\\r error format date ">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_17:
        DC32     `?<Constant "\\n\\rformat error, use d...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_18:
        DC32     ??pos

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_19:
        DC32     UIF_NUM_CMD

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_20:
        DC32     UIF_CMDTAB

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_21:
        DC32     PROMPT

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_22:
        DC32     SYNTAX

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_23:
        DC32     INVCMD

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_24:
        DC32     HELPMSG

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_25:
        DC32     0x4006b004

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_26:
        DC32     0x4006b007

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_27:
        DC32     myCmdline1

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_28:
        DC32     0x4006b003

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_29:
        DC32     0x4004b01c

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_30:
        DC32     ti_test_leds

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_31:
        DC32     auxdisp1

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_32:
        DC32     base_time125m

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_33:
        DC32     ??led_count

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_34:
        DC32     `?<Constant "\\r LEDs %02x  ">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_35:
        DC32     0x400ff088

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_36:
        DC32     0x400ff084

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_37:
        DC32     0x4003d000

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_38:
        DC32     seconds_count

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_39:
        DC32     `?<Constant "\\r rtc %4i  ;   elapse...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_40:
        DC32     0x400ff090

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_41:
        DC32     TouchEvent

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_42:
        DC32     `?<Constant "\\r B %02x">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_43:
        DC32     ??aux1

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_44:
        DC32     ??aux2

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_45:
        DC32     ??aux3

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_46:
        DC32     ??aux4

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_47:
        DC32     arr_medianas2

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_48:
        DC32     adc_buffer

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_49:
        DC32     median_adc

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_50:
        DC32     max_adc

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_51:
        DC32     `?<Constant "\\r adc = %04i, med= %0...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_52:
        DC32     yz_angle

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_53:
        DC32     yz_mag

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_54:
        DC32     xz_angle

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_55:
        DC32     xz_mag

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_56:
        DC32     xy_angle

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_57:
        DC32     xy_mag

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_58:
        DC32     `?<Constant "\\r xy=[%3d]<%3d,  xz=[...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_59:
        DC32     DMA_errorCount

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_60:
        DC32     dmaIsrCount

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_61:
        DC32     `?<Constant "\\r Status DMA %i,  %i,   ">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_62:
        DC32     `?<Constant "\\r fft">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_63:
        DC32     ??aux3_1

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_64:
        DC32     ??harmonic_group

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_65:
        DC32     rfft128Magnitud

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_66:
        DC32     `?<Constant "[%2i]%4i,">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_67:
        DC32     ti_test_adc

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_68:
        DC32     `?<Constant "\\r ADC  POT = %05i  ;">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_69:
        DC32     ??aux2_1

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_70:
        DC32     irda_tx_counter

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_71:
        DC32     ??rx_ch

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_72:
        DC32     `?<Constant "\\r IR port:  Tx = %03i...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_73:
        DC32     `?<Constant "\\r Max ">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_74:
        DC32     peak_table

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_75:
        DC32     `?<Constant " %i,">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_76:
        DC32     clap_counter

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_77:
        DC32     median_energy

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_78:
        DC32     clap_energy

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_79:
        DC32     clap_peak_energy

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable18_80:
        DC32     `?<Constant "\\r Clap Peak energy=%7...">`

        SECTION `.iar_vfe_header`:DATA:REORDER:NOALLOC:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
        DC32 0

        SECTION __DLIB_PERTHREAD:DATA:REORDER:NOROOT(0)
        SECTION_TYPE SHT_PROGBITS, 0

        SECTION __DLIB_PERTHREAD_init:DATA:REORDER:NOROOT(0)
        SECTION_TYPE SHT_PROGBITS, 0

        END
// 
//   243 bytes in section .bss
//    48 bytes in section .data
// 1 341 bytes in section .rodata
// 2 428 bytes in section .text
// 
// 2 428 bytes of CODE  memory
// 1 341 bytes of CONST memory
//   291 bytes of DATA  memory
//
//Errors: none
//Warnings: 1
