summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e6d6ad6)
ao_cmd_lex_u32 is produced in addition to ao_cmd_lex_i so that
functions can easily read 32-bit values from the command line.
Signed-off-by: Keith Packard <keithp@keithp.com>
};
extern __xdata uint16_t ao_cmd_lex_i;
};
extern __xdata uint16_t ao_cmd_lex_i;
+extern __xdata uint32_t ao_cmd_lex_u32;
extern __xdata char ao_cmd_lex_c;
extern __xdata enum ao_cmd_status ao_cmd_status;
extern __xdata char ao_cmd_lex_c;
extern __xdata enum ao_cmd_status ao_cmd_status;
#include "ao.h"
__xdata uint16_t ao_cmd_lex_i;
#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;
static __xdata uint8_t lex_echo;
__xdata char ao_cmd_lex_c;
__xdata enum ao_cmd_status ao_cmd_status;
static __xdata uint8_t lex_echo;
{
__xdata uint8_t r = ao_cmd_lex_error;
{
__xdata uint8_t r = ao_cmd_lex_error;
ao_cmd_white();
for(;;) {
if ('0' <= ao_cmd_lex_c && ao_cmd_lex_c <= '9')
ao_cmd_white();
for(;;) {
if ('0' <= ao_cmd_lex_c && ao_cmd_lex_c <= '9')
- ao_cmd_lex_i = (ao_cmd_lex_i * 10) + (ao_cmd_lex_c - '0');
+ ao_cmd_lex_u32 = (ao_cmd_lex_u32 * 10) + (ao_cmd_lex_c - '0');
else
break;
r = ao_cmd_success;
else
break;
r = ao_cmd_success;
}
if (r != ao_cmd_success)
ao_cmd_status = r;
}
if (r != ao_cmd_success)
ao_cmd_status = r;
+ ao_cmd_lex_i = (uint16_t) ao_cmd_lex_u32;