Skip to content

Commit

Permalink
Merge pull request #2 from LudwigOrtmann/shell_syscalls
Browse files Browse the repository at this point in the history
add system calls to the shell (to implement a reboot command)
  • Loading branch information
rousselk committed Feb 14, 2014
2 parents 4eee19f + 523129c commit 3753f38
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sys/shell/commands/Makefile
@@ -1,4 +1,4 @@
SRC = shell_commands.c sc_id.c
SRC = shell_commands.c sc_id.c sc_sys.c

ifneq (,$(findstring transceiver,$(USEMODULE)))
SRC += sc_transceiver.c
Expand Down
24 changes: 24 additions & 0 deletions sys/shell/commands/sc_sys.c
@@ -0,0 +1,24 @@
/**
* Shell commands for system calls
*
* Copyright (C) 2014 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*
* @ingroup shell_commands
* @{
* @file
* @brief shell commands for system calls
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
* @}
*/

#include "kernel.h"

void _reboot_handler(char *unused)
{
(void) unused;
reboot();
}
4 changes: 3 additions & 1 deletion sys/shell/commands/shell_commands.c
@@ -1,7 +1,7 @@
/**
* Provides prototypes for available shell commands
*
* Copyright (C) 2013 INRIA.
* Copyright (C) 2014 INRIA.
*
* This source code is licensed under the LGPLv2 license,
* See the file LICENSE for more details.
Expand All @@ -24,6 +24,7 @@
#include "shell_commands.h"

extern void _id_handler(char *id);
extern void _reboot_handler(char *unused);
extern void _heap_handler(char *unused);

#ifdef MODULE_PS
Expand Down Expand Up @@ -104,6 +105,7 @@ extern void _mersenne_get(char *str);

const shell_command_t _shell_command_list[] = {
{"id", "Gets or sets the node's id.", _id_handler},
{"reboot", "Reboot the node", _reboot_handler},
#ifdef MODULE_LPC_COMMON
{"heap", "Shows the heap state for the LPC2387 on the command shell.", _heap_handler},
#endif
Expand Down

0 comments on commit 3753f38

Please sign in to comment.