Commit e79c6696 authored by Damien George's avatar Damien George
Browse files

stmhal: Fix file print methods to use print instead of printf.

Also make stdout_print_strn static (ultimately this function needs to be
merged with stdout_tx_strn).
parent 34ab8dd6
...@@ -70,7 +70,7 @@ typedef struct _pyb_file_obj_t { ...@@ -70,7 +70,7 @@ typedef struct _pyb_file_obj_t {
} pyb_file_obj_t; } pyb_file_obj_t;
void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
printf("<io.%s %p>", mp_obj_get_type_str(self_in), self_in); print(env, "<io.%s %p>", mp_obj_get_type_str(self_in), self_in);
} }
STATIC machine_int_t file_obj_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) { STATIC machine_int_t file_obj_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) {
......
...@@ -195,7 +195,7 @@ int pfenv_printf(const pfenv_t *pfenv, const char *fmt, va_list args) { ...@@ -195,7 +195,7 @@ int pfenv_printf(const pfenv_t *pfenv, const char *fmt, va_list args) {
return chrs; return chrs;
} }
void stdout_print_strn(void *data, const char *str, unsigned int len) { STATIC void stdout_print_strn(void *data, const char *str, unsigned int len) {
// TODO this needs to be replaced with a proper stdio interface ala CPython // TODO this needs to be replaced with a proper stdio interface ala CPython
// send stdout to UART and USB CDC VCP // send stdout to UART and USB CDC VCP
if (pyb_uart_global_debug != PYB_UART_NONE) { if (pyb_uart_global_debug != PYB_UART_NONE) {
......
...@@ -96,7 +96,7 @@ typedef struct _pyb_stdio_obj_t { ...@@ -96,7 +96,7 @@ typedef struct _pyb_stdio_obj_t {
void stdio_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { void stdio_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
pyb_stdio_obj_t *self = self_in; pyb_stdio_obj_t *self = self_in;
printf("<io.FileIO %d>", self->fd); print(env, "<io.FileIO %d>", self->fd);
} }
STATIC machine_int_t stdio_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) { STATIC machine_int_t stdio_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment