1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

device tests: some of them can be run on host (#6912)

* device tests: mock scripts + rename some tests to enable mock-testing them

* move symbol
This commit is contained in:
david gauchard
2019-12-16 19:20:07 +01:00
committed by GitHub
parent d1237fd016
commit d40dbb4584
16 changed files with 41 additions and 6 deletions

View File

@ -39,6 +39,8 @@
extern "C" {
bool blocking_uart = true; // system default
static int s_uart_debug_nr = UART1;
static uart_t *UART[2] = { NULL, NULL };
@ -190,6 +192,13 @@ uart_read(uart_t* uart, char* userbuffer, size_t usersize)
if(uart == NULL || !uart->rx_enabled)
return 0;
if (!blocking_uart)
{
char c;
if (read(0, &c, 1) == 1)
uart_new_data(0, c);
}
size_t ret = 0;
while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
{