From 042ba3534e9c12c4f5f5b22647c117ccaa7c2ad7 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 30 May 2012 12:27:56 +0000 Subject: cleanup git-svn-id: https://svn.spreadspace.org/avr/trunk@48 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- README | 40 +++++++++++++++++++++++++++++++ usb-led/usb-led.c | 71 +++++++++++++++++++++++-------------------------------- 2 files changed, 70 insertions(+), 41 deletions(-) diff --git a/README b/README index fb0f678..7351be0 100644 --- a/README +++ b/README @@ -54,3 +54,43 @@ build and flash blink example # make # make program # make run + + +License +======= + +The spreadspace AVR utils are licensed under GPLv3. You can find the +full text of the license in the file LICENSE. + +Some examples are based on LUFA which has been licensed under the +following conditions. + +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + 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. +*/ diff --git a/usb-led/usb-led.c b/usb-led/usb-led.c index b58a180..d7cbce5 100644 --- a/usb-led/usb-led.c +++ b/usb-led/usb-led.c @@ -21,17 +21,6 @@ */ -/* this is based on the LUFA example Project USBtoSerial - this is their Copyright Header */ - -/* - LUFA Library - Copyright (C) Dean Camera, 2012. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - #include #include #include @@ -42,17 +31,17 @@ #include "util.h" #include "led.h" -#include +/* some parts of this examaple are based on LUFA */ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. - /* Function Prototypes: */ -void handle_cmd(uint8_t cmd); -void EVENT_USB_Device_ConfigurationChanged(void); -void EVENT_USB_Device_ControlRequest(void); + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +#include -/** LUFA CDC Class driver interface configuration and state information. This structure is - * passed to all CDC Class driver functions, so that multiple instances of the same class - * within a device can be differentiated from one another. - */ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = { .Config = @@ -73,6 +62,27 @@ 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); +} + + +void handle_cmd(uint8_t cmd) +{ + switch(cmd) { + case '0': led_off(); break; + case '1': led_on(); break; + case 't': led_toggle(); break; + default: CDC_Device_SendString(&VirtualSerial_CDC_Interface, "error\n"); return; + } + CDC_Device_SendString(&VirtualSerial_CDC_Interface, "ok\n"); +} int main(void) { @@ -98,24 +108,3 @@ int main(void) USB_USBTask(); } } - -void handle_cmd(uint8_t cmd) -{ - switch(cmd) { - case '0': led_off(); break; - case '1': led_on(); break; - case 't': led_toggle(); break; - default: CDC_Device_SendString(&VirtualSerial_CDC_Interface, "error\n"); return; - } - CDC_Device_SendString(&VirtualSerial_CDC_Interface, "ok\n"); -} - -void EVENT_USB_Device_ConfigurationChanged(void) -{ - CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); -} - -void EVENT_USB_Device_ControlRequest(void) -{ - CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface); -} -- cgit v1.2.3