mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-19 20:45:18 -05:00
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:
@@ -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,
|
||||
|
||||
@@ -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]},
|
||||
|
||||
Reference in New Issue
Block a user