altos: Split up flight code into separate flight/sample/kalman bits
[fw/altos] / src / ao_stdio.c
index 045dff09f340e92b7b32b62ba2ceb914cfc2724f..6e1f5effde50409d1f89967381a9d5054ce8a05a 100644 (file)
@@ -45,12 +45,11 @@ flush(void)
 __xdata uint8_t ao_stdin_ready;
 
 char
-getchar(void) __reentrant
+getchar(void) __reentrant __critical
 {
        char c;
        int8_t stdio = ao_cur_stdio;
 
-       EA = 0;
        for (;;) {
                c = stdios[stdio].pollchar();
                if (c != AO_READ_AGAIN)
@@ -60,7 +59,6 @@ getchar(void) __reentrant
                if (stdio == ao_cur_stdio)
                        ao_sleep(&ao_stdin_ready);
        }
-       EA = 1;
        ao_cur_stdio = stdio;
        return c;
 }
@@ -68,7 +66,7 @@ getchar(void) __reentrant
 void
 ao_add_stdio(char (*pollchar)(void),
             void (*putchar)(char),
-            void (*flush)(void))
+            void (*flush)(void)) __reentrant
 {
        if (ao_num_stdios == AO_NUM_STDIOS)
                ao_panic(AO_PANIC_STDIO);