2 * Copyright © 2011 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 uint8_t ao_btm_enable;
21 extern volatile __xdata struct ao_fifo ao_usart1_rx_fifo;
27 while (ao_btm_enable) {
28 c = ao_serial_pollchar();
29 if (c != AO_READ_AGAIN)
33 ao_sleep(&ao_usart1_rx_fifo);
39 __xdata struct ao_task ao_btm_task;
47 ao_add_task(&ao_btm_task, ao_btm, "btm");
49 while ((c = ao_usb_getchar()) != '~') {
50 if (c == '\n') c = '\r';
54 while (ao_btm_task.wchan) {
55 ao_wakeup(&ao_usart1_rx_fifo);
56 ao_delay(AO_MS_TO_TICKS(10));
60 __code struct ao_cmds ao_btm_cmds[] = {
61 { ao_btm_forward, "B <data>\0BTM serial link." },
70 ao_serial_set_speed(AO_SERIAL_SPEED_19200);
71 ao_cmd_register(&ao_btm_cmds[0]);