Chinaunix首页 | 论坛 | 博客
  • 博客访问: 464065
  • 博文数量: 100
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 955
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-21 09:30
文章分类

全部博文(100)

文章存档

2017年(1)

2016年(16)

2015年(83)

我的朋友

分类: 嵌入式

2015-10-22 10:53:39

u-boot版本为2014.04。
要使用这功能,首先不能定义CONFIG_AUTOBOOT_KEYED,因为mail.c中有:
static int abortboot(int bootdelay)
{
#ifdef CONFIG_AUTOBOOT_KEYED
    return abortboot_keyed(bootdelay);
#else
    return abortboot_normal(bootdelay);
#endif
}

abortboot_normal才是正常的延时启动函数,如果定义了CONFIG_AUTOBOOT_KEYED,就会进入
abortboot_keyed函数,该函数需要按下指定按键才会停止autoboot,并且可以添加菜单。

process_boot_delay

    if (bootdelay != -1 && s && !abortboot(bootdelay)) {
#if defined(CONFIG_AUTOBOOT_KEYED) && !defined(CONFIG_AUTOBOOT_KEYED_CTRLC)
        int prev = disable_ctrlc(1);    /* disable Control C checking */
#endif

        run_command_list(s, -1, 0);

所以configs中配置如下:
/*#define CONFIG_CMD_BOOTMENU*/
#ifdef CONFIG_CMD_BOOTMENU
#define CONFIG_MENU
#define CONFIG_MENU_SHOW
#define CONFIG_AUTOBOOT_KEYED
#endif
#define CONFIG_AUTOBOOT_PROMPT \
        "Press any key to abort autoboot in %d seconds.\n",bootdelay

#define CONFIG_AUTOBOOT_DELAY_STR "CONFIG_AUTOBOOT_DELAY_STR:any key to abort autoboot\n"

现在来看CONFIG_AUTOBOOT_KEYED,如果选择从abortboot_keyed启动,不能定义:
#define CONFIG_ZERO_BOOTDELAY_CHECK



阅读(3656) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~