projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor fixes.
[bertos.git]
/
bertos
/
mware
/
parser.h
diff --git
a/bertos/mware/parser.h
b/bertos/mware/parser.h
index 0e2b0b9d9aa5804335830fe55a49733eba2001eb..281db3964c05e51c8a85fe110daf8a670fb3947b 100644
(file)
--- a/
bertos/mware/parser.h
+++ b/
bertos/mware/parser.h
@@
-70,8
+70,8
@@
* // Declare a buzzer command
* MAKE_CMD(beep, "d", "",
* ({
* // Declare a buzzer command
* MAKE_CMD(beep, "d", "",
* ({
- * buz_beep(args[1].l);
- * RC_OK;
+ * buz_beep(args[1].l);
+ * RC_OK;
* }), 0)
*
* // initialize the parser
* }), 0)
*
* // initialize the parser
@@
-92,7
+92,7
@@
* //Execute command
* if(!parser_execute_cmd(templ, args))
* {
* //Execute command
* if(!parser_execute_cmd(templ, args))
* {
- * // error
+ * // error
* }
* // Now args contain the outputs of the function, you can send it
* // back to the caller
* }
* // Now args contain the outputs of the function, you can send it
* // back to the caller
@@
-100,6
+100,8
@@
*
* \endcode
*
*
* \endcode
*
+ * <b>Configuration file</b>: cfg_parser.h
+ *
* \author Bernie Innocenti <bernie@codewiz.org>
* \author Stefano Fedrigo <aleph@develer.com>
* \author Giovanni Bajo <rasky@develer.com>
* \author Bernie Innocenti <bernie@codewiz.org>
* \author Stefano Fedrigo <aleph@develer.com>
* \author Giovanni Bajo <rasky@develer.com>
@@
-116,6
+118,7
@@
#include "cfg/cfg_parser.h"
#include <cpu/types.h>
#include "cfg/cfg_parser.h"
#include <cpu/types.h>
+#include <cfg/debug.h>
/**
* Error generated by the commands through the return code.
/**
* Error generated by the commands through the return code.
@@
-161,7
+164,11
@@
struct CmdTemplate
*
* \param NAME Command name to register
*/
*
* \param NAME Command name to register
*/
-#define REGISTER_CMD(NAME) REGISTER_FUNCTION(&cmd_ ## NAME ## _template)
+#define REGISTER_CMD(NAME) \
+ do { \
+ if (!REGISTER_FUNCTION(&cmd_ ## NAME ## _template)) \
+ ASSERT2(0, "Error in registering command, no space left"); \
+ } while (0)
/**
* Utility macro to create a command template.
/**
* Utility macro to create a command template.
@@
-217,7
+224,7
@@
MAKE_TEMPLATE(NAME, ARGS, RES, FLAGS)
*/
void parser_init(void);
*/
void parser_init(void);
-
void
parser_register_cmd(const struct CmdTemplate* cmd);
+
bool
parser_register_cmd(const struct CmdTemplate* cmd);
/**
/**