X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fproduct%2Fao_test.c;h=5db362937717d43427a78a35577574a5cdf815a4;hp=14c2eb75c41e2656996673a0cb29d4d4d4973c0f;hb=c6e57291d91f1f6c4de5c54a5cfd3eef66d9f830;hpb=9513be7f9d3d0b0ec29f6487fa9dc8f1ac24d0de diff --git a/src/product/ao_test.c b/src/product/ao_test.c index 14c2eb75..5db36293 100644 --- a/src/product/ao_test.c +++ b/src/product/ao_test.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,13 +18,13 @@ #include "ao.h" -struct ao_task __xdata blink_0_task; -struct ao_task __xdata blink_1_task; -struct ao_task __xdata wakeup_task; -struct ao_task __xdata beep_task; -struct ao_task __xdata echo_task; +struct ao_task blink_0_task; +struct ao_task blink_1_task; +struct ao_task wakeup_task; +struct ao_task beep_task; +struct ao_task echo_task; -void delay(int n) __reentrant +void delay(int n) { uint8_t j = 0; while (--n) @@ -31,7 +32,7 @@ void delay(int n) __reentrant ao_yield(); } -static __xdata uint8_t blink_chan; +static uint8_t blink_chan; void blink_0(void) @@ -50,7 +51,7 @@ blink_0(void) void blink_1(void) { - static __xdata struct ao_adc adc; + static struct ao_adc adc; for (;;) { ao_sleep(&ao_adc_head); @@ -74,7 +75,7 @@ wakeup(void) void beep(void) { - static __xdata struct ao_adc adc; + static struct ao_adc adc; for (;;) { ao_delay(AO_SEC_TO_TICKS(1)); @@ -102,6 +103,8 @@ main(void) { ao_clock_init(); + ao_task_init(); + // ao_add_task(&blink_0_task, blink_0); // ao_add_task(&blink_1_task, blink_1); // ao_add_task(&wakeup_task, wakeup);