From caac542b235003f7b79d7aa23eaebe8f2c772508 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 25 Mar 2014 14:18:18 +0000 Subject: Proper support for registering builtin modules in ROM. Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch]. --- stm/main.c | 3 ++- stm/pybmodule.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'stm') diff --git a/stm/main.c b/stm/main.c index 6ad311127..44be4d348 100644 --- a/stm/main.c +++ b/stm/main.c @@ -24,6 +24,7 @@ #include "lexerfatfs.h" #include "parse.h" #include "obj.h" +#include "objmodule.h" #include "parsehelper.h" #include "compile.h" #include "runtime0.h" @@ -273,7 +274,7 @@ soft_reset: rt_store_name(MP_QSTR_open, rt_make_function_n(2, pyb_io_open)); // load the pyb module - mp_obj_module_register(MP_QSTR_pyb, (mp_obj_t)&pyb_module); + mp_module_register(MP_QSTR_pyb, (mp_obj_t)&pyb_module); // check if user switch held (initiates reset of filesystem) bool reset_filesystem = false; diff --git a/stm/pybmodule.c b/stm/pybmodule.c index ed705af73..fde61b513 100644 --- a/stm/pybmodule.c +++ b/stm/pybmodule.c @@ -181,7 +181,8 @@ STATIC mp_obj_t pyb_standby(void) { MP_DEFINE_CONST_FUN_OBJ_0(pyb_standby_obj, pyb_standby); STATIC mp_obj_t pyb_hid_send_report(mp_obj_t arg) { - mp_obj_t *items = mp_obj_get_array_fixed_n(arg, 4); + mp_obj_t *items; + mp_obj_get_array_fixed_n(arg, 4, &items); uint8_t data[4]; data[0] = mp_obj_get_int(items[0]); data[1] = mp_obj_get_int(items[1]); -- cgit v1.2.3