summaryrefslogtreecommitdiff
path: root/supervisor/shared/serial.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-01-31 16:03:51 -0500
committerGitHub <noreply@github.com>2019-01-31 16:03:51 -0500
commit7c443fbef2b92bfdd382db9aeaddcdcecbc02cd0 (patch)
tree93c06f6ba863e234148555f41042b354286cb52e /supervisor/shared/serial.c
parent63d456127b783efb376bd2b25598cc9e7f9dceb6 (diff)
parentd72cd5b2d6cbc95665c41a43d6d914e71ac58017 (diff)
Merge pull request #1510 from tannewt/terminalio
Add a terminal that shows by default on displays.
Diffstat (limited to 'supervisor/shared/serial.c')
-rw-r--r--supervisor/shared/serial.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c
index c57688ddc..ed210416f 100644
--- a/supervisor/shared/serial.c
+++ b/supervisor/shared/serial.c
@@ -26,6 +26,10 @@
#include <string.h>
+#include "py/mpconfig.h"
+
+#include "supervisor/shared/display.h"
+#include "shared-bindings/terminalio/Terminal.h"
#include "supervisor/serial.h"
#include "supervisor/usb.h"
@@ -48,6 +52,10 @@ bool serial_bytes_available(void) {
}
void serial_write_substring(const char* text, uint32_t length) {
+ #if CIRCUITPY_DISPLAYIO
+ int errcode;
+ common_hal_terminalio_terminal_write(&supervisor_terminal, (const uint8_t*) text, length, &errcode);
+ #endif
if (!tud_cdc_connected()) {
return;
}