diff options
Diffstat (limited to 'fw')
| -rw-r--r-- | fw/snake.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -43,7 +43,7 @@ static void uart_puts(const char *s) { } static uint8_t uart_recv(void) { - if (UART_STATUS & 0x02) + if (UART_STATUS & 0x02) // empty return 0; return UART_RX; } @@ -53,7 +53,7 @@ static uint8_t uart_recv(void) { * Never blocks, so a stray ESC can't freeze the game. */ static void handle_input(void) { uint8_t c; - while (1) { + for (int i = 0; i < 5; i++) { c = uart_recv(); if (c == 0) return; switch (input_state) { |
