diff options
| author | Keith Packard <keithp@keithp.com> | 2012-11-30 15:04:21 -0800 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-11-30 15:04:21 -0800 |
| commit | 81648829defbaf49fc98c4520540f7a20c50c417 (patch) | |
| tree | c79636a61586d93f5baaf0d4985acf77612bc329 /src/cc1111/ao_dbg.c | |
| parent | 289ead258e217bc10493caab12a8b477f1bc2865 (diff) | |
altos: Share getnibble function
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>
Diffstat (limited to 'src/cc1111/ao_dbg.c')
| -rw-r--r-- | src/cc1111/ao_dbg.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/cc1111/ao_dbg.c b/src/cc1111/ao_dbg.c index 847b5aaf..214cb013 100644 --- a/src/cc1111/ao_dbg.c +++ b/src/cc1111/ao_dbg.c @@ -281,22 +281,6 @@ debug_get(void) 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) { @@ -338,8 +322,8 @@ debug_output(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); |
