美文网首页
[AR934X]自定义组合按键进入u-boot

[AR934X]自定义组合按键进入u-boot

作者: 金珉锡_4bc1 | 来源:发表于2018-11-21 14:55 被阅读0次

    修改/home/data/AR9344/SDK/sdk/boot/u-boot/common/main.c文件

     #ifdef CONFIG_MENUPROMPT
         printf(CONFIG_MENUPROMPT, bootdelay);
     #else
         printf("Hit any key to stop autoboot: %2d ", bootdelay);
     #endif
     
     #if defined CONFIG_ZERO_BOOTDELAY_CHECK
         /*
          * Check if key already pressed
          * Don't check if bootdelay < 0
          */
         if (bootdelay >= 0) {
             if (tstc()) {   /* we got a key press   */
                 (void) getc();  /* consume input    */
                 puts ("\b\b\b 0");
                 abort = 1;  /* don't auto boot  */
             }
         }
     #endif
     
         while ((bootdelay > 0) && (!abort)) {
             int i;
     
             --bootdelay;
             /* delay 100 * 10ms */
             for (i=0; !abort && i<100; ++i) {
                 if (tstc()) {   /* we got a key press   */
                     if(13 == getc()){
                         abort  = 1; /* don't auto boot  */
                         bootdelay = 0;  /* no more delay    */
     # ifdef CONFIG_MENUKEY
                         menukey = getc();
     # else
                         (void) getc();  /* consume input    */
     # endif
                         break;
                     }
                 }
                 udelay (10000);
             }
     
             printf ("\b\b\b%2d ", bootdelay);
         }
     
         putc ('\n');
    
    
    回车键:VK_RETURN (13)
    修改之后,只有按下回车键,才会进入u-boot

    相关文章

      网友评论

          本文标题:[AR934X]自定义组合按键进入u-boot

          本文链接:https://www.haomeiwen.com/subject/erlcqqtx.html