1 #error This code must be revised for the new timer API
5 * This file is part of BeRTOS.
7 * Bertos is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 * As a special exception, you may use this file as part of a free software
22 * library without restriction. Specifically, if other files instantiate
23 * templates or use macros or inline functions from this file, or you compile
24 * this file and link it with other files to produce an executable, this
25 * file does not by itself cause the resulting executable to be covered by
26 * the GNU General Public License. This exception does not however
27 * invalidate any other reasons why the executable file might be covered by
28 * the GNU General Public License.
30 * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
31 * Copyright 2000 Bernie Innocenti
37 * \author Bernie Innocenti <bernie@codewiz.org>
39 * \brief Low-level timer module for AVR
44 *#* Revision 1.7 2006/07/19 12:56:26 bernie
45 *#* Convert to new Doxygen style.
47 *#* Revision 1.6 2006/02/21 21:28:02 bernie
48 *#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
50 *#* Revision 1.5 2005/11/04 16:20:02 bernie
51 *#* Fix reference to README.devlib in header.
53 *#* Revision 1.4 2004/12/13 11:51:08 bernie
54 *#* DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
56 *#* Revision 1.3 2004/08/25 14:12:08 rasky
57 *#* Aggiornato il comment block dei log RCS
59 *#* Revision 1.2 2004/06/03 11:27:09 bernie
60 *#* Add dual-license information.
62 *#* Revision 1.1 2004/05/23 18:23:30 bernie
63 *#* Import drv/timer module.
71 * Retrigger TIMER2, adjusting the time to account for
72 * the interrupt prologue latency.
74 #define TIMER_RETRIGGER (TIMER2 -= TICKS_RATE)
77 TIMER2 = (65535 - TICKS_RATE); \
78 INT_MASK1 |= INT1F_T2OVF; \
81 IOC3 |= IOC3F_T2_ENA; \
85 #define DEFINE_TIMER_ISR \
86 INTERRUPT(0x38) void TM2_OVFL_interrupt(void); \
87 INTERRUPT(0x38) void TM2_OVFL_interrupt(void)
89 #endif /* DRV_TIMER_I196_H */