; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave --gnu -o.\objects\app_tp_transfer.o --asm_dir=.\Listings\ --list_dir=.\Listings\ --depend=.\objects\app_tp_transfer.d --cpu=Cortex-M0 --apcs=interwork -O1 --diag_suppress=9931 -I..\..\src -I..\..\src\board -I..\..\src\common -I..\..\src\sdk\include -I..\..\src\app\demo -I..\..\src\sdk\include\M0 -I..\..\src\app -I..\..\src\app\module_demo -I..\..\src\app\touch -I..\..\src\app\S8 -I..\..\src\app\S9 -I..\CVWL568 -I..\..\src\app\s21p -I.\RTE\_ISP_568T -IC:\Users\55\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\55\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include -D__MICROLIB -D__UVISION_VERSION=528 -D_RTE_ -DARMCM0 -DISP_568 --omf_browse=.\objects\app_tp_transfer.crf ..\..\src\app\touch\app_tp_transfer.c]
                          THUMB

                          AREA ||i.app_tp_i2cs_callback||, CODE, READONLY, ALIGN=2

                  app_tp_i2cs_callback PROC
;;;299    #if PHONE_SLAVE_TRANSFER_I2C                //消除warning
;;;300    static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num)
000000  b570              PUSH     {r4-r6,lr}
;;;301    {
000002  4605              MOV      r5,r0
;;;302        static bool i2cs_transfer = true;       //确保一次通信只解析一次
;;;303        if (i2cs_transfer)
000004  4c0a              LDR      r4,|L1.48|
000006  79a0              LDRB     r0,[r4,#6]  ; i2cs_transfer
000008  2800              CMP      r0,#0
00000a  d004              BEQ      |L1.22|
;;;304        {
;;;305            i2cs_transfer = false;
00000c  2000              MOVS     r0,#0
00000e  71a0              STRB     r0,[r4,#6]
;;;306            app_tp_transfer_phone(recieve_num);
000010  4608              MOV      r0,r1
000012  f7fffffe          BL       app_tp_transfer_phone
                  |L1.22|
;;;307        }
;;;308        if (int_status == I2C_S_INT_READ)
000016  2d00              CMP      r5,#0
000018  d004              BEQ      |L1.36|
;;;309        {
;;;310            app_tp_s_write(s_slave_txbuffer, s_slave_txbuffer_size);
;;;311        }
;;;312        else if (int_status == I2C_S_INT_STOP)
00001a  2d02              CMP      r5,#2
00001c  d101              BNE      |L1.34|
;;;313        {
;;;314            i2cs_transfer = true;
00001e  2001              MOVS     r0,#1
000020  71a0              STRB     r0,[r4,#6]
                  |L1.34|
;;;315        }
;;;316    }
000022  bd70              POP      {r4-r6,pc}
                  |L1.36|
000024  6921              LDR      r1,[r4,#0x10]         ;310  ; s_slave_txbuffer_size
000026  68e0              LDR      r0,[r4,#0xc]          ;310  ; s_slave_txbuffer
000028  f7fffffe          BL       app_tp_s_write
00002c  bd70              POP      {r4-r6,pc}
;;;317    #endif
                          ENDP

00002e  0000              DCW      0x0000
                  |L1.48|
                          DCD      ||.data||

                          AREA ||i.app_tp_init||, CODE, READONLY, ALIGN=2

                  app_tp_init PROC
;;;140    **************************************************************************/
;;;141    void app_tp_init(void)
000000  b510              PUSH     {r4,lr}
;;;142    {
;;;143    //    app_tp_phone_reset_init();                                        //初始化手机复位的IO口
;;;144        app_tp_screen_int_init();                                         //配置screen中断输入引脚
000002  f7fffffe          BL       app_tp_screen_int_init
;;;145        hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_HIGH);        //配置phone报点输出中断IO口
000006  480b              LDR      r0,|L2.52|
000008  2101              MOVS     r1,#1
00000a  7800              LDRB     r0,[r0,#0]  ; g_phone_output_int_pad
00000c  f7fffffe          BL       hal_gpio_init_output
;;;146    
;;;147    #if SCREEN_MASTER_TRANSFER_I2C
;;;148        hal_i2c_m_dma_init(SCREEN_I2C_ADDRESS, SCREEN_I2C_ADDR_BITS, I2C_MASTER_SPEED);
000010  4a09              LDR      r2,|L2.56|
000012  2107              MOVS     r1,#7
000014  2049              MOVS     r0,#0x49
000016  f7fffffe          BL       hal_i2c_m_dma_init
;;;149    #elif SCREEN_MASTER_TRANSFER_SPI
;;;150        hal_spi_m_dma_init(SPI_MASTER_SPEED, SCREEN_SPI_CPHA, SCREEN_SPI_CPOL);
;;;151    #endif
;;;152    
;;;153    #if PHONE_SLAVE_TRANSFER_I2C
;;;154        hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
00001a  2107              MOVS     r1,#7
00001c  2048              MOVS     r0,#0x48
00001e  f7fffffe          BL       hal_i2c_s_init
;;;155        hal_i2c_s_set_transfer(app_tp_i2cs_callback);
000022  4806              LDR      r0,|L2.60|
000024  f7fffffe          BL       hal_i2c_s_set_transfer
;;;156        hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //先配置接收 buffer
000028  21fa              MOVS     r1,#0xfa
00002a  4805              LDR      r0,|L2.64|
00002c  f7fffffe          BL       hal_i2c_s_nonblocking_read
;;;157    #elif PHONE_SLAVE_TRANSFER_SPI
;;;158        hal_spi_slave_init(PHONE_SPI_CPHA, PHONE_SPI_CPOL, true);                                   // 初始化spi以及dma
;;;159        hal_spi_slave_register_callback(app_tp_spis_callback);            // 注册回调
;;;160        hal_spi_slave_auto_transfer_abort();                              // 停止传输
;;;161        hal_spi_slave_flush_fifo();                                       // Flush FIFO
;;;162    
;;;163        /* 每个packet自动接收, circle       mode 为false, 即收到buffer     max size数据后buffer不再更新, packet完成后调用回调    */
;;;164        hal_spi_slave_set_auto_rx_buffer(s_phone_read_buffer, BUFFER_SIZE_MAX, false); // 设置auto   rx buffer
;;;165        hal_spi_slave_set_auto_tx_buffer(phone_reg_const_data[0].write_back, phone_reg_const_data[0].write_back_size, false);   // 配置TX BUFFER
;;;166    
;;;167        hal_spi_slave_enable();                                           // 启动spis
;;;168        hal_spi_slave_auto_transfer_start();                              // 启动tx自动发送
;;;169    #endif
;;;170    }
000030  bd10              POP      {r4,pc}
;;;171    
                          ENDP

000032  0000              DCW      0x0000
                  |L2.52|
                          DCD      g_phone_output_int_pad
                  |L2.56|
                          DCD      0x00061a80
                  |L2.60|
                          DCD      app_tp_i2cs_callback
                  |L2.64|
                          DCD      ||.bss||+0xfa

                          AREA ||i.app_tp_m_read||, CODE, READONLY, ALIGN=1

                  app_tp_m_read PROC
;;;235    **************************************************************************/
;;;236    void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, size_t data_size)
000000  b5f8              PUSH     {r3-r7,lr}
;;;237    {
000002  4606              MOV      r6,r0
;;;238    #if SCREEN_MASTER_TRANSFER_I2C
;;;239        uint8_t i = 0;
000004  2400              MOVS     r4,#0
;;;240        uint32_t address = 0;
000006  2000              MOVS     r0,#0
000008  e005              B        |L3.22|
                  |L3.10|
;;;241    
;;;242        for (i = 0; i < cmd_size; i++)                          //先将要发送的数据整合到 address
;;;243        {
;;;244            address |= (uint32_t)cmd[i] << i * 8;
00000a  5d35              LDRB     r5,[r6,r4]
00000c  00e7              LSLS     r7,r4,#3
00000e  40bd              LSLS     r5,r5,r7
000010  4328              ORRS     r0,r0,r5
000012  1c64              ADDS     r4,r4,#1              ;242
000014  b2e4              UXTB     r4,r4                 ;242
                  |L3.22|
000016  428c              CMP      r4,r1                 ;242
000018  d3f7              BCC      |L3.10|
;;;245        }
;;;246        hal_i2c_m_dma_read(address, cmd_size, data_buffer, data_size);
00001a  f7fffffe          BL       hal_i2c_m_dma_read
;;;247    #elif SCREEN_MASTER_TRANSFER_SPI
;;;248        hal_spi_m_dma_read(cmd, cmd_size, data_buffer, data_size);
;;;249    #endif
;;;250    }
00001e  bdf8              POP      {r3-r7,pc}
;;;251    
                          ENDP


                          AREA ||i.app_tp_m_transfer_complate||, CODE, READONLY, ALIGN=1

                  app_tp_m_transfer_complate PROC
;;;178    **************************************************************************/
;;;179    bool app_tp_m_transfer_complate(void)
000000  b510              PUSH     {r4,lr}
;;;180    {
;;;181    #if SCREEN_MASTER_TRANSFER_I2C
;;;182        return hal_i2c_m_transfer_complate();
000002  f7fffffe          BL       hal_i2c_m_transfer_complate
;;;183    #elif SCREEN_MASTER_TRANSFER_SPI
;;;184        return hal_spi_m_get_transfer_complate();
;;;185    #else
;;;186        return true;
;;;187    #endif
;;;188    }
000006  bd10              POP      {r4,pc}
;;;189    
                          ENDP


                          AREA ||i.app_tp_m_write||, CODE, READONLY, ALIGN=1

                  app_tp_m_write PROC
;;;215    **************************************************************************/
;;;216    void app_tp_m_write(const uint8_t *txbuffer, size_t buffer_size)
000000  b510              PUSH     {r4,lr}
;;;217    {
;;;218    #if SCREEN_MASTER_TRANSFER_I2C
;;;219        hal_i2c_m_dma_write(txbuffer, buffer_size);
000002  f7fffffe          BL       hal_i2c_m_dma_write
;;;220    #elif SCREEN_MASTER_TRANSFER_SPI
;;;221        hal_spi_m_dma_write(txbuffer, buffer_size);
;;;222        s_spim_write = true;
;;;223    #endif
;;;224    }
000006  bd10              POP      {r4,pc}
;;;225    
                          ENDP


                          AREA ||i.app_tp_phone_clear_reset_on||, CODE, READONLY, ALIGN=2

                  app_tp_phone_clear_reset_on PROC
;;;600    **************************************************************************/
;;;601    void app_tp_phone_clear_reset_on(void)
000000  4901              LDR      r1,|L6.8|
;;;602    {
;;;603        s_phone_reset_flag = false;
000002  2000              MOVS     r0,#0
000004  7088              STRB     r0,[r1,#2]
;;;604    }
000006  4770              BX       lr
;;;605    
                          ENDP

                  |L6.8|
                          DCD      ||.data||

                          AREA ||i.app_tp_phone_reset_on||, CODE, READONLY, ALIGN=2

                  app_tp_phone_reset_on PROC
;;;588    **************************************************************************/
;;;589    bool app_tp_phone_reset_on(void)
000000  4801              LDR      r0,|L7.8|
;;;590    {
;;;591        return s_phone_reset_flag;
000002  7880              LDRB     r0,[r0,#2]  ; s_phone_reset_flag
;;;592    }
000004  4770              BX       lr
;;;593    
                          ENDP

000006  0000              DCW      0x0000
                  |L7.8|
                          DCD      ||.data||

                          AREA ||i.app_tp_s_read||, CODE, READONLY, ALIGN=1

                  app_tp_s_read PROC
;;;284    **************************************************************************/
;;;285    void app_tp_s_read(void *rxBuffer, size_t data_size)
000000  b510              PUSH     {r4,lr}
;;;286    {
;;;287    #if PHONE_SLAVE_TRANSFER_I2C
;;;288        hal_i2c_s_nonblocking_read(rxBuffer, data_size);
000002  f7fffffe          BL       hal_i2c_s_nonblocking_read
;;;289    #endif
;;;290    }
000006  bd10              POP      {r4,pc}
;;;291    
                          ENDP


                          AREA ||i.app_tp_s_transfer_complate||, CODE, READONLY, ALIGN=1

                  app_tp_s_transfer_complate PROC
;;;196    **************************************************************************/
;;;197    bool app_tp_s_transfer_complate(void)
000000  b510              PUSH     {r4,lr}
;;;198    {
;;;199    #if PHONE_SLAVE_TRANSFER_I2C
;;;200        return hal_i2c_s_write_complate() && hal_i2c_s_read_complate();
000002  f7fffffe          BL       hal_i2c_s_write_complate
000006  2800              CMP      r0,#0
000008  d005              BEQ      |L9.22|
00000a  f7fffffe          BL       hal_i2c_s_read_complate
00000e  2800              CMP      r0,#0
000010  d001              BEQ      |L9.22|
000012  2001              MOVS     r0,#1
;;;201    #elif PHONE_SLAVE_TRANSFER_SPI
;;;202        return !hal_spi_slave_busy();
;;;203    #else
;;;204        return true;
;;;205    #endif
;;;206    }
000014  bd10              POP      {r4,pc}
                  |L9.22|
000016  2000              MOVS     r0,#0                 ;200
000018  bd10              POP      {r4,pc}
;;;207    
                          ENDP


                          AREA ||i.app_tp_s_write||, CODE, READONLY, ALIGN=1

                  app_tp_s_write PROC
;;;259    **************************************************************************/
;;;260    void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size)
000000  b510              PUSH     {r4,lr}
;;;261    {
;;;262    #if PHONE_SLAVE_TRANSFER_I2C
;;;263        hal_i2c_s_dma_write(txbuffer, buffer_size);
000002  f7fffffe          BL       hal_i2c_s_dma_write
;;;264    #elif PHONE_SLAVE_TRANSFER_SPI
;;;265        //while (hal_spi_slave_busy());
;;;266    #if 1
;;;267        hal_spi_slave_reset_tx(txbuffer, buffer_size, true);
;;;268    #else
;;;269        hal_spi_slave_auto_transfer_abort();
;;;270        hal_spi_slave_flush_fifo();
;;;271        hal_spi_slave_set_auto_tx_buffer(txbuffer, buffer_size, true);
;;;272        hal_spi_slave_auto_transfer_start();
;;;273    #endif
;;;274    #endif
;;;275    }
000006  bd10              POP      {r4,pc}
;;;276    
                          ENDP


                          AREA ||i.app_tp_screen_init||, CODE, READONLY, ALIGN=2

                  app_tp_screen_init PROC
;;;123    **************************************************************************/
;;;124    void app_tp_screen_init(void)
000000  b510              PUSH     {r4,lr}
;;;125    {
;;;126        hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH);
000002  4c0c              LDR      r4,|L11.52|
000004  2101              MOVS     r1,#1
000006  7820              LDRB     r0,[r4,#0]  ; g_screen_input_rst_pad
000008  f7fffffe          BL       hal_gpio_init_output
;;;127        delayUs(200);
00000c  20c8              MOVS     r0,#0xc8
00000e  f7fffffe          BL       delayUs
;;;128        hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_LOW);
000012  2100              MOVS     r1,#0
000014  7820              LDRB     r0,[r4,#0]  ; g_screen_input_rst_pad
000016  f7fffffe          BL       hal_gpio_set_output_data
;;;129        delayUs(200);
00001a  20c8              MOVS     r0,#0xc8
00001c  f7fffffe          BL       delayUs
;;;130        hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
000020  2101              MOVS     r1,#1
000022  7820              LDRB     r0,[r4,#0]  ; g_screen_input_rst_pad
000024  f7fffffe          BL       hal_gpio_set_output_data
;;;131        delayUs(400);
000028  20ff              MOVS     r0,#0xff
00002a  3091              ADDS     r0,r0,#0x91
00002c  f7fffffe          BL       delayUs
;;;132    }
000030  bd10              POP      {r4,pc}
;;;133    
                          ENDP

000032  0000              DCW      0x0000
                  |L11.52|
                          DCD      g_screen_input_rst_pad

                          AREA ||i.app_tp_screen_int_callback||, CODE, READONLY, ALIGN=2

                  app_tp_screen_int_callback PROC
;;;53     **************************************************************************/
;;;54     static void app_tp_screen_int_callback(void *data)
000000  4901              LDR      r1,|L12.8|
;;;55     {
;;;56         s_screen_int_flag = true;
000002  2001              MOVS     r0,#1
000004  7048              STRB     r0,[r1,#1]
;;;57     }
000006  4770              BX       lr
;;;58     
                          ENDP

                  |L12.8|
                          DCD      ||.data||

                          AREA ||i.app_tp_screen_int_init||, CODE, READONLY, ALIGN=2

                  app_tp_screen_int_init PROC
;;;81     **************************************************************************/
;;;82     static void app_tp_screen_int_init(void)
000000  b510              PUSH     {r4,lr}
;;;83     {
;;;84         hal_gpio_ctrl_eint(g_screen_input_int_pad, DISABLE);                      // 1.关闭中断
000002  4c0b              LDR      r4,|L13.48|
000004  2100              MOVS     r1,#0
000006  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
000008  f7fffffe          BL       hal_gpio_ctrl_eint
;;;85     #if SCREEN_INT_LOW_DEFAULT
;;;86         hal_gpio_set_pull_state(g_screen_input_int_pad, DISABLE, ENABLE);         // 2.配置下拉
;;;87         hal_gpio_init_eint(g_screen_input_int_pad, DETECT_RISING_EDGE);           // 3.中断初始化,INT 上升沿触发中断
;;;88     #else
;;;89         hal_gpio_set_pull_state(g_screen_input_int_pad, ENABLE, DISABLE);         // 2.配置上拉
00000c  2200              MOVS     r2,#0
00000e  2101              MOVS     r1,#1
000010  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
000012  f7fffffe          BL       hal_gpio_set_pull_state
;;;90         hal_gpio_init_eint(g_screen_input_int_pad, DETECT_FALLING_EDGE);          // 3.中断初始化,INT 下降沿触发中断
000016  2103              MOVS     r1,#3
000018  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
00001a  f7fffffe          BL       hal_gpio_init_eint
;;;91     #endif
;;;92         hal_gpio_reg_eint_cb(g_screen_input_int_pad, app_tp_screen_int_callback); // 4.注册回调
00001e  4905              LDR      r1,|L13.52|
000020  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
000022  f7fffffe          BL       hal_gpio_reg_eint_cb
;;;93         hal_gpio_ctrl_eint(g_screen_input_int_pad, ENABLE);                       // 5.使能中断
000026  2101              MOVS     r1,#1
000028  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
00002a  f7fffffe          BL       hal_gpio_ctrl_eint
;;;94     }
00002e  bd10              POP      {r4,pc}
;;;95     
                          ENDP

                  |L13.48|
                          DCD      g_screen_input_int_pad
                  |L13.52|
                          DCD      app_tp_screen_int_callback

                          AREA ||i.app_tp_screen_int_lvl_low||, CODE, READONLY, ALIGN=2

                  app_tp_screen_int_lvl_low PROC
;;;65     **************************************************************************/
;;;66     static bool app_tp_screen_int_lvl_low(void)
000000  b510              PUSH     {r4,lr}
;;;67     {
;;;68     #if SCREEN_INT_LOW_DEFAULT
;;;69         return hal_gpio_get_input_data(g_screen_input_int_pad);     //INT 为高电平时，说明还有报点数据没读出
;;;70     #else
;;;71         return !hal_gpio_get_input_data(g_screen_input_int_pad);    //INT 为低电平时，说明还有报点数据没读出
000002  4805              LDR      r0,|L14.24|
000004  7800              LDRB     r0,[r0,#0]  ; g_screen_input_int_pad
000006  f7fffffe          BL       hal_gpio_get_input_data
00000a  2800              CMP      r0,#0
00000c  d001              BEQ      |L14.18|
00000e  2000              MOVS     r0,#0
;;;72     #endif
;;;73     }
000010  bd10              POP      {r4,pc}
                  |L14.18|
000012  2001              MOVS     r0,#1                 ;71
000014  bd10              POP      {r4,pc}
;;;74     
                          ENDP

000016  0000              DCW      0x0000
                  |L14.24|
                          DCD      g_screen_input_int_pad

                          AREA ||i.app_tp_transfer_phone||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_phone PROC
;;;570    **************************************************************************/
;;;571    static void app_tp_transfer_phone(size_t recieve_num)
000000  b510              PUSH     {r4,lr}
;;;572    {
;;;573        /* 数据解析，判断是否需要答复以及答复的buffer指针 */
;;;574        if (recieve_num > 0)
000002  2800              CMP      r0,#0
000004  d005              BEQ      |L15.18|
;;;575        {
;;;576            app_tp_phone_analysis_data(s_phone_read_buffer, recieve_num, &s_slave_txbuffer, &s_slave_txbuffer_size);
000006  4b05              LDR      r3,|L15.28|
000008  4601              MOV      r1,r0
00000a  1f1a              SUBS     r2,r3,#4
00000c  4804              LDR      r0,|L15.32|
00000e  f7fffffe          BL       app_tp_phone_analysis_data
                  |L15.18|
;;;577        }
;;;578    
;;;579        app_tp_s_read(s_phone_read_buffer, BUFFER_SIZE_MAX);
000012  21fa              MOVS     r1,#0xfa
000014  4802              LDR      r0,|L15.32|
000016  f7fffffe          BL       app_tp_s_read
;;;580    }
00001a  bd10              POP      {r4,pc}
;;;581    
                          ENDP

                  |L15.28|
                          DCD      ||.data||+0x10
                  |L15.32|
                          DCD      ||.bss||+0xfa

                          AREA ||i.app_tp_transfer_screen_const||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_const PROC
;;;374    **************************************************************************/
;;;375    static void app_tp_transfer_screen_const(void)
000000  b5f8              PUSH     {r3-r7,lr}
;;;376    {
;;;377        static bool    screen_const_transfer_buffer_ready = true;            //发送 buffer 是否已准备好
;;;378    		
;;;379        /**** 1. 判断当前状态通信已结束, 并且开机初始化流程还未走完****/
;;;380        if (app_tp_m_transfer_complate() && (s_screen_const_transfer_count < screen_reg_start_data_size))
000002  f7fffffe          BL       app_tp_m_transfer_complate
000006  2800              CMP      r0,#0
000008  d020              BEQ      |L16.76|
00000a  4c1e              LDR      r4,|L16.132|
00000c  4e1e              LDR      r6,|L16.136|
00000e  7960              LDRB     r0,[r4,#5]  ; s_screen_const_transfer_count
000010  7831              LDRB     r1,[r6,#0]  ; screen_reg_start_data_size
000012  4288              CMP      r0,r1
000014  d21a              BCS      |L16.76|
;;;381        {
;;;382            if (s_spim_write)                                                //SPI 写数据后需要把接收FIFO的数据读出，不然会影响下一次读取
000016  7820              LDRB     r0,[r4,#0]  ; s_spim_write
000018  2700              MOVS     r7,#0
00001a  2800              CMP      r0,#0
00001c  d002              BEQ      |L16.36|
;;;383            {
;;;384                hal_spi_m_clear_rxfifo();
00001e  f7fffffe          BL       hal_spi_m_clear_rxfifo
;;;385                s_spim_write = false;
000022  7027              STRB     r7,[r4,#0]
                  |L16.36|
;;;386            }
;;;387    
;;;388            /**** 2. 发送或读取从机数据 ****/
;;;389            if (screen_const_transfer_buffer_ready)
000024  79e0              LDRB     r0,[r4,#7]  ; screen_const_transfer_buffer_ready
;;;390            {
;;;391                screen_const_transfer_buffer_ready = false;
;;;392    						g_screen_tp_init_start = true;
;;;393    						
;;;394                if (!screen_reg_start_data[s_screen_const_transfer_count].read_flag)     //当前通信不需要读回，直接写
000026  4919              LDR      r1,|L16.140|
000028  2501              MOVS     r5,#1                 ;392
00002a  2800              CMP      r0,#0                 ;389
00002c  d014              BEQ      |L16.88|
00002e  71e7              STRB     r7,[r4,#7]            ;391
000030  4817              LDR      r0,|L16.144|
000032  7005              STRB     r5,[r0,#0]            ;392
000034  7960              LDRB     r0,[r4,#5]  ; s_screen_const_transfer_count
000036  2214              MOVS     r2,#0x14
000038  4350              MULS     r0,r2,r0
00003a  1840              ADDS     r0,r0,r1
00003c  7c01              LDRB     r1,[r0,#0x10]
00003e  2900              CMP      r1,#0
000040  d005              BEQ      |L16.78|
;;;395                {
;;;396                    app_tp_m_write(screen_reg_start_data[s_screen_const_transfer_count].buffer, screen_reg_start_data[s_screen_const_transfer_count].txbuffer_size);
;;;397                }
;;;398                else                                                             //当前通信需要读回，先写再读
;;;399                {
;;;400                    app_tp_m_read(screen_reg_start_data[s_screen_const_transfer_count].buffer, screen_reg_start_data[s_screen_const_transfer_count].txbuffer_size, \
000042  1d00              ADDS     r0,r0,#4
000044  c80b              LDM      r0,{r0,r1,r3}
000046  4a13              LDR      r2,|L16.148|
000048  f7fffffe          BL       app_tp_m_read
                  |L16.76|
;;;401                                  s_screen_read_buffer, screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
;;;402                }
;;;403    					
;;;404            }
;;;405            /**** 3. 解析本次通信数据，并准备下一次通信的buffer ****/
;;;406            else
;;;407            {
;;;408                screen_const_transfer_buffer_ready = true;
;;;409                s_screen_const_transfer_count = app_tp_screen_analysis_const(s_screen_const_transfer_count, s_screen_read_buffer, \
;;;410                                                screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
;;;411    
;;;412                if (s_screen_const_transfer_count >= screen_reg_start_data_size)
;;;413                {
;;;414                    s_screen_init_complate = true;
;;;415    				TAU_LOGD("tp init done\n");
;;;416                }
;;;417            }
;;;418        }
;;;419    }
00004c  bdf8              POP      {r3-r7,pc}
                  |L16.78|
00004e  6881              LDR      r1,[r0,#8]            ;396
000050  6840              LDR      r0,[r0,#4]            ;396
000052  f7fffffe          BL       app_tp_m_write
                  |L16.86|
000056  bdf8              POP      {r3-r7,pc}
                  |L16.88|
000058  71e5              STRB     r5,[r4,#7]            ;408
00005a  7960              LDRB     r0,[r4,#5]            ;409  ; s_screen_const_transfer_count
00005c  2214              MOVS     r2,#0x14              ;409
00005e  4342              MULS     r2,r0,r2              ;409
000060  1851              ADDS     r1,r2,r1              ;409
000062  68ca              LDR      r2,[r1,#0xc]          ;409
000064  490b              LDR      r1,|L16.148|
000066  f7fffffe          BL       app_tp_screen_analysis_const
00006a  7160              STRB     r0,[r4,#5]            ;409
00006c  7831              LDRB     r1,[r6,#0]            ;412  ; screen_reg_start_data_size
00006e  4288              CMP      r0,r1                 ;412
000070  d3f1              BCC      |L16.86|
000072  7125              STRB     r5,[r4,#4]            ;414
000074  22ff              MOVS     r2,#0xff              ;415
000076  32a0              ADDS     r2,r2,#0xa0           ;415
000078  a107              ADR      r1,|L16.152|
00007a  a009              ADR      r0,|L16.160|
00007c  f7fffffe          BL       LOG_printf
000080  bdf8              POP      {r3-r7,pc}
;;;420    
                          ENDP

000082  0000              DCW      0x0000
                  |L16.132|
                          DCD      ||.data||
                  |L16.136|
                          DCD      screen_reg_start_data_size
                  |L16.140|
                          DCD      screen_reg_start_data
                  |L16.144|
                          DCD      g_screen_tp_init_start
                  |L16.148|
                          DCD      ||.bss||
                  |L16.152|
000098  7461755f          DCB      "tau_log",0
00009c  6c6f6700
                  |L16.160|
0000a0  5b25735d          DCB      "[%s] (%04d) tp init done\n",0
0000a4  20282530
0000a8  34642920
0000ac  74702069
0000b0  6e697420
0000b4  646f6e65
0000b8  0a00    
0000ba  00                DCB      0
0000bb  00                DCB      0

                          AREA ||i.app_tp_transfer_screen_int||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_int PROC
;;;460    **************************************************************************/
;;;461    void app_tp_transfer_screen_int(void)
000000  b538              PUSH     {r3-r5,lr}
;;;462    {
;;;463        static uint8_t len = 0;
;;;464    	  bool screen_gpio_int = false;
;;;465        static uint8_t screen_int_transfer_count = 0;            //记录当前通信到哪一步
;;;466        static bool    screen_int_transfer_buffer_ready = true;  //发送 buffer 是否已准备好
;;;467        volatile bool init_gpio = false;
000002  2500              MOVS     r5,#0
000004  9500              STR      r5,[sp,#0]
;;;468        if (!s_screen_init_complate)                             //TP 初始化还未完成，则先进行初始化操作
000006  4c2c              LDR      r4,|L17.184|
000008  7920              LDRB     r0,[r4,#4]  ; s_screen_init_complate
00000a  2800              CMP      r0,#0
00000c  d00a              BEQ      |L17.36|
;;;469        {
;;;470            app_tp_transfer_screen_const();
;;;471            return;
;;;472        }
;;;473    
;;;474    	app_tp_transfer_screen_restart();
00000e  f7fffffe          BL       app_tp_transfer_screen_restart
;;;475    	app_tp_screen_analysis_wake_up_exec();
000012  f7fffffe          BL       app_tp_screen_analysis_wake_up_exec
;;;476    
;;;477        /**** 1. 判断 screen 是否发出中断信号 ****/
;;;478        // s_screen_int_flag:           中断信号标志位
;;;479        // app_tp_screen_int_lvl_low :  SPI 长时间通信时，偶尔会出现cs拉高导致通信异常卡死，该标志位用于解决卡死的问题
;;;480        init_gpio = app_tp_screen_int_lvl_low();
000016  f7fffffe          BL       app_tp_screen_int_lvl_low
00001a  9000              STR      r0,[sp,#0]
;;;481        screen_gpio_int = (s_screen_int_flag || init_gpio);
00001c  7860              LDRB     r0,[r4,#1]  ; s_screen_int_flag
00001e  2800              CMP      r0,#0
000020  d107              BNE      |L17.50|
000022  e002              B        |L17.42|
                  |L17.36|
000024  f7fffffe          BL       app_tp_transfer_screen_const
                  |L17.40|
;;;482        if (((screen_gpio_int) || (s_screen_int_transfer_status)) && app_tp_m_transfer_complate()) //判断当前不处于通信状态，并且准备通信
;;;483        {
;;;484            s_screen_int_flag = false;
;;;485            if (s_spim_write)                                    //SPI 写数据后需要把接收FIFO的数据读出，不然会影响下一次读取
;;;486            {
;;;487                hal_spi_m_clear_rxfifo();
;;;488                s_spim_write = false;
;;;489            }
;;;490    
;;;491            /**** 2. 发送或读取从机数据 ****/
;;;492            if (screen_int_transfer_buffer_ready)
;;;493            {
;;;494                screen_int_transfer_buffer_ready = false;
;;;495                s_screen_int_transfer_status = true;
;;;496    			len = 0;
;;;497    						#if 1
;;;498    						app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
;;;499    						while(!hal_i2c_m_transfer_complate());
;;;500    						if(s_screen_read_buffer[7]>0)
;;;501    						{
;;;502    							len = s_screen_read_buffer[7]*8;
;;;503    							app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
;;;504    							while(!hal_i2c_m_transfer_complate());		
;;;505    						}	
;;;506    /*						delayUs(100);
;;;507    						while(!hal_gpio_get_input_data(g_screen_input_int_pad))
;;;508    						{
;;;509    							app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
;;;510    							while(!hal_i2c_m_transfer_complate());		
;;;511    							delayUs(100);
;;;512    							if(s_screen_read_buffer[7]>0)
;;;513    							{
;;;514    								len = s_screen_read_buffer[7]*8;
;;;515    								app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
;;;516    								while(!hal_i2c_m_transfer_complate());
;;;517    								delayUs(100);			
;;;518    							}				
;;;519    						}
;;;520    */
;;;521    	//					ap_tp_st_touch_error_handler_F3(s_screen_read_buffer);
;;;522        //        ap_tp_st_touch_error_handler_FF(s_screen_read_buffer);
;;;523        //        ap_tp_st_touch_scan_point_record_event(s_screen_read_buffer, len + 8);
;;;524    
;;;525    		
;;;526    						#else
;;;527                if (!screen_reg_int_data[screen_int_transfer_count].read_flag)  //当前通信不需要读回，直接写
;;;528                {
;;;529                    app_tp_m_write(screen_reg_int_data[screen_int_transfer_count].buffer, screen_reg_int_data[screen_int_transfer_count].txbuffer_size);
;;;530                }
;;;531                else                                                            //当前通信需要读回，先写再读
;;;532                {
;;;533                    app_tp_m_read(screen_reg_int_data[screen_int_transfer_count].buffer, screen_reg_int_data[screen_int_transfer_count].txbuffer_size, \
;;;534                                  s_screen_read_buffer, screen_reg_int_data[screen_int_transfer_count].rxbuffer_size);
;;;535                }
;;;536    
;;;537    		//	ap_tp_st_touch_error_handler_F3(s_screen_read_buffer);
;;;538            //    ap_tp_st_touch_error_handler_FF(s_screen_read_buffer);
;;;539            //    ap_tp_st_touch_scan_point_record_event(s_screen_read_buffer, 8);
;;;540    			
;;;541    						#endif
;;;542            }
;;;543            /**** 3. 解析本次通信数据，并准备下一次通信的buffer ****/
;;;544            else
;;;545            {
;;;546                screen_int_transfer_buffer_ready = true;
;;;547    
;;;548    			screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, \
;;;549                                            (len + 8));
;;;550    			 
;;;551     //          screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, \
;;;552     //                                      screen_reg_int_data[screen_int_transfer_count].rxbuffer_size);
;;;553    
;;;554                if (screen_int_transfer_count >= screen_reg_int_data_size)       //解析需要等最后一次通信结束，最后一次数据解析后，停止通信
;;;555                {
;;;556                    screen_int_transfer_count = 0;
;;;557                    s_screen_int_transfer_status = false;
;;;558                    return;
;;;559                }
;;;560            }
;;;561        }
;;;562    }
000028  bd38              POP      {r3-r5,pc}
                  |L17.42|
00002a  4668              MOV      r0,sp                 ;481
00002c  7800              LDRB     r0,[r0,#0]            ;481
00002e  2800              CMP      r0,#0                 ;481
000030  d000              BEQ      |L17.52|
                  |L17.50|
000032  2001              MOVS     r0,#1                 ;481
                  |L17.52|
000034  78e1              LDRB     r1,[r4,#3]            ;482  ; s_screen_int_transfer_status
000036  4308              ORRS     r0,r0,r1              ;482
000038  d0f6              BEQ      |L17.40|
00003a  f7fffffe          BL       app_tp_m_transfer_complate
00003e  2800              CMP      r0,#0                 ;482
000040  d0f2              BEQ      |L17.40|
000042  7065              STRB     r5,[r4,#1]            ;484
000044  7820              LDRB     r0,[r4,#0]            ;485  ; s_spim_write
000046  2800              CMP      r0,#0                 ;485
000048  d002              BEQ      |L17.80|
00004a  f7fffffe          BL       hal_spi_m_clear_rxfifo
00004e  7025              STRB     r5,[r4,#0]            ;488
                  |L17.80|
000050  7aa1              LDRB     r1,[r4,#0xa]          ;492  ; screen_int_transfer_buffer_ready
000052  2001              MOVS     r0,#1                 ;481
000054  2900              CMP      r1,#0                 ;492
000056  d01f              BEQ      |L17.152|
000058  72a5              STRB     r5,[r4,#0xa]          ;494
00005a  70e0              STRB     r0,[r4,#3]            ;495
00005c  7225              STRB     r5,[r4,#8]            ;496
00005e  4d17              LDR      r5,|L17.188|
000060  2308              MOVS     r3,#8                 ;498
000062  4a17              LDR      r2,|L17.192|
000064  2101              MOVS     r1,#1                 ;498
000066  6828              LDR      r0,[r5,#0]            ;498  ; screen_reg_int_data
000068  f7fffffe          BL       app_tp_m_read
                  |L17.108|
00006c  f7fffffe          BL       hal_i2c_m_transfer_complate
000070  2800              CMP      r0,#0                 ;499
000072  d0fb              BEQ      |L17.108|
000074  4812              LDR      r0,|L17.192|
000076  79c0              LDRB     r0,[r0,#7]            ;500  ; s_screen_read_buffer
000078  2800              CMP      r0,#0                 ;500
00007a  d0d5              BEQ      |L17.40|
00007c  06c0              LSLS     r0,r0,#27             ;502
00007e  0e03              LSRS     r3,r0,#24             ;502
000080  7223              STRB     r3,[r4,#8]            ;502
000082  4a0f              LDR      r2,|L17.192|
000084  2101              MOVS     r1,#1                 ;503
000086  3208              ADDS     r2,r2,#8              ;503
000088  6828              LDR      r0,[r5,#0]            ;503  ; screen_reg_int_data
00008a  f7fffffe          BL       app_tp_m_read
                  |L17.142|
00008e  f7fffffe          BL       hal_i2c_m_transfer_complate
000092  2800              CMP      r0,#0                 ;504
000094  d0fb              BEQ      |L17.142|
                  |L17.150|
000096  bd38              POP      {r3-r5,pc}
                  |L17.152|
000098  72a0              STRB     r0,[r4,#0xa]          ;546
00009a  7a22              LDRB     r2,[r4,#8]            ;548  ; len
00009c  4908              LDR      r1,|L17.192|
00009e  3208              ADDS     r2,r2,#8              ;548
0000a0  7a60              LDRB     r0,[r4,#9]            ;548  ; screen_int_transfer_count
0000a2  f7fffffe          BL       app_tp_screen_analysis_int
0000a6  7260              STRB     r0,[r4,#9]            ;548
0000a8  4906              LDR      r1,|L17.196|
0000aa  7809              LDRB     r1,[r1,#0]            ;554  ; screen_reg_int_data_size
0000ac  4288              CMP      r0,r1                 ;554
0000ae  d3f2              BCC      |L17.150|
0000b0  7265              STRB     r5,[r4,#9]            ;556
0000b2  70e5              STRB     r5,[r4,#3]            ;557
0000b4  bd38              POP      {r3-r5,pc}
;;;563    
                          ENDP

0000b6  0000              DCW      0x0000
                  |L17.184|
                          DCD      ||.data||
                  |L17.188|
                          DCD      screen_reg_int_data
                  |L17.192|
                          DCD      ||.bss||
                  |L17.196|
                          DCD      screen_reg_int_data_size

                          AREA ||i.app_tp_transfer_screen_restart||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_restart PROC
;;;435    
;;;436    void app_tp_transfer_screen_restart(void)
000000  b510              PUSH     {r4,lr}
;;;437    {
;;;438    	if(g_screen_tp_init_restart == true)
000002  4a09              LDR      r2,|L18.40|
000004  7810              LDRB     r0,[r2,#0]  ; g_screen_tp_init_restart
000006  2800              CMP      r0,#0
000008  d006              BEQ      |L18.24|
;;;439    	{
;;;440    		if(s_tp_restart_count < (65536/5))  // 65536*3 = 900ms  65536/5 = 60ms
00000a  4908              LDR      r1,|L18.44|
00000c  4b08              LDR      r3,|L18.48|
00000e  6948              LDR      r0,[r1,#0x14]  ; s_tp_restart_count
000010  4298              CMP      r0,r3
000012  d202              BCS      |L18.26|
;;;441    		{
;;;442    	        s_tp_restart_count ++;
000014  1c40              ADDS     r0,r0,#1
000016  6148              STR      r0,[r1,#0x14]  ; s_tp_restart_count
                  |L18.24|
;;;443    	    }else
;;;444    		{
;;;445    			s_tp_restart_count = 0;
;;;446    	        g_screen_tp_init_restart = false;
;;;447    	//		app_tp_transfer_screen_start();
;;;448    			ap_tp_st_touch_hardware_reset();
;;;449    	    }
;;;450    	}
;;;451        
;;;452    }
000018  bd10              POP      {r4,pc}
                  |L18.26|
00001a  2000              MOVS     r0,#0                 ;445
00001c  6148              STR      r0,[r1,#0x14]         ;445  ; s_tp_restart_count
00001e  7010              STRB     r0,[r2,#0]            ;446
000020  f7fffffe          BL       ap_tp_st_touch_hardware_reset
000024  bd10              POP      {r4,pc}
;;;453    
                          ENDP

000026  0000              DCW      0x0000
                  |L18.40|
                          DCD      g_screen_tp_init_restart
                  |L18.44|
                          DCD      ||.data||
                  |L18.48|
                          DCD      0x00003333

                          AREA ||i.app_tp_transfer_screen_start||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_start PROC
;;;427    **************************************************************************/
;;;428    void app_tp_transfer_screen_start(void)
000000  b510              PUSH     {r4,lr}
;;;429    {
;;;430        s_screen_init_complate = false;
000002  4804              LDR      r0,|L19.20|
000004  2100              MOVS     r1,#0
000006  7101              STRB     r1,[r0,#4]
;;;431        s_screen_const_transfer_count = 0;
000008  7141              STRB     r1,[r0,#5]
;;;432        app_tp_screen_init();
00000a  f7fffffe          BL       app_tp_screen_init
;;;433        app_tp_transfer_screen_const();
00000e  f7fffffe          BL       app_tp_transfer_screen_const
;;;434    }
000012  bd10              POP      {r4,pc}
;;;435    
                          ENDP

                  |L19.20|
                          DCD      ||.data||

                          AREA ||.bss||, DATA, NOINIT, ALIGN=0

                  s_screen_read_buffer
                          %        250
                  s_phone_read_buffer
                          %        250

                          AREA ||.data||, DATA, ALIGN=2

                  s_spim_write
000000  00                DCB      0x00
                  s_screen_int_flag
000001  00                DCB      0x00
                  s_phone_reset_flag
000002  00                DCB      0x00
                  s_screen_int_transfer_status
000003  00                DCB      0x00
                  s_screen_init_complate
000004  01                DCB      0x01
                  s_screen_const_transfer_count
000005  ff                DCB      0xff
                  i2cs_transfer
000006  01                DCB      0x01
                  screen_const_transfer_buffer_ready
000007  01                DCB      0x01
                  len
000008  00                DCB      0x00
                  screen_int_transfer_count
000009  00                DCB      0x00
                  screen_int_transfer_buffer_ready
00000a  0100              DCB      0x01,0x00
                  s_slave_txbuffer
                          DCD      0x00000000
                  s_slave_txbuffer_size
                          DCD      0x00000000
                  s_tp_restart_count
                          DCD      0x00000000

;*** Start embedded assembler ***

#line 1 "..\\..\\src\\app\\touch\\app_tp_transfer.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___17_app_tp_transfer_c_e672c05a____REV16|
#line 467 "C:\\Users\\55\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
|__asm___17_app_tp_transfer_c_e672c05a____REV16| PROC
#line 468

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___17_app_tp_transfer_c_e672c05a____REVSH|
#line 482
|__asm___17_app_tp_transfer_c_e672c05a____REVSH| PROC
#line 483

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
