mirror of
https://xff.cz/git/u-boot/
synced 2025-10-22 10:31:56 +02:00
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commitc8ffd1356d, reversing changes made to2ee6f3a5f7. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
51 lines
951 B
C
51 lines
951 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* The 'conitrace' command prints the codes received from the console input as
|
|
* hexadecimal numbers.
|
|
*
|
|
* Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|
*/
|
|
#include <common.h>
|
|
#include <command.h>
|
|
#include <linux/delay.h>
|
|
|
|
static int do_conitrace(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
char *const argv[])
|
|
{
|
|
bool first = true;
|
|
|
|
printf("Waiting for your input\n");
|
|
printf("To terminate type 'x'\n");
|
|
|
|
/* Empty input buffer */
|
|
while (tstc())
|
|
getchar();
|
|
|
|
for (;;) {
|
|
int c = getchar();
|
|
|
|
if (first && (c == 'x' || c == 'X'))
|
|
break;
|
|
|
|
printf("%02x ", c);
|
|
first = false;
|
|
|
|
/* 10 ms delay - serves to detect separate keystrokes */
|
|
udelay(10000);
|
|
if (!tstc()) {
|
|
printf("\n");
|
|
first = true;
|
|
}
|
|
}
|
|
|
|
return CMD_RET_SUCCESS;
|
|
}
|
|
|
|
U_BOOT_LONGHELP(conitrace, "");
|
|
|
|
U_BOOT_CMD_COMPLETE(
|
|
conitrace, 2, 0, do_conitrace,
|
|
"trace console input",
|
|
conitrace_help_text, NULL
|
|
);
|