Blame view

RIOT/examples/default/main.c 1.34 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  /*
   * Copyright (C) 2008, 2009, 2010  Kaspar Schleiser <kaspar@schleiser.de>
   * Copyright (C) 2013 INRIA
   * Copyright (C) 2013 Ludwig Knüpfer <ludwig.knuepfer@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 Knüpfer <ludwig.knuepfer@fu-berlin.de>
   *
   * @}
   */
  
  #include <stdio.h>
  #include <string.h>
  
  #include "thread.h"
  #include "shell.h"
  #include "shell_commands.h"
  
  #if FEATURE_PERIPH_RTC
  #include "periph/rtc.h"
  #endif
  
  #ifdef MODULE_NETIF
  #include "net/gnrc/pktdump.h"
  #include "net/gnrc.h"
  #endif
  
  int main(void)
  {
  #ifdef FEATURE_PERIPH_RTC
      rtc_init();
  #endif
  
  #ifdef MODULE_NETIF
      gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
                                                            gnrc_pktdump_pid);
      gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);
  #endif
  
      (void) puts("Welcome to RIOT!");
  
      char line_buf[SHELL_DEFAULT_BUFSIZE];
      shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
  
      return 0;
  }