mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #2 from LudwigOrtmann/shell_syscalls
add system calls to the shell (to implement a reboot command)
This commit is contained in:
commit
3753f382fc
@ -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
|
||||
|
24
sys/shell/commands/sc_sys.c
Normal file
24
sys/shell/commands/sc_sys.c
Normal file
@ -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();
|
||||
}
|
@ -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.
|
||||
@ -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
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user