2014-02-02 16:48:18 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin
|
|
|
|
*
|
2014-07-31 19:45:27 +02:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
2014-02-02 16:48:18 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup cpu
|
|
|
|
* @{
|
|
|
|
*
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2014-02-02 16:48:18 +01:00
|
|
|
* @brief Calls startup functions on MSP430-based platforms
|
|
|
|
*
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
#include <stdio.h>
|
2019-02-25 23:00:52 +01:00
|
|
|
|
|
|
|
#include "periph_conf.h"
|
|
|
|
#include "periph/init.h"
|
2016-02-27 01:12:02 +01:00
|
|
|
#include "kernel_init.h"
|
2019-02-25 23:00:52 +01:00
|
|
|
#include "stdio_base.h"
|
2021-09-07 21:03:36 +02:00
|
|
|
#include "cpu.h"
|
2016-02-27 01:12:02 +01:00
|
|
|
#include "irq.h"
|
2018-01-11 09:27:20 +01:00
|
|
|
#include "log.h"
|
2020-09-15 15:20:49 +02:00
|
|
|
#ifdef MODULE_DBGPIN
|
|
|
|
#include "dbgpin.h"
|
|
|
|
#endif
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2013-02-11 22:10:03 +01:00
|
|
|
extern void board_init(void);
|
2021-10-18 17:30:06 +02:00
|
|
|
extern void msp430_cpu_init(void);
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2013-06-21 03:52:57 +02:00
|
|
|
__attribute__((constructor)) static void startup(void)
|
|
|
|
{
|
2021-09-07 21:03:36 +02:00
|
|
|
msp430_cpu_init();
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
board_init();
|
|
|
|
|
2020-09-15 15:20:49 +02:00
|
|
|
#ifdef MODULE_DBGPIN
|
|
|
|
dbgpin_init();
|
|
|
|
#endif
|
|
|
|
|
2019-02-25 23:00:52 +01:00
|
|
|
#ifdef MODULE_NEWLIB
|
|
|
|
void _init(void);
|
|
|
|
_init();
|
|
|
|
#endif
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2019-02-25 23:00:52 +01:00
|
|
|
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
|
2023-01-02 18:08:35 +01:00
|
|
|
early_init();
|
2019-02-25 23:00:52 +01:00
|
|
|
/* trigger static peripheral initialization */
|
|
|
|
periph_init();
|
|
|
|
/* continue with kernel initialization */
|
2010-09-22 15:10:42 +02:00
|
|
|
kernel_init();
|
2019-02-25 23:00:52 +01:00
|
|
|
|
|
|
|
__builtin_unreachable();
|
2010-09-22 15:10:42 +02:00
|
|
|
}
|