aboutsummaryrefslogtreecommitdiff
path: root/stmhal
diff options
context:
space:
mode:
authorDamien George2014-04-05 22:36:42 +0100
committerDamien George2014-04-05 22:36:42 +0100
commit7efc5b3f346869cd4177760e6a6b2bb863b425da (patch)
tree04fbe840f20ab84bee79d28882601812279c8718 /stmhal
parent8b0535e23fb1c646103a060a4ae17e9ee6d5e887 (diff)
py: Make globals and locals proper dictionary objects.
Finishes addressing issue #424. In the end this was a very neat refactor that now makes things a lot more consistent across the py code base. It allowed some simplifications in certain places, now that everything is a dict object. Also converted builtins tables to dictionaries. This will be useful when we need to turn builtins into a proper module.
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/mpconfigport.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h
index 0bb11cae5..08ba923e4 100644
--- a/stmhal/mpconfigport.h
+++ b/stmhal/mpconfigport.h
@@ -24,18 +24,18 @@ extern const struct _mp_obj_fun_native_t mp_builtin_help_obj;
extern const struct _mp_obj_fun_native_t mp_builtin_input_obj;
extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
#define MICROPY_EXTRA_BUILTINS \
- { MP_QSTR_help, (mp_obj_t)&mp_builtin_help_obj }, \
- { MP_QSTR_input, (mp_obj_t)&mp_builtin_input_obj }, \
- { MP_QSTR_open, (mp_obj_t)&mp_builtin_open_obj },
+ { 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 }, \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
// extra built in modules to add to the list of known ones
extern const struct _mp_obj_module_t os_module;
extern const struct _mp_obj_module_t pyb_module;
extern const struct _mp_obj_module_t time_module;
#define MICROPY_EXTRA_BUILTIN_MODULES \
- { MP_QSTR_os, (mp_obj_t)&os_module }, \
- { MP_QSTR_pyb, (mp_obj_t)&pyb_module }, \
- { MP_QSTR_time, (mp_obj_t)&time_module }, \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module }, \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_pyb), (mp_obj_t)&pyb_module }, \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
// type definitions for the specific machine