2 * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: main.c,v 1.1.2.4 2007-05-23 17:18:15 zer0 Exp $
24 #include <aversive/wait.h>
29 void callback_ov(void)
32 printf("CB%d\n", i++);
35 void callback_oc(void)
40 if ( (i%1000) == 0 ) {
41 printf("%d\n", i/1000);
43 timer3A_register_OC_intr_in_us(NULL, 0);
48 timer3A_register_OC_intr_in_us(callback_oc, 1000);
52 * timer 8bits are differents...
53 * timer1A_register_OC_intr_in_tics
54 * functions with timer num as a parameter
55 * return an error in timer1A_register_OC_intr_in_us if not adapted to presc
56 * synch des timers (eventuellement)
57 * clear on compare match could be useful
58 * enhance help for funcs. Note that register_in_us is 100us long on a 16Mhz ATmega128 in dynamic mode
60 * aversive/parts.h can be included twice... bad
61 * aversive/ATxxx.h can be included directly... bad too
69 fdevopen(uart0_dev_send, uart0_dev_recv);
76 timer3A_register_OC_intr_in_us(callback_oc, 1000);
79 printf("%d %d %d %d\n", a, b, c, OCR3A);
81 timer1_register_OV_intr(callback_ov);
82 printf("timer = %d\n", timer1_get());
84 printf("timer = %d\n", timer1_get());
86 printf("timer = %d\n", timer1_get());