[MOD] Fixed signed/unsigned comparison warning
This commit is contained in:
parent
a1aa52cbea
commit
2980d8dbf1
1 changed files with 5 additions and 5 deletions
|
@ -489,29 +489,29 @@ uint16_t Module::flipBits16(uint16_t i) {
|
||||||
|
|
||||||
void Module::hexdump(uint8_t* data, size_t len) {
|
void Module::hexdump(uint8_t* data, size_t len) {
|
||||||
size_t rem_len = len;
|
size_t rem_len = len;
|
||||||
for(int i = 0; i < len; i+=16) {
|
for(size_t i = 0; i < len; i+=16) {
|
||||||
char str[80];
|
char str[80];
|
||||||
sprintf(str, "%07x ", i);
|
sprintf(str, "%07x ", i);
|
||||||
size_t line_len = 16;
|
size_t line_len = 16;
|
||||||
if(rem_len < line_len) {
|
if(rem_len < line_len) {
|
||||||
line_len = rem_len;
|
line_len = rem_len;
|
||||||
}
|
}
|
||||||
for(int j = 0; j < line_len; j++) {
|
for(size_t j = 0; j < line_len; j++) {
|
||||||
sprintf(&str[8 + j*3], "%02x ", data[i+j]);
|
sprintf(&str[8 + j*3], "%02x ", data[i+j]);
|
||||||
}
|
}
|
||||||
for(int j = line_len; j < 16; j++) {
|
for(size_t j = line_len; j < 16; j++) {
|
||||||
sprintf(&str[8 + j*3], " ");
|
sprintf(&str[8 + j*3], " ");
|
||||||
}
|
}
|
||||||
str[56] = '|';
|
str[56] = '|';
|
||||||
str[57] = ' ';
|
str[57] = ' ';
|
||||||
for(int j = 0; j < line_len; j++) {
|
for(size_t j = 0; j < line_len; j++) {
|
||||||
char c = data[i+j];
|
char c = data[i+j];
|
||||||
if((c < ' ') || (c > '~')) {
|
if((c < ' ') || (c > '~')) {
|
||||||
c = '.';
|
c = '.';
|
||||||
}
|
}
|
||||||
sprintf(&str[58 + j], "%c", c);
|
sprintf(&str[58 + j], "%c", c);
|
||||||
}
|
}
|
||||||
for(int j = line_len; j < 16; j++) {
|
for(size_t j = line_len; j < 16; j++) {
|
||||||
sprintf(&str[58 + j], " ");
|
sprintf(&str[58 + j], " ");
|
||||||
}
|
}
|
||||||
RADIOLIB_DEBUG_PRINTLN(str);
|
RADIOLIB_DEBUG_PRINTLN(str);
|
||||||
|
|
Loading…
Add table
Reference in a new issue