| 
 | 
 
Information
| 说明: | 
  建议参照本版块置顶帖内容输入必要信息 | 
 
| 芯片型号: | 
tlsr8258  | 
 
| SDK及版本: | 
sig_mesh_sdk  | 
 
 
 
请问blc_rx_from_uart()函数是怎样使用的,应该在哪里调用,有点没看懂。如果我想把串口接收的数据取出来到我自己定义的缓存数组中该怎么操作呢,另外当我把 UART_DATA_SIZE 宏定义改大后,程序会崩溃,但是我们有一次接收很多字节(2k bytes)的需求,以下是我修改的程序片段 
 
 
// #define UART_DATA_SIZE              (EXTENDED_ADV_ENABLE ? 280 : 72)    // increase or decrease 16bytes for each step. 
#define UART_DATA_SIZE              (2048 - 4 - 4)  // fyb change bigger for ota data 
 
 
 
 
 
int blc_rx_from_uart (void) 
{ 
    uart_ErrorCLR(); 
     
    uart_data_t* p = (uart_data_t *)my_fifo_get(&hci_rx_fifo); 
    if(p){ 
        u32 rx_len = p->len  & 0xffff ; //usually <= 255 so 1 byte should be sufficient //0xff change to 0xffff 
        LOG_USER_MSG_INFO(0,0,"rx_num  %d\r\n",rx_len); 
        if (rx_len) 
        { 
            #if 0 // Serial loop test 
            #if 1 
            if(0 == my_fifo_push_hci_tx_fifo(p->data, rx_len, 0, 0)); 
            #else 
            if(uart_Send(p->data, rx_len)) 
            #endif 
            { 
                my_fifo_pop(&hci_rx_fifo); 
            } 
            #else 
            app_hci_cmd_from_usb_handle(p->data, rx_len); 
            my_fifo_pop(&hci_rx_fifo); 
            #endif 
        } 
    } 
    return 0; 
} 
 
 
 
 
 
 
 |   
 
 
 
 |