Xmega Application Note | |||||
Copyright (c) 2010, Atmel Corporation All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file main.c.
#include "config.h"
#include "usb_task.h"
#include "cdc_task.h"
#include "usb_descriptors.h"
Go to the source code of this file.
Functions | |
int | main (void) |
Main routine for initializing and running the tasks. |
int main | ( | void | ) |
Main routine for initializing and running the tasks.
The sample dual role application is based on two different tasks:
Definition at line 61 of file main.c.
References cdc_task(), cdc_task_init(), Clear_prescaler, Led_init, usb_task(), and usb_task_init().
00062 { 00063 /* Initialize the LED */ 00064 Led_init(); 00065 00066 /* Clear the prescaler on the device to enable a xxMHz clock, */ 00067 Clear_prescaler(); 00068 00069 /* Initialize all the USB related settings. */ 00070 usb_task_init(); 00071 00072 /* Initialize the CDC related settings. */ 00073 cdc_task_init(); 00074 00075 /* An eternal loop to handle the USB and CDC tasks. */ 00076 while(1){ 00077 usb_task(); 00078 cdc_task(); 00079 }; 00080 00081 00082 00083 }
Generated on Mon Jan 18 09:26:10 2010 for AVR1907 Xplain USB Gateway by ![]() |