diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-08-21 18:42:49 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-08-21 18:42:49 +0200 |
| commit | 063ac23917f608202b337b09fe355d9223493245 (patch) | |
| tree | 8d45778269529e4d2a0bcbca8cc128c9a15cc0bd /Bitwise_operations.h | |
| parent | ff6ccb57551afe8904254313fb7ed0204fe74d19 (diff) | |
| download | Traffic-light-063ac23917f608202b337b09fe355d9223493245.tar.xz Traffic-light-063ac23917f608202b337b09fe355d9223493245.zip | |
Added intital project
Diffstat (limited to 'Bitwise_operations.h')
| -rw-r--r-- | Bitwise_operations.h | 4 |
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)
|
