We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用dma方式打印时,如果直接调用HAL_UART_Transmit_DMA,会在回显命令时调用频繁而出错,因此使用了环形缓冲。 但是如果缓冲区不够大,会导致shell信息打印不全。 直接使用HAL_UART_Transmit_DMA: 使用环形缓冲,大小为128Bytes:
The text was updated successfully, but these errors were encountered:
SHELL_TEXT_INFO的信息大小大概有380+字节,所以发送缓冲区建议大于400字节,不然就考虑环形缓冲满了之后先等着发送完成之后再继续填充,我fork的仓库里面有一份参考可以试试
Sorry, something went wrong.
已经在写函数中处理了。我使用的缓冲是lwrb,可以返回实际写入的长度,因此使用该长度循环打印直到完成。这样缓冲区的长度可以少于400字节。 ` short userShellWrite(char *data, unsigned short len) { uint32_t sendLen = 0; do { sendLen += uart_send_dma(&huart1, (uint8_t *)(data + sendLen), len - sendLen); } while (sendLen < len);
return sendLen;
} `
No branches or pull requests
使用dma方式打印时,如果直接调用HAL_UART_Transmit_DMA,会在回显命令时调用频繁而出错,因此使用了环形缓冲。
但是如果缓冲区不够大,会导致shell信息打印不全。
直接使用HAL_UART_Transmit_DMA:
使用环形缓冲,大小为128Bytes:
The text was updated successfully, but these errors were encountered: