summaryrefslogtreecommitdiffstatshomepage
path: root/zephyr/help.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-22 10:31:02 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-22 11:56:16 +1100
commit77e0cee49ec182b95cefc7a00a1c96b5db278cb2 (patch)
treed46a7ca9a3ccf7ff8ef0b3c950dd5bc86cab313a /zephyr/help.c
parent739465c04fa674838c63f1c6a30f91a3706179ca (diff)
downloadmicropython-77e0cee49ec182b95cefc7a00a1c96b5db278cb2.tar.gz
micropython-77e0cee49ec182b95cefc7a00a1c96b5db278cb2.zip
zephyr: Convert to use builtin help function.
Diffstat (limited to 'zephyr/help.c')
-rw-r--r--zephyr/help.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/zephyr/help.c b/zephyr/help.c
index e40a11781d..0c7f279406 100644
--- a/zephyr/help.c
+++ b/zephyr/help.c
@@ -24,11 +24,9 @@
* THE SOFTWARE.
*/
-#include <stdio.h>
+#include "py/builtin.h"
-#include "lib/utils/pyhelp.h"
-
-STATIC const char *help_text =
+const char *zephyr_help_text =
"Welcome to MicroPython!\n"
"\n"
"Control commands:\n"
@@ -40,17 +38,3 @@ STATIC const char *help_text =
"\n"
"For further help on a specific object, type help(obj)\n"
;
-
-STATIC mp_obj_t builtin_help(size_t n_args, const mp_obj_t *args) {
- if (n_args == 0) {
- // print a general help message
- printf("%s", help_text);
-
- } else {
- // try to print something sensible about the given object
- pyhelp_print_obj(args[0]);
- }
-
- return mp_const_none;
-}
-MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_help_obj, 0, 1, builtin_help);