进一步迭代优化统一管理

This commit is contained in:
冯佳
2026-01-23 14:35:51 +08:00
parent 988cc7ad4a
commit 075e8299cf
36 changed files with 6146 additions and 1590 deletions

View File

@ -85,7 +85,9 @@ size_t uart_receive(uint8_t *data, size_t length) {
return 0;
}
return hal_uart_receive(uart.config.instance, data, length);
size_t received = 0;
hal_uart_receive(uart.config.instance, data, length, &received);
return received;
}
/**
@ -93,7 +95,9 @@ size_t uart_receive(uint8_t *data, size_t length) {
* @retval 1 if ready, 0 otherwise
*/
uint8_t uart_is_tx_ready(void) {
return hal_uart_is_tx_ready(uart.config.instance);
uint8_t ready = 0;
hal_uart_is_tx_ready(uart.config.instance, &ready);
return ready;
}
/**
@ -101,5 +105,7 @@ uint8_t uart_is_tx_ready(void) {
* @retval 1 if data available, 0 otherwise
*/
uint8_t uart_is_rx_ready(void) {
return hal_uart_is_rx_ready(uart.config.instance);
uint8_t ready = 0;
hal_uart_is_rx_ready(uart.config.instance, &ready);
return ready;
}