2013-06-18 17:21:38 +02:00
|
|
|
/**
|
2013-06-22 05:11:53 +02:00
|
|
|
* Auto initialization for used modules
|
2013-06-18 17:21:38 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 2013 INRIA.
|
|
|
|
*
|
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.
|
2013-06-18 17:21:38 +02:00
|
|
|
*
|
|
|
|
* @ingroup auto_init
|
|
|
|
* @{
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2013-06-18 17:21:38 +02:00
|
|
|
* @brief initializes any used module that has a trivial init function
|
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
2015-04-29 21:17:07 +02:00
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
2013-06-18 17:21:38 +02:00
|
|
|
* @}
|
|
|
|
*/
|
2010-09-22 15:10:42 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
2013-10-27 17:23:25 +01:00
|
|
|
|
|
|
|
#include "auto_init.h"
|
|
|
|
|
2014-10-30 17:48:58 +01:00
|
|
|
#ifdef MODULE_CONFIG
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2013-12-21 15:23:17 +01:00
|
|
|
#ifdef MODULE_SHT11
|
|
|
|
#include "sht11.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_GPIOINT
|
|
|
|
#include "gpioint.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_LTC4150
|
|
|
|
#include "ltc4150.h"
|
|
|
|
#endif
|
|
|
|
|
2013-10-27 17:23:25 +01:00
|
|
|
#ifdef MODULE_UART0
|
2011-12-12 17:50:22 +01:00
|
|
|
#include "board_uart0.h"
|
2013-10-27 17:23:25 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_MCI
|
2011-12-12 17:50:22 +01:00
|
|
|
#include "diskio.h"
|
2013-10-27 17:23:25 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_VTIMER
|
2012-05-22 15:59:36 +02:00
|
|
|
#include "vtimer.h"
|
2013-10-27 17:23:25 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_RTC
|
2014-11-20 17:55:28 +01:00
|
|
|
#include "periph/rtc.h"
|
2013-10-27 17:23:25 +01:00
|
|
|
#endif
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_SIXLOWPAN
|
|
|
|
#include "net/gnrc/sixlowpan.h"
|
2015-03-16 17:52:19 +01:00
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_IPV6
|
|
|
|
#include "net/gnrc/ipv6.h"
|
2015-03-03 22:20:21 +01:00
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_IPV6_NETIF
|
|
|
|
#include "net/gnrc/ipv6/netif.h"
|
2015-05-09 16:03:18 +02:00
|
|
|
#endif
|
|
|
|
|
2014-11-21 23:10:06 +01:00
|
|
|
#ifdef MODULE_L2_PING
|
|
|
|
#include "l2_ping.h"
|
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_PKTBUF
|
|
|
|
#include "net/gnrc/pktbuf.h"
|
2015-07-24 17:29:29 +02:00
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_PKTDUMP
|
|
|
|
#include "net/gnrc/pktdump.h"
|
2015-03-25 23:51:35 +01:00
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_UDP
|
|
|
|
#include "net/gnrc/udp.h"
|
2015-04-24 15:08:36 +02:00
|
|
|
#endif
|
|
|
|
|
2015-05-19 09:54:14 +02:00
|
|
|
#ifdef MODULE_DEV_ETH_AUTOINIT
|
|
|
|
#include "net/dev_eth.h"
|
|
|
|
#include "dev_eth_autoinit.h"
|
|
|
|
#endif
|
|
|
|
|
2015-06-05 22:16:34 +02:00
|
|
|
#ifdef MODULE_FIB
|
2015-08-05 15:43:36 +02:00
|
|
|
#include "net/fib.h"
|
2015-06-05 22:16:34 +02:00
|
|
|
#endif
|
|
|
|
|
2013-07-25 21:55:49 +02:00
|
|
|
#define ENABLE_DEBUG (0)
|
2013-10-27 17:23:25 +01:00
|
|
|
#include "debug.h"
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2014-08-08 23:53:38 +02:00
|
|
|
void auto_init(void)
|
|
|
|
{
|
2014-10-30 17:48:58 +01:00
|
|
|
#ifdef MODULE_CONFIG
|
|
|
|
DEBUG("Auto init loading config\n");
|
|
|
|
config_load();
|
|
|
|
#endif
|
|
|
|
|
2014-08-08 23:53:38 +02:00
|
|
|
#ifdef MODULE_VTIMER
|
|
|
|
DEBUG("Auto init vtimer module.\n");
|
|
|
|
vtimer_init();
|
|
|
|
#endif
|
2015-07-15 13:53:05 +02:00
|
|
|
#ifndef MODULE_UART_STDIO
|
2014-08-08 23:53:38 +02:00
|
|
|
#ifdef MODULE_UART0
|
|
|
|
DEBUG("Auto init uart0 module.\n");
|
|
|
|
board_uart0_init();
|
|
|
|
#endif
|
2015-07-15 13:53:05 +02:00
|
|
|
#endif
|
2014-08-08 23:53:38 +02:00
|
|
|
#ifdef MODULE_RTC
|
|
|
|
DEBUG("Auto init rtc module.\n");
|
|
|
|
rtc_init();
|
|
|
|
#endif
|
|
|
|
#ifdef MODULE_SHT11
|
|
|
|
DEBUG("Auto init SHT11 module.\n");
|
|
|
|
sht11_init();
|
|
|
|
#endif
|
|
|
|
#ifdef MODULE_GPIOINT
|
|
|
|
DEBUG("Auto init gpioint module.\n");
|
|
|
|
gpioint_init();
|
|
|
|
#endif
|
|
|
|
#ifdef MODULE_LTC4150
|
|
|
|
DEBUG("Auto init ltc4150 module.\n");
|
|
|
|
ltc4150_init();
|
|
|
|
#endif
|
|
|
|
#ifdef MODULE_MCI
|
|
|
|
DEBUG("Auto init mci module.\n");
|
|
|
|
MCI_initialize();
|
|
|
|
#endif
|
2011-01-31 18:25:20 +01:00
|
|
|
#ifdef MODULE_PROFILING
|
|
|
|
extern void profiling_init(void);
|
|
|
|
profiling_init();
|
2010-09-22 15:10:42 +02:00
|
|
|
#endif
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_PKTBUF
|
|
|
|
DEBUG("Auto init gnrc_pktbuf module\n");
|
|
|
|
gnrc_pktbuf_init();
|
2015-07-24 17:29:29 +02:00
|
|
|
#endif
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_PKTDUMP
|
|
|
|
DEBUG("Auto init gnrc_pktdump module.\n");
|
|
|
|
gnrc_pktdump_init();
|
2015-03-25 23:51:35 +01:00
|
|
|
#endif
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_SIXLOWPAN
|
|
|
|
DEBUG("Auto init gnrc_sixlowpan module.\n");
|
|
|
|
gnrc_sixlowpan_init();
|
2015-03-16 17:52:19 +01:00
|
|
|
#endif
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_IPV6
|
|
|
|
DEBUG("Auto init gnrc_ipv6 module.\n");
|
|
|
|
gnrc_ipv6_init();
|
2015-03-03 22:20:21 +01:00
|
|
|
#endif
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_UDP
|
2015-04-24 15:08:36 +02:00
|
|
|
DEBUG("Auto init UDP module.\n");
|
2015-08-17 15:41:29 +02:00
|
|
|
gnrc_udp_init();
|
2015-04-24 15:08:36 +02:00
|
|
|
#endif
|
2015-06-05 22:16:34 +02:00
|
|
|
#ifdef MODULE_FIB
|
|
|
|
DEBUG("Auto init FIB module.\n");
|
|
|
|
fib_init();
|
|
|
|
#endif
|
2015-05-08 15:50:35 +02:00
|
|
|
|
|
|
|
|
2015-05-17 21:01:07 +02:00
|
|
|
/* initialize network devices */
|
|
|
|
#ifdef MODULE_AUTO_INIT_NG_NETIF
|
2015-05-08 15:50:35 +02:00
|
|
|
|
2015-08-09 21:24:55 +02:00
|
|
|
#ifdef MODULE_AT86RF2XX
|
|
|
|
extern void auto_init_at86rf2xx(void);
|
|
|
|
auto_init_at86rf2xx();
|
2015-05-08 15:50:35 +02:00
|
|
|
#endif
|
2015-05-08 15:51:26 +02:00
|
|
|
|
|
|
|
#ifdef MODULE_XBEE
|
|
|
|
extern void auto_init_xbee(void);
|
|
|
|
auto_init_xbee();
|
|
|
|
#endif
|
2015-05-17 21:01:07 +02:00
|
|
|
|
2015-05-17 15:21:49 +02:00
|
|
|
#ifdef MODULE_KW2XRF
|
|
|
|
extern void auto_init_kw2xrf(void);
|
|
|
|
auto_init_kw2xrf();
|
|
|
|
#endif
|
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_NETDEV_ETH
|
2015-05-27 21:58:38 +02:00
|
|
|
extern void auto_init_ng_netdev_eth(void);
|
|
|
|
auto_init_ng_netdev_eth();
|
|
|
|
#endif
|
|
|
|
|
2015-05-17 21:01:07 +02:00
|
|
|
#endif /* MODULE_AUTO_INIT_NG_NETIF */
|
2015-05-09 16:03:18 +02:00
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
#ifdef MODULE_GNRC_IPV6_NETIF
|
|
|
|
gnrc_ipv6_netif_init_by_dev();
|
2015-05-09 16:03:18 +02:00
|
|
|
#endif
|
2010-09-22 15:10:42 +02:00
|
|
|
}
|