mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
emulation on host: Add full UART driver emulation. (#5785)
* emulation on host: Add full UART driver emulation. This PR replaces the high level Serial mock with a more complete UART driver. This way the HardwareSerial works without any modifications. Additionally the driver supports UART0 and UART1 at the same time (UART0 is directed to stdout and UART1 writes to stderr). RX is implemented by switching the terminal into raw non-blocking mode and injecting each key-press directly into the FIFO of UART0. A new command line switch -c was added to ignore CTRL-C and send it via serial as well. The decumentation was updated accordingly. Reading and setting of GPIOs does only write to stderr, when compiled with D=1. But this is subject to be replaced with a proper GPIO emu anyway. Reading from GPIO0 now returns 1 instead of 0 because this is most likely a low active input. * Fixed unused variable. * Remove unused functions, as long as there are no debug macros using them. * Move user_interface.cc from MOCK_CPP_FILES_EMU to MOCK_CPP_FILES. * Move optimistic_yield() from user_interface.cpp to Arduino.cpp * Remove atexit() weak declaration (fixes segfault when calling atexit). * Improve resetting of terminal after program exit, convert \r to \r\n. * Show error, when STDOUT is not a TTY, minor code cleanung.
This commit is contained in:
committed by
david gauchard
parent
53f51b5811
commit
ef44211eea
@ -434,11 +434,6 @@ void esp_schedule (void)
|
||||
{
|
||||
}
|
||||
|
||||
void optimistic_yield (uint32_t interval_us)
|
||||
{
|
||||
usleep(interval_us);
|
||||
}
|
||||
|
||||
void dns_setserver (u8_t numdns, ip_addr_t *dnsserver)
|
||||
{
|
||||
(void)numdns;
|
||||
|
Reference in New Issue
Block a user