Skip to content

Optional parameters for puts() #1

@chrisdedman

Description

@chrisdedman

Description

Right now, our puts() wrapper simply sends a null-terminated string over UART. To improve flexibility (for log levels, timestamps, or custom prompts), we’d like to allow callers to pass an optional parameter similar to std printf.

Important

To avoid breaking the current call of puts(“hello”), the parameter should be optional. Additionally, the API documentation should include example use cases.

Current behavior

// Send a null-terminated string over UART
void puts(const char *s);

Desired behavior

void puts(const char *s, const char *param); // this is for example purpose, not sure about the datatype, yet

// Examples:
puts("System initialized\r\n");
// → “System initialized”
//
puts("Current time:\r\n", __TIME__); // or something similar than printf()
// → “Current time: 20:24:32”

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions