1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-22 12:32:02 +00:00

feat(core): Add prodtest function which prints simple text log on the screen [no changelog]

This commit is contained in:
kopecdav 2025-02-17 08:40:07 +01:00 committed by kopecdav
parent eda9f2b183
commit 9f03e0c37b
2 changed files with 29 additions and 0 deletions

View File

@ -158,6 +158,15 @@ display-border
OK
```
### display-text
The `display-text` command draws text to the screen
Example:
```
display-text hello_world
OK
```
### display-bars
Draws vertical color bars on the screen according to a specified string of color codes.

View File

@ -36,6 +36,19 @@ static void prodtest_display_border(cli_t* cli) {
cli_ok(cli, "");
}
static void prodtest_display_text(cli_t* cli) {
if (cli_arg_count(cli) > 1) {
cli_error_arg_count(cli);
return;
}
const char* text = cli_arg(cli, "text");
screen_prodtest_show_text(text, strlen(text));
cli_ok(cli, "");
}
static void prodtest_display_bars(cli_t* cli) {
const char* colors = cli_arg(cli, "colors");
size_t color_count = strlen(colors);
@ -95,6 +108,13 @@ PRODTEST_CLI_CMD(
.args = ""
);
PRODTEST_CLI_CMD(
.name = "display-text",
.func = prodtest_display_text,
.info = "Display text on the screen",
.args = "<text>"
);
PRODTEST_CLI_CMD(
.name = "display-bars",
.func = prodtest_display_bars,