summaryrefslogtreecommitdiff
path: root/teensy
diff options
context:
space:
mode:
Diffstat (limited to 'teensy')
-rw-r--r--teensy/Makefile4
-rw-r--r--teensy/help.c21
-rw-r--r--teensy/lexerfrozen.c4
-rw-r--r--teensy/main.c4
-rw-r--r--teensy/mpconfigport.h8
5 files changed, 11 insertions, 30 deletions
diff --git a/teensy/Makefile b/teensy/Makefile
index ab377dfb2..25de8f2dd 100644
--- a/teensy/Makefile
+++ b/teensy/Makefile
@@ -32,11 +32,10 @@ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float -mfloat
INC += -I.
INC += -I..
INC += -I../stmhal
-INC += -I../lib/mp-readline
INC += -I$(BUILD)
INC += -Icore
-CFLAGS = $(INC) -Wall -Wpointer-arith -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4)
+CFLAGS = $(INC) -Wall -Wpointer-arith -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4)
LDFLAGS = -nostdlib -T mk20dx256.ld -msoft-float -mfloat-abi=soft
ifeq ($(USE_ARDUINO_TOOLCHAIN),1)
@@ -109,7 +108,6 @@ LIB_SRC_C = $(addprefix lib/,\
mp-readline/builtin_input.c \
mp-readline/readline.c \
utils/pyexec.c \
- utils/pyhelp.c \
)
SRC_TEENSY = $(addprefix core/,\
diff --git a/teensy/help.c b/teensy/help.c
index 147347fc2..3b3916b94 100644
--- a/teensy/help.c
+++ b/teensy/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 *teensy_help_text =
"Welcome to MicroPython!\n"
"\n"
"For online help please visit http://micropython.org/help/.\n"
@@ -69,18 +67,3 @@ STATIC const char *help_text =
"\n"
"For further help on a specific object, type help(obj)\n"
;
-
-STATIC mp_obj_t pyb_help(uint 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, pyb_help);
diff --git a/teensy/lexerfrozen.c b/teensy/lexerfrozen.c
index 03ef80087..21e978dc7 100644
--- a/teensy/lexerfrozen.c
+++ b/teensy/lexerfrozen.c
@@ -1,11 +1,13 @@
#include <stdio.h>
#include "py/lexer.h"
+#include "py/runtime.h"
+#include "py/mperrno.h"
mp_import_stat_t mp_import_stat(const char *path) {
return MP_IMPORT_STAT_NO_EXIST;
}
mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
- return NULL;
+ mp_raise_OSError(MP_ENOENT);
}
diff --git a/teensy/main.c b/teensy/main.c
index ba7207fe8..41bbeb5d9 100644
--- a/teensy/main.c
+++ b/teensy/main.c
@@ -3,8 +3,6 @@
#include <string.h>
#include <stdlib.h>
-#include "py/nlr.h"
-#include "py/parse.h"
#include "py/lexer.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
@@ -12,7 +10,7 @@
#include "py/mphal.h"
#include "gccollect.h"
#include "lib/utils/pyexec.h"
-#include "readline.h"
+#include "lib/mp-readline/readline.h"
#include "lexermemzip.h"
#include "Arduino.h"
diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h
index 334f76d8a..de30924d9 100644
--- a/teensy/mpconfigport.h
+++ b/teensy/mpconfigport.h
@@ -14,6 +14,10 @@
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_OPT_COMPUTED_GOTO (1)
+#define MICROPY_PY_BUILTINS_INPUT (1)
+#define MICROPY_PY_BUILTINS_HELP (1)
+#define MICROPY_PY_BUILTINS_HELP_TEXT teensy_help_text
+
#define MICROPY_PY_IO (0)
#define MICROPY_PY_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
@@ -28,8 +32,6 @@
// extra built in names to add to the global namespace
#define MICROPY_PORT_BUILTINS \
- { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
// extra built in modules to add to the list of known ones
extern const struct _mp_obj_module_t os_module;
@@ -52,8 +54,6 @@ extern const struct _mp_obj_module_t time_module;
// type definitions for the specific machine
-#define BYTES_PER_WORD (4)
-
#define UINT_FMT "%u"
#define INT_FMT "%d"