From b4e13474df0032b49658b5c709863c9a9126f282 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Mar 2023 03:27:29 +0100 Subject: [PATCH] fix: hex2char() returning wrong char for 0xa..0xf (#3302) --- radio/src/strhelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/strhelpers.cpp b/radio/src/strhelpers.cpp index 886ec0be6..4da0305e1 100644 --- a/radio/src/strhelpers.cpp +++ b/radio/src/strhelpers.cpp @@ -29,7 +29,7 @@ const char s_charTab[] = "_-.,"; char hex2zchar(uint8_t hex) { return (hex >= 10 ? hex - 9 : 27 + hex); } -char hex2char(uint8_t hex) { return (hex >= 10 ? hex - 9 + 'A' : hex + '0'); } +char hex2char(uint8_t hex) { return (hex >= 10 ? hex - 10 + 'A' : hex + '0'); } char zchar2char(int8_t idx) {