Skip to content

Commit 4d3956f

Browse files
Andrew55529nordicjm
authored andcommitted
lib: st25r3911b: Correct irq_clear to prevent spurious IRQs
Calling k_sem_take(sem, K_NO_WAIT) in st25r39_irq_clear() ensures that no IRQ handling occurs before the semaphore is properly initialized, effectively ignoring spurious or stale interrupts at startup. Signed-off-by: Andrei Lashkov <[email protected]>
1 parent 371187d commit 4d3956f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/st25r3911b/st25r3911b_interrupt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ int st25r39_irq_clear(void)
161161
{
162162
uint8_t val[IRQ_REG_CNT] = {0};
163163

164+
k_sem_take(sem, K_NO_WAIT);
165+
164166
return st25r3911b_multiple_reg_read(ST25R3911B_REG_MAIN_INT,
165167
val, ARRAY_SIZE(val));
166168
}

0 commit comments

Comments
 (0)