From d583d39b48120fa907a53dbaddc53709a4bdef12 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 31 May 2012 01:32:59 +0000 Subject: cleanup git-svn-id: https://svn.spreadspace.org/avr/trunk@53 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- usb-spi/usb-spi.c | 83 +++++++++++++++++-------------------------------------- 1 file changed, 25 insertions(+), 58 deletions(-) (limited to 'usb-spi/usb-spi.c') diff --git a/usb-spi/usb-spi.c b/usb-spi/usb-spi.c index 1dc438c..803214c 100644 --- a/usb-spi/usb-spi.c +++ b/usb-spi/usb-spi.c @@ -20,9 +20,13 @@ * along with spreadspace avr utils. If not, see . */ +#include +#include +#include +#include -/* this is based on the LUFA example Project USBtoSerial - this is their LICENSE Header */ +#include "util.h" +#include "led.h" /* LUFA Library @@ -31,55 +35,11 @@ dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ - -/* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Main source file for the USBtoSerial project. This file contains the main tasks of - * the project and is responsible for the initial application hardware configuration. - */ - - -#include -#include -#include -#include - -#include "lufa-descriptor-usbserial.h" - -#include "util.h" -#include "led.h" - #include #include #include #include - - /* Hardware Defines: */ -#define SPI_CS_DDR DDRB -#define SPI_CS_PORT PORTB -#define CS 0 +#include "lufa-descriptor-usbserial.h" /* Global I/O Buffers: */ static RingBuffer_t USBtoSPI_Buffer; @@ -111,6 +71,23 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = }, }; +void EVENT_USB_Device_ConfigurationChanged(void) +{ + CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); +} + +void EVENT_USB_Device_ControlRequest(void) +{ + CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface); +} +/* end LUFA CDC-ACM specific definitions*/ + + + /* Hardware Defines: */ +#define SPI_CS_DDR DDRB +#define SPI_CS_PORT PORTB +#define CS 0 + void SetupHardware(void) { MCUSR &= ~(1 << WDRF); @@ -128,7 +105,7 @@ void SetupHardware(void) SPI_CS_PORT |= (1<