From 4db0527c16502103e04c4091dbd803c55538b52f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 4 Sep 2022 18:08:36 +0200 Subject: read/write doeas not block when uart is disabled --- fw/fe310/bsp/gloss/sys_read.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fw/fe310/bsp/gloss/sys_read.c') diff --git a/fw/fe310/bsp/gloss/sys_read.c b/fw/fe310/bsp/gloss/sys_read.c index 1857fc6..cc14f2a 100644 --- a/fw/fe310/bsp/gloss/sys_read.c +++ b/fw/fe310/bsp/gloss/sys_read.c @@ -4,11 +4,13 @@ #include "platform.h" +#include "soc/uart.h" + /* Read from a file. */ ssize_t _read(int fd, void *ptr, size_t len) { - if (fd != STDIN_FILENO) { + if ((fd != STDIN_FILENO) || !eos_uart_enabled()) { errno = ENOSYS; return -1; } -- cgit v1.2.3