diff options
Diffstat (limited to 'bare-arm')
| -rw-r--r-- | bare-arm/Makefile | 2 | ||||
| -rw-r--r-- | bare-arm/main.c | 10 | ||||
| -rw-r--r-- | bare-arm/mpconfigport.h | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/bare-arm/Makefile b/bare-arm/Makefile index a57ccfd19..cfd427c60 100644 --- a/bare-arm/Makefile +++ b/bare-arm/Makefile @@ -13,7 +13,7 @@ INC += -I.. INC += -I$(BUILD) CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion -CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT) +CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT) #Debugging/Optimization ifeq ($(DEBUG), 1) diff --git a/bare-arm/main.c b/bare-arm/main.c index e6ce06398..938414dfe 100644 --- a/bare-arm/main.c +++ b/bare-arm/main.c @@ -6,15 +6,12 @@ #include "py/compile.h" #include "py/runtime.h" #include "py/repl.h" +#include "py/mperrno.h" void do_str(const char *src, mp_parse_input_kind_t input_kind) { - mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); - if (lex == NULL) { - return; - } - nlr_buf_t nlr; if (nlr_push(&nlr) == 0) { + mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); qstr source_name = lex->source_name; mp_parse_tree_t parse_tree = mp_parse(lex, input_kind); mp_obj_t module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, true); @@ -35,7 +32,7 @@ int main(int argc, char **argv) { } mp_lexer_t *mp_lexer_new_from_file(const char *filename) { - return NULL; + mp_raise_OSError(MP_ENOENT); } mp_import_stat_t mp_import_stat(const char *path) { @@ -48,6 +45,7 @@ mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open); void nlr_jump_fail(void *val) { + while (1); } void NORETURN __fatal_error(const char *msg) { diff --git a/bare-arm/mpconfigport.h b/bare-arm/mpconfigport.h index 912fae66f..97e866bdb 100644 --- a/bare-arm/mpconfigport.h +++ b/bare-arm/mpconfigport.h @@ -46,8 +46,6 @@ // type definitions for the specific machine -#define BYTES_PER_WORD (4) - #define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1)) #define UINT_FMT "%lu" |
