mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03: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:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user