From f42a29b8881b649ebe585c81f1fa492df98db3ba Mon Sep 17 00:00:00 2001 From: Raphael Assenat Date: Tue, 10 Apr 2018 15:07:35 -0400 Subject: [PATCH] Add a second interval timer --- Makefile.inc | 2 +- intervaltimer2.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ intervaltimer2.h | 9 +++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 intervaltimer2.c create mode 100644 intervaltimer2.h diff --git a/Makefile.inc b/Makefile.inc index 85ed462..832e0ee 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,4 +1,4 @@ -OBJS=main.o usb.o usbpad.o mappings.o gcn64_protocol.o n64.o gamecube.o usart1.o bootloader.o eeprom.o config.o hiddata.o usbstrings.o intervaltimer.o version.o gcn64txrx0.o gcn64txrx1.o gcn64txrx2.o gcn64txrx3.o gamepads.o stkchk.o +OBJS=main.o usb.o usbpad.o mappings.o gcn64_protocol.o n64.o gamecube.o usart1.o bootloader.o eeprom.o config.o hiddata.o usbstrings.o intervaltimer.o intervaltimer2.o version.o gcn64txrx0.o gcn64txrx1.o gcn64txrx2.o gcn64txrx3.o gamepads.o stkchk.o VERSIONSTR=\"3.5.0\" VERSIONSTR_SHORT=\"3.5\" VERSIONBCD=0x0350 diff --git a/intervaltimer2.c b/intervaltimer2.c new file mode 100644 index 0000000..c7e9283 --- /dev/null +++ b/intervaltimer2.c @@ -0,0 +1,45 @@ +/* gc_n64_usb : Gamecube or N64 controller to USB firmware + Copyright (C) 2007-2016 Raphael Assenat + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +#include +#include "intervaltimer2.h" + +void intervaltimer2_init(void) +{ + TCCR0A = (1<