Repository navigation
Port modules to uart. - #119
Closed
kareltucek wants to merge 1 commit into
Closed
kareltucek wants to merge 1 commit into
kareltucek wants to merge 1 commit into
Conversation
kareltucek
force-pushed
the
uart_modules
branch
2 times, most recently
from
December 17, 2025 11:41
51d2d81 to
6d5832e
Compare
There was a problem hiding this comment.
Pull request overview
This PR ports module communication from I2C to UART protocol, enabling modules (particularly the trackpoint module) to communicate with the keyboard base via UART instead of I2C. This is a significant architectural change that involves creating new UART parser/link infrastructure, refactoring the existing UART code into separate bridge and module components, and updating module drivers to support both communication protocols.
Key changes:
- New UART parser and link layer implementation for packet framing, escaping, and CRC validation
- Split of existing UART implementation into
uart_bridge(for keyboard-to-keyboard communication) anduart_modules(for module communication) - Updated module protocol handlers to support both I2C and UART modes
- Configuration changes to enable UART on modules and adjust buffer sizes
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/uart_parser.h/c | New UART packet parser with escape sequences and CRC validation |
| shared/uart_defs.h | Common UART protocol definitions and buffer size calculations |
| shared/module/uart.h/c | Module-side UART implementation for KL03 microcontroller |
| device/src/keyboard/uart_bridge.h/c | Renamed from uart.h/c, handles keyboard-to-keyboard UART |
| device/src/keyboard/uart_modules.h/c | New module UART handler on keyboard side |
| device/src/keyboard/uart_link.h/c | Common UART link layer for Zephyr-based devices |
| right/src/slave_drivers/uhk_module_driver.c | Updated to support UART communication alongside I2C |
| right/src/slave_scheduler.c | Refactored to extract common transfer logic |
| shared/module/slave_protocol_handler.c | Updated function signatures to accept data pointer parameter |
| trackpoint/src/module.h/c | Configuration updates for UART mode and debug functionality |
| shared/crc16.h | Made data pointer const for compatibility |
| boards/ugl/uhk-80/uhk-80-right.dts | Swapped UART TX/RX pin assignments |
| Various files | Updated includes from uart.h to uart_bridge.h |
Comments suppressed due to low confidence (2)
right/src/slave_drivers/uhk_module_driver.c:247
- The message length for
SlaveCommand_JumpToBootloaderhas been changed from 1 to 2, but no additional data is being added to the message. This appears to be incorrect and may cause the bootloader jump to fail or behave unexpectedly.
res.status = tx(i2cAddress);
trackpoint/src/module.c:606
- Commented-out code should be removed instead of left in the codebase. If this debugging code is needed, consider using a debug flag or removing it entirely.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kareltucek
force-pushed
the
uart_modules
branch
from
December 17, 2025 12:20
6d5832e to
0508821
Compare
kareltucek
force-pushed
the
uart_modules
branch
from
December 17, 2025 12:39
0508821 to
790b16a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.