We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88a2b7a commit 23f88eaCopy full SHA for 23f88ea
cores/nRF5/debug.cpp
@@ -177,15 +177,16 @@ void dbgPrintVersion(void)
177
void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffset)
178
{
179
uint8_t const *buf8 = (uint8_t const *) buf;
180
+
181
+ uint8_t format_size = 2 * size;
182
+ if ( count*size > UINT8_MAX ) format_size *= 2;
183
+ if ( count*size > UINT16_MAX ) format_size *= 2;
184
185
char format[] = "%00lX";
- format[2] += 2*size;
186
+ format[2] += format_size;
187
188
char offset_fmt[] = "%02lX: ";
189
- if ( count*size > UINT8_MAX ) format[2] *= 2;
- if ( count*size > UINT16_MAX ) format[2] *= 2;
-
190
const uint8_t item_per_line = 16 / size;
191
192
for(int i=0; i<count; i++)
0 commit comments