main.c

Go to the documentation of this file.
00001 /*This file is prepared for Doxygen automatic documentation generation.*/
00212 
00213 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
00214  *
00215  * Redistribution and use in source and binary forms, with or without
00216  * modification, are permitted provided that the following conditions are met:
00217  *
00218  * 1. Redistributions of source code must retain the above copyright notice,
00219  * this list of conditions and the following disclaimer.
00220  *
00221  * 2. Redistributions in binary form must reproduce the above copyright notice,
00222  * this list of conditions and the following disclaimer in the documentation
00223  * and/or other materials provided with the distribution.
00224  *
00225  * 3. The name of Atmel may not be used to endorse or promote products derived
00226  * from this software without specific prior written permission.
00227  *
00228  * 4. This software may only be redistributed and used in connection with an Atmel
00229  * AVR product.
00230  *
00231  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
00232  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00233  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
00234  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
00235  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00236  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00237  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00238  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00239  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00240  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00241  */
00242 
00243 //_____  I N C L U D E S ___________________________________________________
00244 
00245 #include "config.h"
00246 #include "modules/scheduler/scheduler.h"
00247 #include "lib_mcu/wdt/wdt_drv.h"
00248 #include "lib_mcu/power/power_drv.h"
00249 #include "lib_mem/nf/nf_mngt.h"
00250 
00251 //_____ M A C R O S ________________________________________________________
00252 
00253 //_____ D E F I N I T I O N S ______________________________________________
00254 
00255 int main(void)
00256 {   
00257    U8 nb_device;
00258    
00259    wdtdrv_disable();
00260    Clear_prescaler();
00261    
00262    // STK525 init
00263    Leds_init();
00264    Joy_init();
00265    Hwb_button_init();
00266    
00267    // Mass Storage Extension board init
00268    Avr_ms_board_init();
00269 
00270    // NAND Flash Initialization
00271 #if (NF_AUTO_DETECT_2KB == FALSE) && (NF_AUTO_DETECT_512B == FALSE)
00272    nb_device = nfc_check_type(NF_N_DEVICES);
00273    while( NF_N_DEVICES != nb_device );
00274 #else
00275    nfc_detect();
00276 #endif
00277    nf_init();
00278    
00279    nf_test_unit_ready();
00280    scheduler();
00281    return 0;
00282 }
00283 
00287 #ifdef  __GNUC__
00288 // Locate low level init function before RAM init (init3 section)
00289 // and remove std prologue/epilogue
00290 char __low_level_init(void) __attribute__ ((section (".init3"),naked));
00291 #endif
00292 
00293 #ifdef __cplusplus
00294 extern "C" {
00295 #endif
00296 char __low_level_init()
00297 {
00298   Clear_prescaler();
00299   return 1;
00300 }
00301 #ifdef __cplusplus
00302 }
00303 #endif

Generated on Wed Sep 23 09:17:02 2009 for ATMEL by  doxygen 1.5.3