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