From 91d2324cfb5b2e83c408d094fba3216f9b218a5c Mon Sep 17 00:00:00 2001 From: stefanbode Date: Thu, 20 Aug 2020 16:22:40 +0200 Subject: [PATCH] Update support.ino --- tasmota/support.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index e744e1685..ae662ad66 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -117,6 +117,17 @@ String GetResetReason(void) * Miscellaneous \*********************************************************************************************/ +#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" +#define BYTE_TO_BINARY(byte) \ + (byte & 0x80 ? '1' : '0'), \ + (byte & 0x40 ? '1' : '0'), \ + (byte & 0x20 ? '1' : '0'), \ + (byte & 0x10 ? '1' : '0'), \ + (byte & 0x08 ? '1' : '0'), \ + (byte & 0x04 ? '1' : '0'), \ + (byte & 0x02 ? '1' : '0'), \ + (byte & 0x01 ? '1' : '0') + // Get span until single character in string size_t strchrspn(const char *str1, int character) { @@ -1961,4 +1972,4 @@ String Decompress(const char * compressed, size_t uncompressed_size) { return content; } -#endif // USE_UNISHOX_COMPRESSION \ No newline at end of file +#endif // USE_UNISHOX_COMPRESSION