2 * Copyright (C) 2010 Ubixum, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <fx2macros.h>
29 void timer0_isr() interrupt TF0_ISR {
31 if (d2) { d2on(); } else { d2off(); }
34 void timer1_isr() interrupt TF1_ISR {
36 if (d3) { d3on(); } else { d3off(); }
39 void timer2_isr() interrupt TF2_ISR {
41 if (d4) { d4on(); } else { d4off(); }
43 CLEAR_TIMER2(); // This one is not done automatically!
53 // enable timer 0 and timer 1 to be 16 bit counters
56 // enable timer 2 to also be a 16 bit counter
58 RCAP2L = 0; // reload values for t2
61 EA=1; // enable interrupts
74 if (d5) { d5off(); } else { d5on(); }