2 * Copyright (C) 2009 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
22 #include <fx2macros.h>
30 volatile BOOL on=FALSE;
33 void timer1_isr() interrupt 3 __critical {
35 if (ctr == 0) { // timer overflowed ctr_repeat times
44 ctr = ctr >= ctr_repeat ? 0 : ctr + 1;
55 // if this image is loaded to as iic to
57 // the C2 bit will turn this on
58 // turn it back off so the device can
59 // handle usb requests
62 EA=1; // enable interrupts
68 TL1=TH1=0; // start at 0
69 ET1=1; // timer 1 interrupts
70 TR1=1; // start timer 1