aboutsummaryrefslogtreecommitdiff
path: root/ports/minimal
diff options
context:
space:
mode:
authorDavid Lechner2020-03-21 17:19:49 -0500
committerDamien George2020-03-25 00:59:05 +1100
commit3b07736b6d4d6c8110e487b0001661f9251b5016 (patch)
tree218755bc398bc2762ea3666f6517fc63b0fcf8c5 /ports/minimal
parent100012bec6e8103fcf4aa429dfe1bd801301d642 (diff)
unix,windows: Use STDIN_FILENO, STDOUT_FILENO macros where appropriate.
This replaces 0 and 1 with STDIN_FILENO and STDOUT_FILENO to make the intention of the code clearer.
Diffstat (limited to 'ports/minimal')
-rw-r--r--ports/minimal/uart_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/minimal/uart_core.c b/ports/minimal/uart_core.c
index 5b3797d2e..c7af24404 100644
--- a/ports/minimal/uart_core.c
+++ b/ports/minimal/uart_core.c
@@ -17,7 +17,7 @@ typedef struct {
int mp_hal_stdin_rx_chr(void) {
unsigned char c = 0;
#if MICROPY_MIN_USE_STDOUT
- int r = read(0, &c, 1);
+ int r = read(STDIN_FILENO, &c, 1);
(void)r;
#elif MICROPY_MIN_USE_STM32_MCU
// wait for RXNE
@@ -31,7 +31,7 @@ int mp_hal_stdin_rx_chr(void) {
// Send string of given length
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
#if MICROPY_MIN_USE_STDOUT
- int r = write(1, str, len);
+ int r = write(STDOUT_FILENO, str, len);
(void)r;
#elif MICROPY_MIN_USE_STM32_MCU
while (len--) {