Skip to content

Stop using strings #615

@FoniksFox

Description

@FoniksFox

The firmware should not use even one string, the strings we have are static, so they can be substituted by an id + arguments (kind of like a packet), and have the corresponding strings in a json in the adj.

If done with a githook, it could look something like this:

// Before
ErrorHandler("HAL error handler triggered");

// After
    // @error_id "HAL error handler triggered"  [STLIB.1]
    ErrorHandler(STLIB.1);

for strings without arguments, and:

// Before
ErrorHandler("HAL error handler triggered %i", 5);

// After
    // @error_id "HAL error handler triggered %i"  [STLIB.1]
    ErrorHandler(STLIB.1, 5);

for string with arguments.

It could be executed as a pre-commit.

The ErrorHandler and InfoWarning should be modified accordingly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions