diff options
author | Keith Packard <keithp@keithp.com> | 2013-03-24 15:00:20 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-03-31 12:24:24 -0700 |
commit | 4f1f3e836393304434130d362771a39f6f8f859a (patch) | |
tree | 5655f7ae7aa252a96aa585e3aee47b1b57a8fc9a /src/drivers/ao_packet_master.c | |
parent | 7afcec1a1dce140dfa569469df4ef42ed407a742 (diff) |
altos: Do not release interrupts from any pollchar function
getchar relies on interrupts being blocked across the pollchar calls
and into the sleep call or it may go to sleep with data pending.
This prefixes all pollchar functions with _ to indicate that they are
to be called with interrupts blocked and eliminates all interrupt
manipulation calls from within the pollchar functions.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_packet_master.c')
-rw-r--r-- | src/drivers/ao_packet_master.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/ao_packet_master.c b/src/drivers/ao_packet_master.c index 023c788b..4c0dc573 100644 --- a/src/drivers/ao_packet_master.c +++ b/src/drivers/ao_packet_master.c @@ -21,7 +21,12 @@ static char ao_packet_getchar(void) { int c; - while ((c = ao_packet_pollchar()) == AO_READ_AGAIN) { + + /* No need to block interrupts in this function as + * all packet variables are only modified from task + * context, not an interrupt handler + */ + while ((c = _ao_packet_pollchar()) == AO_READ_AGAIN) { if (!ao_packet_enable) break; if (ao_packet_master_sleeping) |