public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] CONFIG_MENUKEY: RFC: Is this how CONFIG_MENUKEY supposed to work?
@ 2008-08-28 21:20 richardretanubun
  0 siblings, 0 replies; only message in thread
From: richardretanubun @ 2008-08-28 21:20 UTC (permalink / raw)
  To: u-boot

I noticed that CONFIG_MENUKEY aborts autoboot unconditionally
and executes the "menucmd" env.variable if it found a match later on. 
This seems odd.
It is possible that I misunderstood the intent of the logic. The only 
other user of it now is AmigaOneG3SE.

I made a patch to make the logic only aborts autoboot if there is a 
match detected.

If the person who wrote the logic is reading this, did I understood the 
logic correctly?
If so please Sign-off the patch to have it applied.

Signed-off-by: Richard Retanubun <RichardRetanubun_at_ruggedcom.com>
----

diff --git a/common/main.c b/common/main.c
index 187ef8a..5a4308d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -238,14 +238,19 @@ static __inline__ int abortboot(int bootdelay)
                /* delay 100 * 10ms */
                for (i=0; !abort && i<100; ++i) {
                        if (tstc()) {   /* we got a key press   */
-                               abort  = 1;     /* don't auto boot      */
-                               bootdelay = 0;  /* no more delay        */
 # ifdef CONFIG_MENUKEY
                                menukey = getc();
+                               if (menukey == CONFIG_MENUKEY) {        /* we got a match */
+                                       abort  = 1;     /* don't auto boot      */
+                                       bootdelay = 0;  /* no more delay        */
+                                       break;
+                               }
 # else
-                               (void) getc();  /* consume input        */
-# endif
+                               (void) getc();  /* consume input        */
+                               abort  = 1;     /* don't auto boot      */
+                               bootdelay = 0;  /* no more delay        */
                                break;
+# endif
                        }
                        udelay(10000);
                }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-28 21:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-28 21:20 [U-Boot] [PATCH 1/1] CONFIG_MENUKEY: RFC: Is this how CONFIG_MENUKEY supposed to work? richardretanubun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox