projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Export 'ao_cmd_is_white' for use by other code
[fw/altos]
/
src
/
core
/
ao_cmd.c
diff --git
a/src/core/ao_cmd.c
b/src/core/ao_cmd.c
index d0a4663352ff703718b0e4d27ab4834d42e2660d..14cb7569b5df9b0e9840afc8d494cccd5f1386ba 100644
(file)
--- a/
src/core/ao_cmd.c
+++ b/
src/core/ao_cmd.c
@@
-121,10
+121,16
@@
ao_cmd_put8(uint8_t v)
putnibble(v & 0xf);
}
putnibble(v & 0xf);
}
+uint8_t
+ao_cmd_is_white(void)
+{
+ return ao_cmd_lex_c == ' ' || ao_cmd_lex_c == '\t';
+}
+
void
ao_cmd_white(void)
{
void
ao_cmd_white(void)
{
- while (ao_cmd_
lex_c == ' ' || ao_cmd_lex_c == '\t'
)
+ while (ao_cmd_
is_white()
)
ao_cmd_lex();
}
ao_cmd_lex();
}
@@
-227,6
+233,12
@@
ao_reboot(void)
ao_cmd_white();
if (!ao_match_word("eboot"))
return;
ao_cmd_white();
if (!ao_match_word("eboot"))
return;
+ /* Delay waiting for the packet master to be turned off
+ * so that we don't end up back in idle mode because we
+ * received a packet after boot.
+ */
+ flush();
+ ao_delay(AO_SEC_TO_TICKS(1));
ao_arch_reboot();
ao_panic(AO_PANIC_REBOOT);
}
ao_arch_reboot();
ao_panic(AO_PANIC_REBOOT);
}
@@
-259,8
+271,8
@@
help(void)
cs = ao_cmds[cmds];
for (cmd = 0; cs[cmd].func; cmd++)
printf("%-45s %s\n",
cs = ao_cmds[cmds];
for (cmd = 0; cs[cmd].func; cmd++)
printf("%-45s %s\n",
-
cs[cmd].help,
-
cs[cmd].help+1+strlen(cs[cmd].help));
+ cs[cmd].help,
+ cs[cmd].help+1+strlen(cs[cmd].help));
}
}
}
}