2 * Copyright © 2012 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.
21 static uint8_t sensor_value;
22 static uint8_t vidtime_monitor;
29 ao_exti_enable(AO_SENSOR_PORT, AO_SENSOR_PIN);
31 while (!vidtime_monitor)
32 ao_sleep(&vidtime_monitor);
33 while ((got = sensor_value) == old)
34 ao_sleep(&sensor_value);
42 sensor_interrupt(void)
44 sensor_value = ao_gpio_get(AO_SENSOR_PORT, AO_SENSOR_PIN, foo);
45 ao_wakeup(&sensor_value);
48 static struct ao_task vidtime_task;
53 ao_enable_port(AO_SENSOR_PORT);
54 ao_exti_setup(AO_SENSOR_PORT, AO_SENSOR_PIN,
57 AO_EXTI_MODE_PULL_NONE|
60 ao_add_task(&vidtime_task, vidtime, "vidtime");
66 uint16_t r = ao_cmd_decimal();
67 if (ao_cmd_status == ao_cmd_success) {
68 vidtime_monitor = r != 0;
69 ao_wakeup(&vidtime_monitor);
73 const struct ao_cmds ao_vidtime_cmds[] = {
74 { ao_set_vidtime, "V <0 off, 1 on>\0Enable/disable timing monitor" },
94 ao_cmd_register(&ao_vidtime_cmds[0]);