1 /*******************************************************************************
\r
4 * This is a template for early application low-level initialization.
\r
6 * The following license agreement applies to linker command files,
\r
7 * example projects (unless another license is explicitly stated), the
\r
8 * cstartup code, low_level_init.c, and some other low-level runtime
\r
12 * Copyright 2013, IAR Systems AB.
\r
14 * This source code is the property of IAR Systems. The source code may only
\r
15 * be used together with the IAR Embedded Workbench. Redistribution and use
\r
16 * in source and binary forms, with or without modification, is permitted
\r
17 * provided that the following conditions are met:
\r
19 * - Redistributions of source code, in whole or in part, must retain the
\r
20 * above copyright notice, this list of conditions and the disclaimer below.
\r
22 * - IAR Systems name may not be used to endorse or promote products
\r
23 * derived from this software without specific prior written permission.
\r
25 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
\r
26 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
\r
27 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
\r
28 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
\r
29 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
\r
30 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
\r
31 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
\r
33 ******************************************************************************/
\r
36 * The function __low_level_init it called by the start-up code before
\r
37 * "main" is called, and before data segment initialization is
\r
40 * This is a template file, modify to perform any initialization that
\r
41 * should take place early.
\r
43 * The return value of this function controls if data segment
\r
44 * initialization should take place. If 0 is returned, it is bypassed.
\r
46 * For the MSP430 microcontroller family, please consider disabling
\r
47 * the watchdog timer here, as it could time-out during the data
\r
48 * segment initialization.
\r
51 #include <intrinsics.h>
\r
54 int __low_level_init(void)
\r
56 /* Insert your low-level initializations here */
\r
57 WDTCTL = WDTPW | WDTHOLD;
\r
62 * 1 - Perform data segment initialization.
\r
63 * 0 - Skip data segment initialization.
\r