1 Star 0 Fork 0

泰晓科技/qemu-u-boot

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pause.c 716 Bytes
一键复制 编辑 原始数据 按行查看 历史
Samuel Dionne-Riel 提交于 2022-08-19 03:44 +08:00 . cmd: Add pause command
// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2021
* Samuel Dionne-Riel <samuel@dionne-riel.com>
*/
#include <command.h>
#include <stdio.h>
static int do_pause(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *message = "Press any key to continue...";
if (argc == 2)
message = argv[1];
/* No newline, so it sticks to the bottom of the screen */
printf("%s", message);
/* Wait on "any" key... */
(void) getchar();
/* Since there was no newline, we need it now */
printf("\n");
return CMD_RET_SUCCESS;
}
U_BOOT_CMD(pause, 2, 1, do_pause,
"delay until user input",
"[prompt] - Wait until users presses any key. [prompt] can be used to customize the message.\n"
);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tinylab/qemu-u-boot.git
git@gitee.com:tinylab/qemu-u-boot.git
tinylab
qemu-u-boot
qemu-u-boot
master

搜索帮助