Commit 25f44c19 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

cc3200: Re-add support for UART REPL (MICROPY_STDIO_UART setting).

UART REPL support was lost in os.dupterm() refactorings, etc. As
os.dupterm() is there, implement UART REPL support at the high level -
if MICROPY_STDIO_UART is set, make default contain os.dupterm()
call for a UART. This means that changing MICROPY_STDIO_UART value will
also require erasing flash on a module to force re-creation.
parent cf96be60
......@@ -98,7 +98,12 @@ static FATFS *sflash_fatfs;
static const char fresh_main_py[] = "# -- put your code here!\r\n";
static const char fresh_boot_py[] = "# -- run on boot-up\r\n"
"# can run arbitrary Python, but best to keep it minimal\r\n";
"# can run arbitrary Python, but best to keep it minimal\r\n"
"import os, machine\r\n"
"os.dupterm(machine.UART(0, " MP_STRINGIFY(MICROPY_STDIO_UART_BAUD) "))\r\n"
......@@ -46,6 +46,10 @@ typedef unsigned int uint;
#define MAX(x, y) ((x) > (y) ? (x) : (y))
// Classical double-indirection stringification of preprocessor macro's value
#define _MP_STRINGIFY(x) #x
/** memory allocation ******************************************/
// TODO make a lazy m_renew that can increase by a smaller amount than requested (but by at least 1 more element)
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