Skip to content

Commit fdaf2b8

Browse files
robert-hhdpgeorge
authored andcommitted
mimxrt: Add custom help text and enable help("modules").
1 parent c5d2095 commit fdaf2b8

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Diff for: ports/mimxrt/main.c

+24
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,27 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c
108108
}
109109
}
110110
#endif
111+
112+
const char mimxrt_help_text[] =
113+
"Welcome to MicroPython!\n"
114+
"\n"
115+
"For online help please visit https://micropython.org/help/.\n"
116+
"\n"
117+
"For access to the hardware use the 'machine' module. \n"
118+
"\n"
119+
"Quick overview of some objects:\n"
120+
" machine.Pin(pin) -- get a pin, eg machine.Pin(0)\n"
121+
" machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n"
122+
" methods: init(..), value([v]), high(), low())\n"
123+
"\n"
124+
"Pin IO modes are: Pin.IN, Pin.OUT\n"
125+
"Pin pull modes are: Pin.PULL_UP, Pin.PULL_UP_47K, Pin.PULL_UP_22K, Pin.PULL_DOWN, Pin.PULL_HOLD\n"
126+
"\n"
127+
"Useful control commands:\n"
128+
" CTRL-C -- interrupt a running program\n"
129+
" CTRL-D -- on a blank line, do a soft reset of the board\n"
130+
" CTRL-E -- on a blank line, enter paste mode\n"
131+
"\n"
132+
"For further help on a specific object, type help(obj)\n"
133+
"For a list of available modules, type help('modules')\n"
134+
;

Diff for: ports/mimxrt/mpconfigport.h

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#define MICROPY_ENABLE_GC (1)
4444
#define MICROPY_KBD_EXCEPTION (1)
4545
#define MICROPY_HELPER_REPL (1)
46+
#define MICROPY_REPL_AUTO_INDENT (1)
4647
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
4748
#define MICROPY_ENABLE_SOURCE_LINE (1)
4849
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
@@ -59,6 +60,8 @@
5960
#define MICROPY_PY_BUILTINS_REVERSED (1)
6061
#define MICROPY_PY_BUILTINS_MIN_MAX (0)
6162
#define MICROPY_PY_BUILTINS_HELP (1)
63+
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
64+
#define MICROPY_PY_BUILTINS_HELP_TEXT mimxrt_help_text
6265
#define MICROPY_PY___FILE__ (0)
6366
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
6467
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)

0 commit comments

Comments
 (0)