mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-21 16:46:30 +03:00
Provide trace_dump()
This commit is contained in:
15
src/avr.c
15
src/avr.c
@@ -1866,3 +1866,18 @@ void trace_buffer(const char *funstr, const unsigned char *buf, size_t buflen) {
|
||||
}
|
||||
msg_trace("\n");
|
||||
}
|
||||
|
||||
// Output comms buffer like memory dump
|
||||
void trace_dump(const char *funstr, const unsigned char *buf, size_t buflen) {
|
||||
pmsg_trace("%s: ", funstr);
|
||||
while(buflen) {
|
||||
char out[69];
|
||||
size_t len = buflen > 16? 16: buflen;
|
||||
|
||||
str_hexdump16(out, buf, len);
|
||||
msg_trace("%s\n", out);
|
||||
buf += len;
|
||||
if(buflen -= len)
|
||||
pmsg_trace("%*s", (int) strlen(funstr)+2, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1233,6 +1233,7 @@ extern "C" {
|
||||
int avr_unlock(const PROGRAMMER *pgm, const AVRPART *p);
|
||||
void report_progress(int completed, int total, const char *hdr);
|
||||
void trace_buffer(const char *funstr, const unsigned char *buf, size_t buflen);
|
||||
void trace_dump(const char *funstr, const unsigned char *buf, size_t buflen);
|
||||
int avr_has_paged_access(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m);
|
||||
int avr_has_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m);
|
||||
int avr_has_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m);
|
||||
|
||||
Reference in New Issue
Block a user