Tool to dump contents of a data buffer in traditional terminal format. Some VT100 color commands used.
Diff: PrintBuffer.h
- Revision:
- 2:e7f3ba216a14
- Parent:
- 0:94d1683e78b7
- Child:
- 4:c3c8b072f80f
--- a/PrintBuffer.h Tue May 13 18:47:41 2014 +0000 +++ b/PrintBuffer.h Thu Jan 29 19:18:27 2015 +0000 @@ -5,16 +5,20 @@ /** Print Buffer Routine. Displays X number of lines in a buffer. * each line broken int 2 groups of HEX characters followed by 2 groups of ASCII characters. - * Illegal ascii characters are represented as a dot "." + * Illegal ascii characters are represented as a cyan colored dot "." * * example; dump myBuffer, 4 lines starting at line 18 * - * dump(4, 0x120, myBuffer); + * dump("This is myBuffer:", 4, 0x120, myBuffer); //Note: this line will be colored magenta below + * + * This is myBuffer: - lines: 4 starting at: 0x0120 * - * lines: 4 starting at: 0x0120 contents: * 0120 00 04 09 29 00 00 00 00 00 00 00 00 00 00 00 00 ...).... ........ + * * 0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4c 00 ........ ......L. + * * 0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ + * * 0150 00 00 00 00 00 00 00 00 00 00 00 00 65 6e 64 00 ........ ....end. * * @code @@ -72,6 +76,11 @@ * @param three, (int # of lines to print), (int starting address), (c u8_t name of buffer to print) */ int dump_t(const char* title, int BufferLines, int BufferOffset, const uint8_t buffer[]); + /** Print out hex / ascii data using pc.printf using format above + * + * @param three, (int # of lines to print), (int starting address), (c unsigned char name of buffer to print) + */ + int dump_uc(const char* title, int BufferLines, int BufferOffset, const unsigned char buffer[]); private: