summaryrefslogtreecommitdiff
path: root/Bitwise_operations.h
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-08-21 18:42:49 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-08-21 18:42:49 +0200
commit063ac23917f608202b337b09fe355d9223493245 (patch)
tree8d45778269529e4d2a0bcbca8cc128c9a15cc0bd /Bitwise_operations.h
parentff6ccb57551afe8904254313fb7ed0204fe74d19 (diff)
downloadTraffic-light-063ac23917f608202b337b09fe355d9223493245.tar.xz
Traffic-light-063ac23917f608202b337b09fe355d9223493245.zip
Added intital project
Diffstat (limited to 'Bitwise_operations.h')
-rw-r--r--Bitwise_operations.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Bitwise_operations.h b/Bitwise_operations.h
new file mode 100644
index 0000000..312b2af
--- /dev/null
+++ b/Bitwise_operations.h
@@ -0,0 +1,4 @@
+#define SET(bit, nbit) ((*bit) |= (1 << (nbit)))
+#define RESET(bit, nbit) ((*bit) &= ~(1 << (nbit)))
+#define TOGGLE(bit, nbit) ((*bit) ^= (1 << (nbit)))
+#define GET_BIT(bit, nbit) ((*bit >> (nbit)) & 1)