This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于串口的收发缓存设置为256的问题,请帮助解决

请问如何将串口的收发缓存设置为256,也就是一次能发送256个字节。我按照教科书上面的方法试了很多次,都没有成功,只能一次发送128个字节。请高手帮助解决。多谢!

    1. //==========================================================================  
    2. // 串口0初始化函数  
    3. //==========================================================================  
    4. static void FS_Uart_Init(void)  
    5. {   
    6.   halUARTCfg_t uartConfig;  
    7.     
    8.   uartConfig.configured            = TRUE;              // 2x30 don't care - see uart driver.  
    9.   uartConfig.baudRate             = HAL_UART_BR_115200;  
    10.   uartConfig.flowControl          = FALSE;  
    11.   uartConfig.flowControlThreshold = 256; // 2x30 don't care - see uart driver.  
    12.   uartConfig.rx.maxBufSize        = 70;  // 2x30 don't care - see uart driver.  
    13.   uartConfig.tx.maxBufSize        = 256;  // 2x30 don't care - see uart driver.  
    14.   uartConfig.idleTimeout            = 6;   // 2x30 don't care - see uart driver.  
    15.   uartConfig.intEnable               = TRUE;              // 2x30 don't care - see uart driver.  
    16.   uartConfig.callBackFunc         = FS_Uart_CallBack;  
    17.   HalUARTOpen (HAL_UART_PORT_0, &uartConfig);  
  • 按上述配置试了一下,还是不行