mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-29 11:47:11 +02:00
libatrf: new function to reliably flush interrupts
- misctxrx.h (flush_interrupts), misctxrx.c: reliably flush interrupts on all drivers (with the exception of atnet talking to an atusb)
This commit is contained in:
parent
110ecf67a1
commit
620709a20a
@ -18,6 +18,7 @@
|
|||||||
#include "atrf.h"
|
#include "atrf.h"
|
||||||
|
|
||||||
|
|
||||||
|
void flush_interrupts(struct atrf_dsc *dsc);
|
||||||
uint8_t wait_for_interrupt(struct atrf_dsc *dsc, uint8_t wait_for,
|
uint8_t wait_for_interrupt(struct atrf_dsc *dsc, uint8_t wait_for,
|
||||||
uint8_t ignore, int sleep_us, int timeout);
|
uint8_t ignore, int sleep_us, int timeout);
|
||||||
|
|
||||||
|
@ -35,6 +35,17 @@ static void die(int sig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void flush_interrupts(struct atrf_dsc *dsc)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If the driver doesn't support atrf_interrupt_wait, we use
|
||||||
|
* atrf_reg_read.
|
||||||
|
*/
|
||||||
|
if (atrf_interrupt_wait(dsc, 1) < 0)
|
||||||
|
atrf_reg_read(dsc, REG_IRQ_STATUS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint8_t wait_for_interrupt(struct atrf_dsc *dsc, uint8_t wait_for,
|
uint8_t wait_for_interrupt(struct atrf_dsc *dsc, uint8_t wait_for,
|
||||||
uint8_t ignore, int sleep_us, int timeout)
|
uint8_t ignore, int sleep_us, int timeout)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user