00001 /*This file is prepared for Doxygen automatic documentation generation.*/ 00049 00050 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00051 * 00052 * Redistribution and use in source and binary forms, with or without 00053 * modification, are permitted provided that the following conditions are met: 00054 * 00055 * 1. Redistributions of source code must retain the above copyright notice, 00056 * this list of conditions and the following disclaimer. 00057 * 00058 * 2. Redistributions in binary form must reproduce the above copyright notice, 00059 * this list of conditions and the following disclaimer in the documentation 00060 * and/or other materials provided with the distribution. 00061 * 00062 * 3. The name of Atmel may not be used to endorse or promote products derived 00063 * from this software without specific prior written permission. 00064 * 00065 * 4. This software may only be redistributed and used in connection with an Atmel 00066 * AVR product. 00067 * 00068 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00069 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00070 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND 00071 * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 00072 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00073 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00074 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00075 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00076 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00077 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00078 */ 00079 00080 //_____ I N C L U D E S ___________________________________________________ 00081 00082 #include "config.h" 00083 #include "modules/scheduler/scheduler.h" 00084 #include "lib_mcu/wdt/wdt_drv.h" 00085 #include "lib_mcu/power/power_drv.h" 00086 #include "lib_mcu/usb/usb_drv.h" 00087 #include "lib_mcu/util/start_boot.h" 00088 00089 //_____ M A C R O S ________________________________________________________ 00090 00091 //_____ D E F I N I T I O N S ______________________________________________ 00092 00093 int main(void) 00094 { 00095 Usb_enable_regulator(); 00096 wdtdrv_disable(); 00097 start_boot_if_required(); 00098 Clear_prescaler(); 00099 scheduler(); 00100 return 0; 00101 } 00102 00106 #ifdef __GNUC__ 00107 // Locate low level init function before RAM init (init3 section) 00108 // and remove std prologue/epilogue 00109 char __low_level_init(void) __attribute__ ((section (".init3"),naked)); 00110 #endif 00111 00112 #ifdef __cplusplus 00113 extern "C" { 00114 #endif 00115 char __low_level_init() 00116 { 00117 Clear_prescaler(); 00118 return 1; 00119 } 00120 #ifdef __cplusplus 00121 } 00122 #endif
1.5.3