IngmarEckhardt / IngmarEckhardt/dwarfOS

usartReceiveLine should terminate the string after LF and not CR

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
C
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Description:
The current implementation of the UART Helper function does not adhere to standard conventions. Specifically, it uses carriage return (\r) characters to terminate strings, whereas line feed (\n) characters are more commonly used for this purpose in many programming environments. Additionally, the naming convention of the function could be improved to enhance readability and understanding. For example, a more descriptive name like getString() could be used instead of gets.

Furthermore, the implementation could be enhanced by incorporating tests that run on the MCU. The usartReceive function could be converted into a function pointer, which could then point to a function in the test code. This function would simulate user input by providing fake characters, thereby facilitating more robust testing of the UART Helper function.

User Story:
As a developer, I expect the UART Helper function to use standard conventions, such as terminating strings with line feed (\n) characters and adopting descriptive function names like getString(), so that the code is more readable and easier to understand.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.