altos: Replace __critical usage with ao_arch_critical as needed
authorKeith Packard <keithp@keithp.com>
Thu, 25 Oct 2012 05:35:32 +0000 (22:35 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 25 Oct 2012 07:07:14 +0000 (00:07 -0700)
commite80fa6de4ccc5c4851eab9fb941f9282d2e3eb16
tree716c76a2a0aae0ade116f1c9d959d68fedeb112a
parentb119e19604aa557a40e848c60d98a67b5f259bbd
altos: Replace __critical usage with ao_arch_critical as needed

sdcc offers __critical as a machine-independent way to block
interrupts, but as gcc doesn't, we need to use a compiler-independent
construct instead. ao_arch_critical has been around since the AVR
port, but some old __critical usages remained.

This fixes a bunch of random hangs when communicating with MM over USB
or the radio as the various stdio loops were running without
interrupts blocked between the test and the sleep.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 files changed:
src/core/ao.h
src/core/ao_ignite.c
src/core/ao_mutex.c
src/core/ao_packet.h
src/core/ao_panic.c
src/core/ao_stdio.c
src/drivers/ao_btm.c
src/drivers/ao_packet.c
src/drivers/ao_packet_master.c
src/stm/ao_arch.h
src/stm/ao_timer.c
src/stm/ao_usb_stm.c