summaryrefslogtreecommitdiffstats
path: root/fw/snake.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/snake.c')
-rw-r--r--fw/snake.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fw/snake.c b/fw/snake.c
index 87989ab..48ee417 100644
--- a/fw/snake.c
+++ b/fw/snake.c
@@ -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) {