#include "ao.h"
-__xdata uint16_t ao_cmd_lex_i;
-__xdata uint32_t ao_cmd_lex_u32;
-__xdata char ao_cmd_lex_c;
-__xdata enum ao_cmd_status ao_cmd_status;
+__pdata uint16_t ao_cmd_lex_i;
+__pdata uint32_t ao_cmd_lex_u32;
+__pdata char ao_cmd_lex_c;
+__pdata enum ao_cmd_status ao_cmd_status;
#define CMD_LEN 32
static __xdata char cmd_line[CMD_LEN];
-static __xdata uint8_t cmd_len;
-static __xdata uint8_t cmd_i;
+static __pdata uint8_t cmd_len;
+static __pdata uint8_t cmd_i;
static void
-put_string(char *s)
+put_string(__code char *s)
{
- __xdata char c;
+ char c;
while (c = *s++)
putchar(c);
}
static void
readline(void)
{
- __xdata char c;
+ __pdata char c;
if (ao_echo())
put_string("> ");
cmd_len = 0;
void
ao_cmd_hex(void)
{
- __xdata uint8_t r = ao_cmd_lex_error;
+ __pdata uint8_t r = ao_cmd_lex_error;
uint8_t n;
ao_cmd_lex_i = 0;
void
ao_cmd_decimal(void)
{
- __xdata uint8_t r = ao_cmd_lex_error;
+ __pdata uint8_t r = ao_cmd_lex_error;
ao_cmd_lex_u32 = 0;
ao_cmd_white();
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));
WDCTL = WDCTL_EN | WDCTL_MODE_WATCHDOG | WDCTL_INT_64;
ao_delay(AO_SEC_TO_TICKS(2));
ao_panic(AO_PANIC_REBOOT);
printf("manufacturer %s\n", ao_manufacturer);
printf("product %s\n", ao_product);
printf("serial-number %u\n", ao_serial_number);
+#if HAS_EEPROM
+ printf("log-format %u\n", ao_log_format);
+#endif
printf("software-version %s\n", ao_version);
}
#define NUM_CMDS 11
static __code struct ao_cmds *__xdata (ao_cmds[NUM_CMDS]);
-static __xdata uint8_t ao_ncmds;
+static __pdata uint8_t ao_ncmds;
static void
help(void)
{
- __xdata uint8_t cmds;
- __xdata uint8_t cmd;
- __code struct ao_cmds * __xdata cs;
+ register uint8_t cmds;
+ register uint8_t cmd;
+ register __code struct ao_cmds * cs;
for (cmds = 0; cmds < ao_ncmds; cmds++) {
cs = ao_cmds[cmds];