Просмотр исходного кода

[FL-2800] Fix Mifare Classic 4K reading of the last 8 sectors (#1712)

* Fix FURI_BIT_SET

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Astra 3 лет назад
Родитель
Сommit
787df44c79
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      furi/core/core_defines.h

+ 5 - 1
furi/core/core_defines.h

@@ -85,7 +85,11 @@ extern "C" {
 #endif
 #endif
 
 
 #ifndef FURI_BIT_SET
 #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
 #endif
 
 
 #ifndef FURI_BIT_CLEAR
 #ifndef FURI_BIT_CLEAR