add printBufferReverse
This commit is contained in:
1 parent
182d59c683
commit
ea73d76513
6 files changed
+27
-13
No files matched your search
@@ -299,4 +299,16 @@ size_t Print::printBuffer(uint8_t const buffer[], int len, char delim)
|
||||
return (len*3 - 1);
|
||||
}
|
||||
|
||||
size_t Print::printBufferReverse(uint8_t const buffer[], int len, char delim)
|
||||
{
|
||||
if (buffer == NULL || len == 0) return 0;
|
||||
|
||||
for(int i=0; i<len; i++)
|
||||
{
|
||||
if (i != 0) print(delim);
|
||||
printf("%02X", buffer[len-1-i]);
|
||||
}
|
||||
|
||||
return (len*3 - 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user