From 787df44c7992d8718fe634f13f4b64118486e89c Mon Sep 17 00:00:00 2001 From: Astra <93453568+Astrrra@users.noreply.github.com> Date: Mon, 19 Sep 2022 15:30:18 +0300 Subject: [PATCH] [FL-2800] Fix Mifare Classic 4K reading of the last 8 sectors (#1712) * Fix FURI_BIT_SET Co-authored-by: gornekich Co-authored-by: SG --- furi/core/core_defines.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/furi/core/core_defines.h b/furi/core/core_defines.h index 801810f6..487fe2ca 100644 --- a/furi/core/core_defines.h +++ b/furi/core/core_defines.h @@ -85,7 +85,11 @@ extern "C" { #endif #ifndef FURI_BIT_SET -#define FURI_BIT_SET(x, n) ((x) |= (1 << (n))) +#define FURI_BIT_SET(x, n) \ + ({ \ + __typeof__(x) _x = (1); \ + (x) |= (_x << (n)); \ + }) #endif #ifndef FURI_BIT_CLEAR