diff options
Diffstat (limited to 'pic16bit')
-rw-r--r-- | pic16bit/modpybled.c | 4 | ||||
-rw-r--r-- | pic16bit/modpybswitch.c | 4 | ||||
-rw-r--r-- | pic16bit/mpconfigport.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/pic16bit/modpybled.c b/pic16bit/modpybled.c index c44bb1d243..1610dc5680 100644 --- a/pic16bit/modpybled.c +++ b/pic16bit/modpybled.c @@ -41,9 +41,9 @@ STATIC const pyb_led_obj_t pyb_led_obj[] = { #define NUM_LED MP_ARRAY_SIZE(pyb_led_obj) #define LED_ID(obj) ((obj) - &pyb_led_obj[0] + 1) -void pyb_led_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { +void pyb_led_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_led_obj_t *self = self_in; - print(env, "LED(%u)", LED_ID(self)); + mp_printf(print, "LED(%u)", LED_ID(self)); } STATIC mp_obj_t pyb_led_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { diff --git a/pic16bit/modpybswitch.c b/pic16bit/modpybswitch.c index f5047b78f4..901e478cc9 100644 --- a/pic16bit/modpybswitch.c +++ b/pic16bit/modpybswitch.c @@ -40,9 +40,9 @@ STATIC const pyb_switch_obj_t pyb_switch_obj[] = { #define NUM_SWITCH MP_ARRAY_SIZE(pyb_switch_obj) #define SWITCH_ID(obj) ((obj) - &pyb_switch_obj[0] + 1) -void pyb_switch_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { +void pyb_switch_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { pyb_switch_obj_t *self = self_in; - print(env, "Switch(%u)", SWITCH_ID(self)); + mp_printf(print, "Switch(%u)", SWITCH_ID(self)); } STATIC mp_obj_t pyb_switch_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { diff --git a/pic16bit/mpconfigport.h b/pic16bit/mpconfigport.h index 06ed6669ea..d58401a905 100644 --- a/pic16bit/mpconfigport.h +++ b/pic16bit/mpconfigport.h @@ -86,6 +86,9 @@ typedef void *machine_ptr_t; // must be pointer size typedef const void *machine_const_ptr_t; // must be pointer size typedef int mp_off_t; +void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len); +#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len) + // extra builtin names to add to the global namespace extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj; #define MICROPY_PORT_BUILTINS \ |