X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcore%2Fao_stdio.c;h=18fa913e5a57126f55524ca87f541e3877e3985a;hb=0667261e03b3fd403e97d02ea6204b007bb13f58;hp=c0138a30dbd730bc26bcea06b38fe872ce8650e2;hpb=128bbfa150f88c09f7adde2434b7bf0b5a9ed556;p=fw%2Faltos diff --git a/src/core/ao_stdio.c b/src/core/ao_stdio.c index c0138a30..18fa913e 100644 --- a/src/core/ao_stdio.c +++ b/src/core/ao_stdio.c @@ -21,6 +21,12 @@ * Basic I/O functions to support SDCC stdio package */ +#ifdef SERIAL_STDIN_PORT +#define USE_SERIAL_STDIN 1 +#else +#define USE_SERIAL_STDIN 0 +#endif + #define AO_NUM_STDIOS (HAS_USB + PACKET_HAS_SLAVE + USE_SERIAL_STDIN) __xdata struct ao_stdio ao_stdios[AO_NUM_STDIOS]; @@ -30,6 +36,15 @@ __pdata int8_t ao_num_stdios; void putchar(char c) { +#if LOW_LEVEL_DEBUG + if (!ao_cur_task) { + extern void ao_debug_out(char c); + if (c == '\n') + ao_debug_out('\r'); + ao_debug_out(c); + return; + } +#endif if (c == '\n') (*ao_stdios[ao_cur_stdio].putchar)('\r'); (*ao_stdios[ao_cur_stdio].putchar)(c);