1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/examples/default/main.c

70 lines
1.4 KiB
C

/*
* Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de>
* Copyright (C) 2013 INRIA
* Copyright (C) 2013 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*
* 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.
*/
/**
* @ingroup examples
* @{
*
* @file
* @brief Default application that shows a lot of functionality of RIOT
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*
* @}
*/
#include <stdio.h>
#include <string.h>
#include "thread.h"
#ifdef MODULE_NEWLIB
# include "uart_stdio.h"
#else
# include "posix_io.h"
# include "board_uart0.h"
#endif
#include "shell.h"
#include "shell_commands.h"
#if FEATURE_PERIPH_RTC
#include "periph/rtc.h"
#endif
#ifdef MODULE_LTC4150
#include "ltc4150.h"
#endif
int main(void)
{
shell_t shell;
#ifdef MODULE_LTC4150
ltc4150_start();
#endif
#ifdef FEATURE_PERIPH_RTC
rtc_init();
#endif
(void) puts("Welcome to RIOT!");
#ifndef MODULE_NEWLIB
(void) posix_open(uart0_handler_pid, 0);
shell_init(&shell, NULL, UART0_BUFSIZE, uart0_readc, uart0_putc);
#else
shell_init(&shell, NULL, UART0_BUFSIZE, getchar, putchar);
#endif
shell_run(&shell);
return 0;
}