1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-25 03:29:02 +00:00

fixup! refactor(core/prodtest): make cli non-blocking, event-loop compatible

This commit is contained in:
tychovrahe 2025-03-27 11:08:42 +01:00
parent 7623646538
commit 24a5ea759d
3 changed files with 4 additions and 4 deletions

View File

@ -257,7 +257,7 @@ int main(void) {
while (true) { while (true) {
if (usb_vcp_can_read(VCP_IFACE)) { if (usb_vcp_can_read(VCP_IFACE)) {
cli_run(&g_cli); cli_process_io(&g_cli);
} }
#if defined USE_BUTTON && defined USE_POWERCTL #if defined USE_BUTTON && defined USE_POWERCTL

View File

@ -557,7 +557,7 @@ static void cli_process_command(cli_t* cli, const cli_command_t* cmd) {
} }
} }
void cli_run(cli_t* cli) { void cli_process_io(cli_t* cli) {
int res; int res;
do { do {
int ch = cli_readch(cli); int ch = cli_readch(cli);

View File

@ -132,8 +132,8 @@ bool cli_init(cli_t* cli, cli_read_cb_t read, cli_write_cb_t write,
void cli_set_commands(cli_t* cli, const cli_command_t* cmd_array, void cli_set_commands(cli_t* cli, const cli_command_t* cmd_array,
size_t cmd_count); size_t cmd_count);
// Runs the CLI. Only to be called when new data are available. // Process the newly received characters from the console input
void cli_run(cli_t* cli); void cli_process_io(cli_t* cli);
// Returne the number of arguments in the command line // Returne the number of arguments in the command line
size_t cli_arg_count(cli_t* cli); size_t cli_arg_count(cli_t* cli);