summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/modpyb.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-20 13:57:43 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-20 13:57:43 +0100
commit951ed9d02ffc826c68ee3af26c3530477e7e6156 (patch)
treeeb70f46b030031c8601d71d575e36771cf6c5564 /stmhal/modpyb.c
parent1163cb9cb5e48153d1a6d723e8577d8ec3821692 (diff)
downloadmicropython-951ed9d02ffc826c68ee3af26c3530477e7e6156.tar.gz
micropython-951ed9d02ffc826c68ee3af26c3530477e7e6156.zip
stmhal: Fix REPL printing by cooking output sent to stdout_obj.
Recent changes to builtin print meant that print was printing to the mp_sys_stdout_obj, which was sending data raw to the USB CDC device. The data should be cooked so that \n turns into \r\n.
Diffstat (limited to 'stmhal/modpyb.c')
-rw-r--r--stmhal/modpyb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c
index 8b594332b7..38a680da24 100644
--- a/stmhal/modpyb.c
+++ b/stmhal/modpyb.c
@@ -37,7 +37,6 @@
#include "gc.h"
#include "gccollect.h"
#include "systick.h"
-#include "pybstdio.h"
#include "pyexec.h"
#include "led.h"
#include "pin.h"
@@ -57,6 +56,7 @@
#include "dac.h"
#include "lcd.h"
#include "usb.h"
+#include "pybstdio.h"
#include "ff.h"
#include "portmodules.h"
@@ -307,16 +307,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_have_cdc_obj, pyb_have_cdc);
/// Get or set the UART object that the REPL is repeated on.
STATIC mp_obj_t pyb_repl_uart(uint n_args, const mp_obj_t *args) {
if (n_args == 0) {
- if (pyb_uart_global_debug == NULL) {
+ if (pyb_stdio_uart == NULL) {
return mp_const_none;
} else {
- return pyb_uart_global_debug;
+ return pyb_stdio_uart;
}
} else {
if (args[0] == mp_const_none) {
- pyb_uart_global_debug = NULL;
+ pyb_stdio_uart = NULL;
} else if (mp_obj_get_type(args[0]) == &pyb_uart_type) {
- pyb_uart_global_debug = args[0];
+ pyb_stdio_uart = args[0];
} else {
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "need a UART object"));
}