mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
mbed_official
Date:
Mon Feb 15 10:00:10 2016 +0000
Revision:
64:41a834223ea3
Parent:
15:a81a8d6c1dfe
Synchronized with git revision e641fd47cf2a6bafdbe87c743a39772f73edcbe7

Full URL: https://github.com/mbedmicro/mbed/commit/e641fd47cf2a6bafdbe87c743a39772f73edcbe7/

Fixed GCC Compiler warnings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 15:a81a8d6c1dfe 1 /**
mbed_official 15:a81a8d6c1dfe 2 * \file
mbed_official 15:a81a8d6c1dfe 3 *
mbed_official 15:a81a8d6c1dfe 4 * \brief SAM System related functionality
mbed_official 15:a81a8d6c1dfe 5 *
mbed_official 15:a81a8d6c1dfe 6 * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
mbed_official 15:a81a8d6c1dfe 7 *
mbed_official 15:a81a8d6c1dfe 8 * \asf_license_start
mbed_official 15:a81a8d6c1dfe 9 *
mbed_official 15:a81a8d6c1dfe 10 * \page License
mbed_official 15:a81a8d6c1dfe 11 *
mbed_official 15:a81a8d6c1dfe 12 * Redistribution and use in source and binary forms, with or without
mbed_official 15:a81a8d6c1dfe 13 * modification, are permitted provided that the following conditions are met:
mbed_official 15:a81a8d6c1dfe 14 *
mbed_official 15:a81a8d6c1dfe 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 15:a81a8d6c1dfe 16 * this list of conditions and the following disclaimer.
mbed_official 15:a81a8d6c1dfe 17 *
mbed_official 15:a81a8d6c1dfe 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 15:a81a8d6c1dfe 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 15:a81a8d6c1dfe 20 * and/or other materials provided with the distribution.
mbed_official 15:a81a8d6c1dfe 21 *
mbed_official 15:a81a8d6c1dfe 22 * 3. The name of Atmel may not be used to endorse or promote products derived
mbed_official 15:a81a8d6c1dfe 23 * from this software without specific prior written permission.
mbed_official 15:a81a8d6c1dfe 24 *
mbed_official 15:a81a8d6c1dfe 25 * 4. This software may only be redistributed and used in connection with an
mbed_official 15:a81a8d6c1dfe 26 * Atmel microcontroller product.
mbed_official 15:a81a8d6c1dfe 27 *
mbed_official 15:a81a8d6c1dfe 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
mbed_official 15:a81a8d6c1dfe 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
mbed_official 15:a81a8d6c1dfe 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
mbed_official 15:a81a8d6c1dfe 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
mbed_official 15:a81a8d6c1dfe 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 15:a81a8d6c1dfe 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
mbed_official 15:a81a8d6c1dfe 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
mbed_official 15:a81a8d6c1dfe 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
mbed_official 15:a81a8d6c1dfe 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
mbed_official 15:a81a8d6c1dfe 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 15:a81a8d6c1dfe 38 * POSSIBILITY OF SUCH DAMAGE.
mbed_official 15:a81a8d6c1dfe 39 *
mbed_official 15:a81a8d6c1dfe 40 * \asf_license_stop
mbed_official 15:a81a8d6c1dfe 41 *
mbed_official 15:a81a8d6c1dfe 42 */
mbed_official 15:a81a8d6c1dfe 43 /*
mbed_official 15:a81a8d6c1dfe 44 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
mbed_official 15:a81a8d6c1dfe 45 */
mbed_official 15:a81a8d6c1dfe 46
mbed_official 15:a81a8d6c1dfe 47 #include <system.h>
mbed_official 64:41a834223ea3 48 #include <toolchain.h>
mbed_official 15:a81a8d6c1dfe 49
mbed_official 15:a81a8d6c1dfe 50 /**
mbed_official 15:a81a8d6c1dfe 51 * \internal
mbed_official 15:a81a8d6c1dfe 52 * Dummy initialization function, used as a weak alias target for the various
mbed_official 15:a81a8d6c1dfe 53 * init functions called by \ref system_init().
mbed_official 15:a81a8d6c1dfe 54 */
mbed_official 15:a81a8d6c1dfe 55 void _system_dummy_init(void);
mbed_official 15:a81a8d6c1dfe 56 void _system_dummy_init(void)
mbed_official 15:a81a8d6c1dfe 57 {
mbed_official 15:a81a8d6c1dfe 58 return;
mbed_official 15:a81a8d6c1dfe 59 }
mbed_official 15:a81a8d6c1dfe 60
mbed_official 15:a81a8d6c1dfe 61 #if !defined(__DOXYGEN__)
mbed_official 15:a81a8d6c1dfe 62 # if defined(__GNUC__)
mbed_official 15:a81a8d6c1dfe 63 void system_clock_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 15:a81a8d6c1dfe 64 void system_board_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 15:a81a8d6c1dfe 65 void _system_events_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 15:a81a8d6c1dfe 66 void _system_extint_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 15:a81a8d6c1dfe 67 void _system_divas_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 15:a81a8d6c1dfe 68 # elif defined(__ICCARM__)
mbed_official 15:a81a8d6c1dfe 69 void system_clock_init(void);
mbed_official 15:a81a8d6c1dfe 70 void system_board_init(void);
mbed_official 15:a81a8d6c1dfe 71 void _system_events_init(void);
mbed_official 15:a81a8d6c1dfe 72 void _system_extint_init(void);
mbed_official 15:a81a8d6c1dfe 73 void _system_divas_init(void);
mbed_official 15:a81a8d6c1dfe 74 # pragma weak system_clock_init=_system_dummy_init
mbed_official 15:a81a8d6c1dfe 75 # pragma weak system_board_init=_system_dummy_init
mbed_official 15:a81a8d6c1dfe 76 # pragma weak _system_events_init=_system_dummy_init
mbed_official 15:a81a8d6c1dfe 77 # pragma weak _system_extint_init=_system_dummy_init
mbed_official 15:a81a8d6c1dfe 78 # pragma weak _system_divas_init=_system_dummy_init
mbed_official 15:a81a8d6c1dfe 79 # endif
mbed_official 15:a81a8d6c1dfe 80 #endif
mbed_official 15:a81a8d6c1dfe 81
mbed_official 15:a81a8d6c1dfe 82 /**
mbed_official 15:a81a8d6c1dfe 83 * \brief Initialize system
mbed_official 15:a81a8d6c1dfe 84 *
mbed_official 15:a81a8d6c1dfe 85 * This function will call the various initialization functions within the
mbed_official 15:a81a8d6c1dfe 86 * system namespace. If a given optional system module is not available, the
mbed_official 15:a81a8d6c1dfe 87 * associated call will effectively be a NOP (No Operation).
mbed_official 15:a81a8d6c1dfe 88 *
mbed_official 15:a81a8d6c1dfe 89 * Currently the following initialization functions are supported:
mbed_official 15:a81a8d6c1dfe 90 * - System clock initialization (via the SYSTEM CLOCK sub-module)
mbed_official 15:a81a8d6c1dfe 91 * - Board hardware initialization (via the Board module)
mbed_official 15:a81a8d6c1dfe 92 * - Event system driver initialization (via the EVSYS module)
mbed_official 15:a81a8d6c1dfe 93 * - External Interrupt driver initialization (via the EXTINT module)
mbed_official 15:a81a8d6c1dfe 94 */
mbed_official 15:a81a8d6c1dfe 95 void system_init(void)
mbed_official 15:a81a8d6c1dfe 96 {
mbed_official 15:a81a8d6c1dfe 97 /* Configure GCLK and clock sources according to conf_clocks.h */
mbed_official 15:a81a8d6c1dfe 98 system_clock_init();
mbed_official 15:a81a8d6c1dfe 99
mbed_official 15:a81a8d6c1dfe 100 /* Initialize board hardware */
mbed_official 15:a81a8d6c1dfe 101 system_board_init();
mbed_official 15:a81a8d6c1dfe 102
mbed_official 15:a81a8d6c1dfe 103 /* Initialize EVSYS hardware */
mbed_official 15:a81a8d6c1dfe 104 _system_events_init();
mbed_official 15:a81a8d6c1dfe 105
mbed_official 15:a81a8d6c1dfe 106 /* Initialize External hardware */
mbed_official 15:a81a8d6c1dfe 107 _system_extint_init();
mbed_official 15:a81a8d6c1dfe 108
mbed_official 15:a81a8d6c1dfe 109 /* Initialize DIVAS hardware */
mbed_official 15:a81a8d6c1dfe 110 _system_divas_init();
mbed_official 15:a81a8d6c1dfe 111 }
mbed_official 15:a81a8d6c1dfe 112