From 3ea68ecfc1bb68de17f9dc34099ffbb1791af95c Mon Sep 17 00:00:00 2001 From: Zakaria_Kasmi Date: Thu, 27 Jun 2013 16:16:57 +0200 Subject: [PATCH] add a handler for the heap state --- sys/shell/commands/Makefile | 4 ++-- sys/shell/commands/sc_heap.c | 24 ++++++++++++++++++++++++ sys/shell/commands/shell_commands.c | 11 +++++++---- 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 sys/shell/commands/sc_heap.c diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile index 6e817f8ae1..360e94c8eb 100644 --- a/sys/shell/commands/Makefile +++ b/sys/shell/commands/Makefile @@ -1,5 +1,5 @@ -SRC = shell_commands.c sc_id.c -INCLUDES = -I../../../core/include -I../../include -I../../../drivers/include/ +SRC = shell_commands.c sc_id.c sc_heap.c +INCLUDES = -I../../../core/include -I../../include -I../../../drivers/include/ ifneq (,$(findstring cc110x_ng,$(USEMODULE))) INCLUDES += -I$(RIOTBASE)/drivers/cc110x_ng/include/ diff --git a/sys/shell/commands/sc_heap.c b/sys/shell/commands/sc_heap.c new file mode 100644 index 0000000000..b8e1477084 --- /dev/null +++ b/sys/shell/commands/sc_heap.c @@ -0,0 +1,24 @@ +/* + * sc_heap.c - the handler of the heap state on the command shell. + * Copyright (C) 2013 Zakaria Kasmi + * + * The source code is licensed under the LGPLv2 license, See the file LICENSE for more details. + */ + +/** + * @file + * @internal + * @brief Show the heap state for the LPC2387 on the command shell. + * + * @author Freie Universität Berlin, Computer Systems & Telematics + * @author Zakaria Kasmi + * + * @note $Id: sc_heap.c 3854 2013-05-24 17:53:01Z zkasmi $ + */ + +extern void heap_stats(void); + +void _heap_handler(char* unnused){ + heap_stats(); +} + diff --git a/sys/shell/commands/shell_commands.c b/sys/shell/commands/shell_commands.c index b9bc83e502..8e0352bd19 100644 --- a/sys/shell/commands/shell_commands.c +++ b/sys/shell/commands/shell_commands.c @@ -3,22 +3,25 @@ * * Copyright (C) 2013 INRIA. * - * This file 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. + * The source code is licensed under the LGPLv2 license, + * see the file LICENSE for more details. * * @ingroup shell_commands * @{ * @file shell_commands.c * @brief sets up the system shell command struct * @author Oliver Hahm + * @author Zakaria Kasmi * @} */ #include #include -extern void _id_handler(char *id); + + +extern void _id_handler(char* id); +extern void _heap_handler(char* unused); #ifdef MODULE_PS extern void _ps_handler(char *unused);