main.c

Go to the documentation of this file.
00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
00087 
00088 /* Copyright (c) 2007, Atmel Corporation All rights reserved.
00089  *
00090  * Redistribution and use in source and binary forms, with or without
00091  * modification, are permitted provided that the following conditions are met:
00092  *
00093  * 1. Redistributions of source code must retain the above copyright notice,
00094  * this list of conditions and the following disclaimer.
00095  *
00096  * 2. Redistributions in binary form must reproduce the above copyright notice,
00097  * this list of conditions and the following disclaimer in the documentation
00098  * and/or other materials provided with the distribution.
00099  *
00100  * 3. The name of ATMEL may not be used to endorse or promote products derived
00101  * from this software without specific prior written permission.
00102  *
00103  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
00104  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00105  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
00106  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
00107  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00108  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00109  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00110  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00111  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00112  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00113  */
00114 
00115 //_____  I N C L U D E S ___________________________________________________
00116 
00117 #include "config.h"
00118 #include "modules/scheduler/scheduler.h"
00119 #include "lib_mcu/wdt/wdt_drv.h"
00120 #include "lib_mcu/power/power_drv.h"
00121 #include "lib_mem/nf/nf_mngt.h"
00122 #include "lib_mcu/uart/uart_lib.h"
00123 #define  _TRACE_        (DISABLE)
00124 #include "lib_mcu/debug.h"
00125 
00126 //_____ M A C R O S ________________________________________________________
00127 
00128 //_____ D E F I N I T I O N S ______________________________________________
00129        
00130 int main(void)
00131 { 
00132    U8 nb_device;
00133    
00134    wdtdrv_disable();
00135    Clear_prescaler();
00136 
00137    uart_init();
00138 #ifdef __GNUC__
00139    fdevopen((int (*)(char, FILE*))(uart_putchar),(int (*)(FILE*))uart_getchar); //for printf redirection used in TRACE
00140 #endif
00141    trace("\x0C-----------Start\n\r");
00142    trace_nl();
00143    
00144    // STK525 init
00145    Leds_init();
00146    Joy_init();
00147    Hwb_button_init();
00148 
00149    // Mass Storage Extension board init
00150    Avr_ms_board_init();
00151 
00152    // NAND Flash Initialization
00153 #if (NF_AUTO_DETECT_2KB == FALSE) && (NF_AUTO_DETECT_512B == FALSE)
00154    nb_device = nfc_check_type(NF_N_DEVICES);
00155    while( NF_N_DEVICES != nb_device );
00156 #else
00157    nfc_detect();
00158 #endif
00159    nf_init();
00160 
00161    nf_test_unit_ready();
00162    scheduler();
00163    return 0;
00164 }
00165 
00169 #ifdef  __GNUC__
00170 // Locate low level init function before RAM init (init3 section)
00171 // and remove std prologue/epilogue
00172 char __low_level_init(void) __attribute__ ((section (".init3"),naked));
00173 #endif
00174 
00175 #ifdef __cplusplus
00176 extern "C" {
00177 #endif
00178 char __low_level_init()
00179 {
00180   Clear_prescaler();
00181   return 1;
00182 }
00183 #ifdef __cplusplus
00184 }
00185 #endif

Generated on Fri Oct 31 14:31:23 2008 for ATMEL by  doxygen 1.5.3