Skip to content

Commit

Permalink
Now fifo size in ST25 chip is calculated properly (#3829)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <alleteam@gmail.com>
  • Loading branch information
RebornedBrain and skotopes authored Aug 9, 2024
1 parent 235cb64 commit 3672efa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/drivers/st25r3916.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ bool st25r3916_read_fifo(
do {
uint8_t fifo_status[2] = {};
st25r3916_read_burst_regs(handle, ST25R3916_REG_FIFO_STATUS1, fifo_status, 2);
size_t bytes = ((fifo_status[1] & ST25R3916_REG_FIFO_STATUS2_fifo_b_mask) >>
ST25R3916_REG_FIFO_STATUS2_fifo_b_shift) |
fifo_status[0];

uint16_t fifo_status_b9_b8 =
((fifo_status[1] & ST25R3916_REG_FIFO_STATUS2_fifo_b_mask) >>
ST25R3916_REG_FIFO_STATUS2_fifo_b_shift);
size_t bytes = (fifo_status_b9_b8 << 8) | fifo_status[0];

uint8_t bits =
((fifo_status[1] & ST25R3916_REG_FIFO_STATUS2_fifo_lb_mask) >>
ST25R3916_REG_FIFO_STATUS2_fifo_lb_shift);
Expand Down

0 comments on commit 3672efa

Please sign in to comment.