From 98a2467be3647894e348ff2f646dd34edbc04d05 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 4 Apr 2014 19:21:41 +0200 Subject: license and fixes --- Makefile | 8 ++++++-- main.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5f0a6db..40f457a 100644 --- a/Makefile +++ b/Makefile @@ -368,7 +368,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # Default target. all: begin directories gccversion sizebefore build sizeafter end -directories: .dep obj +directories: .dep obj obj/usbdrv .dep: mkdir .dep @@ -376,6 +376,9 @@ directories: .dep obj obj: mkdir obj +obj/usbdrv: obj + mkdir obj/usbdrv + # Change the build target to build a HEX file or a library. build: elf hex eep lss sym #build: lib @@ -426,6 +429,7 @@ gccversion : # Program the device. +flash: program program: $(TARGET).hex $(TARGET).eep $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) @@ -594,4 +598,4 @@ clean_list : # Listing of phony targets. .PHONY : all begin finish end sizebefore sizeafter gccversion \ build elf hex eep lss sym coff extcoff \ -clean clean_list program debug gdb-config +clean clean_list flash program debug gdb-config diff --git a/main.c b/main.c index 9f287a5..f47d043 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,34 @@ +// USB HID test +// Copyright (C) 2014 Florian Jung +// +// 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 . + + + +/* Setup: + + lfuse: 0xe0 + hfuse: 0xd9 + + attach a 12MHz quartz to the atmega8, using the appropriate XTAL pins. + + connect avr.PD{2,3} over 68 Ohm to usb.DATA{+,-} + connect usb.DATA{+,-} over 3v6-Z-Diode ( ----|<---- ) to GND + connect usb.DATA- over 1.5kOhm to usb.Vcc + connect usb.GND to avr.GND. +*/ + #define F_CPU 12000000L #include -- cgit v1.2.3