Two implementations of the same function, one in cc1111/ao_dbg.c and
the other in core/ao_send_packet.c.
Signed-off-by: Keith Packard <keithp@keithp.com>
putchar('\n');
}
-static uint8_t
-getnibble(void)
-{
- __pdata char c;
-
- c = getchar();
- if ('0' <= c && c <= '9')
- return c - '0';
- if ('a' <= c && c <= 'f')
- return c - ('a' - 10);
- if ('A' <= c && c <= 'F')
- return c - ('A' - 10);
- ao_cmd_status = ao_cmd_lex_error;
- return 0;
-}
-
static void
debug_input(void)
{
return;
ao_dbg_start_transfer(addr);
while (count--) {
- b = getnibble() << 4;
- b |= getnibble();
+ b = ao_getnibble() << 4;
+ b |= ao_getnibble();
if (ao_cmd_status != ao_cmd_success)
return;
ao_dbg_write_byte(b);
void
ao_cmd_decimal(void);
+/* Read a single hex nibble off stdin. */
+uint8_t
+ao_getnibble(void);
+
uint8_t
ao_match_word(__code char *word);
putchar(v + ('a' - 10));
}
+uint8_t
+ao_getnibble(void)
+{
+ char c;
+
+ c = getchar();
+ if ('0' <= c && c <= '9')
+ return c - '0';
+ if ('a' <= c && c <= 'f')
+ return c - ('a' - 10);
+ if ('A' <= c && c <= 'F')
+ return c - ('A' - 10);
+ ao_cmd_status = ao_cmd_lex_error;
+ return 0;
+}
+
void
ao_cmd_put16(uint16_t v)
{
static __xdata uint8_t ao_send[AO_MAX_SEND];
-static uint8_t
-getnibble(void)
-{
- char c;
-
- c = getchar();
- if ('0' <= c && c <= '9')
- return c - '0';
- if ('a' <= c && c <= 'f')
- return c - ('a' - 10);
- if ('A' <= c && c <= 'F')
- return c - ('A' - 10);
- ao_cmd_status = ao_cmd_lex_error;
- return 0;
-}
-
static void
ao_send_packet(void)
{
return;
}
for (i = 0; i < count; i++) {
- b = getnibble() << 4;
- b |= getnibble();
+ b = ao_getnibble() << 4;
+ b |= ao_getnibble();
if (ao_cmd_status != ao_cmd_success)
return;
ao_send[i] = b;