static void
cc_usb_dbg(int indent, uint8_t *bytes, int len)
{
- int eol = 1;
+ static int eol = 1;
int i;
uint8_t c;
+ ccdbg_debug(CC_DEBUG_BITBANG, "<<<%d bytes>>>", len);
while (len--) {
c = *bytes++;
if (eol) {
}
switch (c) {
case '\r':
- ccdbg_debug(CC_DEBUG_BITBANG, "^M");
+ ccdbg_debug(CC_DEBUG_BITBANG, "\\r");
break;
case '\n':
eol = 1;
+ ccdbg_debug(CC_DEBUG_BITBANG, "\\n\n");
+ break;
default:
- ccdbg_debug(CC_DEBUG_BITBANG, "%c", c);
+ if (c < ' ' || c > '~')
+ ccdbg_debug(CC_DEBUG_BITBANG, "\\%02x", c);
+ else
+ ccdbg_debug(CC_DEBUG_BITBANG, "%c", c);
}
}
}