summaryrefslogtreecommitdiff
path: root/py/builtinimport.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-23 10:59:05 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-23 10:59:05 +0100
commiteaaebf3291a12ff65ca5c7f16e0d486fbde10efa (patch)
treecbfa01bb3b66abb38f367d09754724f19cc64137 /py/builtinimport.c
parent2c180f7ccc456e1768fd1cb9a86399808672a237 (diff)
stmhal: Initialise stack pointer correctly.
Stack is full descending and must be 8-byte aligned. It must start off pointing to just above the last byte of RAM. Previously, stack started pointed to last byte of RAM (eg 0x2001ffff) and so was not 8-byte aligned. This caused a bug in combination with alloca. This patch also updates some debug printing code. Addresses issue #872 (among many other undiscovered issues).
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r--py/builtinimport.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c
index ec29f5237..9bcc07487 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -167,11 +167,11 @@ STATIC void do_load(mp_obj_t module_obj, vstr_t *file) {
mp_obj_t mp_builtin___import__(mp_uint_t n_args, mp_obj_t *args) {
#if DEBUG_PRINT
- printf("__import__:\n");
+ DEBUG_printf("__import__:\n");
for (int i = 0; i < n_args; i++) {
- printf(" ");
+ DEBUG_printf(" ");
mp_obj_print(args[i], PRINT_REPR);
- printf("\n");
+ DEBUG_printf("\n");
}
#endif
@@ -199,9 +199,9 @@ mp_obj_t mp_builtin___import__(mp_uint_t n_args, mp_obj_t *args) {
mp_obj_t this_name_q = mp_obj_dict_get(mp_globals_get(), MP_OBJ_NEW_QSTR(MP_QSTR___name__));
assert(this_name_q != MP_OBJ_NULL);
#if DEBUG_PRINT
- printf("Current module: ");
+ DEBUG_printf("Current module: ");
mp_obj_print(this_name_q, PRINT_REPR);
- printf("\n");
+ DEBUG_printf("\n");
#endif
mp_uint_t this_name_l;