Skip to content

Commit

Permalink
fix bit_array
Browse files Browse the repository at this point in the history
  • Loading branch information
merlokk committed Jul 24, 2024
1 parent a2c9077 commit 93bdccf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firmware/application/src/rfid/reader/lf/utils/bitarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bool bitarray_set_bit(BitArray* b, uint8_t bit_num, bool bit) {
if (b == NULL || b->count < bit_num + 1)
return false;

uint8_t t = (b->value | (1 << bit_num))
uint8_t t = (b->value | (1 << bit_num));
if (!bit)
t = t ^ (1 << bit_num);

Expand All @@ -28,12 +28,12 @@ bool bitarray_add_bit(BitArray* b, bool bit) {
if (b == NULL || b->count == 4)
return false;

uint8_t t = b->value << 1 | bit
uint8_t t = b->value << 1 | bit;
b->value = t;
b->count++
b->count++;
return true;
}

uint8_t bitarray_count(BitArray b) {
return b->count;
return b.count;
}

0 comments on commit 93bdccf

Please sign in to comment.