Skip to content

usartReceiveLine should terminate the string after LF and not CR #33

Description

@IngmarEckhardt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions