diff options
Diffstat (limited to 'py/nativeglue.c')
-rw-r--r-- | py/nativeglue.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c index 3220996f95..cc0d61ce96 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -34,14 +34,14 @@ #include "py/emitglue.h" #include "py/bc.h" -#if MICROPY_EMIT_NATIVE - #if 0 // print debugging info #define DEBUG_printf DEBUG_printf #else // don't print debugging info #define DEBUG_printf(...) (void)0 #endif +#if MICROPY_EMIT_NATIVE + // convert a Micro Python object to a valid native value based on type mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) { DEBUG_printf("mp_convert_obj_to_native(%p, " UINT_FMT ")\n", obj, type); @@ -61,6 +61,10 @@ mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) { } } +#endif + +#if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_THUMB + // convert a native value to a Micro Python object based on type mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) { DEBUG_printf("mp_convert_native_to_obj(" UINT_FMT ", " UINT_FMT ")\n", val, type); @@ -73,6 +77,10 @@ mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) { } } +#endif + +#if MICROPY_EMIT_NATIVE + // wrapper that accepts n_args and n_kw in one argument // (native emitter can only pass at most 3 arguments to a function) mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, mp_uint_t n_args_kw, const mp_obj_t *args) { |