MAX32625PICO LP0 mode
Dependencies: SX1276GenericLib USBDevice
Fork of PICO_LP0 by
utils.cpp
- Committer:
- walterluu
- Date:
- 2020-10-16
- Revision:
- 7:c92ed2d6e344
- Parent:
- 3:85fc843a9d7d
File content as of revision 7:c92ed2d6e344:
void dump(const char *title, const void *data, int len, bool dwords) { // dprintf("dump(\"%s\", 0x%x, %d bytes)", title, data, len); // pc.printf("dump(\"%s\", 0x%x, %d bytes)", title, data, len); int i, j, cnt; unsigned char *u; const int width = 16; const int seppos = 7; cnt = 0; u = (unsigned char *)data; while (len > 0) { // rprintf("%08x: ", (unsigned int)data + cnt); // pc.printf("%08x: ", (unsigned int)data + cnt); //comment out if (dwords) { unsigned int *ip = ( unsigned int *)u; // rprintf(" 0x%08x\r\n", *ip); // pc.printf(" 0x%08x\r\n", *ip); //comment out u+= 4; len -= 4; cnt += 4; continue; } cnt += width; j = len < width ? len : width; for (i = 0; i < j; i++) { // rprintf("%2.2x ", *(u + i)); // pc.printf("%2.2x ", *(u + i)); //comment out // if (i == seppos) // rprintf(" "); // pc.printf(" "); //comment out } // rprintf(" "); // pc.printf(" "); //comment out if (j < width) { i = width - j; // if (i > seppos + 1) // rprintf(" "); // pc.printf(" "); //comment out while (i--) { // rprintf("%s", " "); // pc.printf("%s", " "); //comment out } } for (i = 0; i < j; i++) { int c = *(u + i); // if (c >= ' ' && c <= '~') // rprintf("%c", c); // pc.printf("%c", c); //comment out // else // rprintf("."); // pc.printf("."); //comment out // if (i == seppos) // rprintf(" "); // pc.printf(" "); //comment out } len -= width; u += width; // rprintf("\r\n"); // pc.printf("\r\n"); //comment out } // rprintf("--\r\n"); // pc.printf("--\r\n"); //comment out }