mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
emulation on host: avoid closing STDIN (#8577)
- avoid closing STDIN - less verbose during compilation - better handling user directories - missing str{,n}case_P declarations
This commit is contained in:
@ -115,8 +115,14 @@ static int mock_stop_uart(void)
|
||||
|
||||
static uint8_t mock_read_uart(void)
|
||||
{
|
||||
uint8_t ch = 0;
|
||||
return (read(STDIN, &ch, 1) == 1) ? ch : 0;
|
||||
uint8_t ch = 0;
|
||||
int ret = read(STDIN, &ch, 1);
|
||||
if (ret == -1)
|
||||
{
|
||||
perror("read(STDIN,1)");
|
||||
return 0;
|
||||
}
|
||||
return (ret == 1) ? ch : 0;
|
||||
}
|
||||
|
||||
void help(const char* argv0, int exitcode)
|
||||
|
Reference in New Issue
Block a user