enum_example.c File Reference


Detailed Description

Main file of the USB enumeration example.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file enum_example.c.

#include <stdio.h>
#include "compiler.h"
#include "board.h"
#include "print_funcs.h"
#include "intc.h"
#include "power_clocks_lib.h"
#include "FreeRTOS.h"
#include "task.h"
#include "conf_usb.h"
#include "usb_task.h"
#include "device_template_task.h"
#include "host_template_task.h"

Go to the source code of this file.

Functions

int main (void)
 Main function. Execution starts here.


Function Documentation

int main ( void   ) 

Main function. Execution starts here.

Return values:
42 Fatal error.

Definition at line 157 of file enum_example.c.

References device_template_task(), device_template_task_init(), host_template_task(), host_template_task_init(), usb_task(), and usb_task_init().

00158 {
00159 #ifndef FREERTOS_USED
00160   Enable_global_exception();
00161   INTC_init_interrupts();
00162 #endif
00163   pcl_switch_to_osc(PCL_OSC0, FOSC0, OSC0_STARTUP);
00164   init_dbg_rs232(FOSC0);
00165   pcl_configure_usb_clock();
00166   usb_task_init();
00167 #if USB_DEVICE_FEATURE == ENABLED
00168   device_template_task_init();
00169 #endif
00170 #if USB_HOST_FEATURE == ENABLED
00171   host_template_task_init();
00172 #endif
00173 
00174 #ifdef FREERTOS_USED
00175   vTaskStartScheduler();
00176   portDBG_TRACE("FreeRTOS returned.");
00177   return 42;
00178 #else
00179   while (TRUE)
00180   {
00181     usb_task();
00182   #if USB_DEVICE_FEATURE == ENABLED
00183     device_template_task();
00184   #endif
00185   #if USB_HOST_FEATURE == ENABLED
00186     host_template_task();
00187   #endif
00188   }
00189 #endif  // FREERTOS_USED
00190 }


Generated on Fri Feb 19 02:27:50 2010 for AVR32 - USB Enumeration Example by  doxygen 1.5.5