fix(split): correct async UART RX buffer definition (#3193)

The RX buffer was previously defined as [RX_BUFFER_SIZE/2][2], which
created (RX_BUFFER_SIZE/2) small 2-byte buffers instead of the two
(RX_BUFFER_SIZE/2)-byte buffers required for DMA ping-pong operation.

Update the buffer definition to [2][RX_BUFFER_SIZE/2] and apply the
fix to both the central and peripheral wired split implementations.

This prevents potential DMA RX data corruption when using async UART.
This commit is contained in:
Solodros
2026-01-08 06:04:52 +08:00
committed by GitHub
parent cb786cd7d6
commit 36dbf46764
2 changed files with 2 additions and 2 deletions

View File

@@ -87,7 +87,7 @@ K_WORK_DEFINE(publish_events, publish_events_work);
#if IS_ENABLED(CONFIG_ZMK_SPLIT_WIRED_UART_MODE_ASYNC)
uint8_t async_rx_buf[RX_BUFFER_SIZE / 2][2];
uint8_t async_rx_buf[2][RX_BUFFER_SIZE / 2];
static struct zmk_split_wired_async_state async_state = {
.process_tx_work = &publish_events,

View File

@@ -89,7 +89,7 @@ K_MSGQ_DEFINE(cmd_msg_queue, sizeof(struct zmk_split_transport_central_command),
#if IS_ENABLED(CONFIG_ZMK_SPLIT_WIRED_UART_MODE_ASYNC)
uint8_t async_rx_buf[RX_BUFFER_SIZE / 2][2];
uint8_t async_rx_buf[2][RX_BUFFER_SIZE / 2];
static struct zmk_split_wired_async_state async_state = {
.rx_bufs = {async_rx_buf[0], async_rx_buf[1]},