mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-03 13:22:33 +00:00
feat(core): Add prodtest function which prints simple text log on the screen [no changelog]
This commit is contained in:
parent
eda9f2b183
commit
9f03e0c37b
@ -158,6 +158,15 @@ display-border
|
|||||||
OK
|
OK
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### display-text
|
||||||
|
The `display-text` command draws text to the screen
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
display-text hello_world
|
||||||
|
OK
|
||||||
|
```
|
||||||
|
|
||||||
### display-bars
|
### display-bars
|
||||||
Draws vertical color bars on the screen according to a specified string of color codes.
|
Draws vertical color bars on the screen according to a specified string of color codes.
|
||||||
|
|
||||||
|
@ -36,6 +36,19 @@ static void prodtest_display_border(cli_t* cli) {
|
|||||||
cli_ok(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) {
|
static void prodtest_display_bars(cli_t* cli) {
|
||||||
const char* colors = cli_arg(cli, "colors");
|
const char* colors = cli_arg(cli, "colors");
|
||||||
size_t color_count = strlen(colors);
|
size_t color_count = strlen(colors);
|
||||||
@ -95,6 +108,13 @@ PRODTEST_CLI_CMD(
|
|||||||
.args = ""
|
.args = ""
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PRODTEST_CLI_CMD(
|
||||||
|
.name = "display-text",
|
||||||
|
.func = prodtest_display_text,
|
||||||
|
.info = "Display text on the screen",
|
||||||
|
.args = "<text>"
|
||||||
|
);
|
||||||
|
|
||||||
PRODTEST_CLI_CMD(
|
PRODTEST_CLI_CMD(
|
||||||
.name = "display-bars",
|
.name = "display-bars",
|
||||||
.func = prodtest_display_bars,
|
.func = prodtest_display_bars,
|
||||||
|
Loading…
Reference in New Issue
Block a user