]> mj.ucw.cz Git - home-hw.git/commitdiff
Aircon: Do not crash on receiving 0x00 on debug USART
authorMartin Mares <mj@ucw.cz>
Sun, 10 Nov 2019 15:18:19 +0000 (16:18 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 10 Nov 2019 15:18:19 +0000 (16:18 +0100)
This happens during initialization if the debug port is not connected.

aircon/firmware/main.c

index c43012162caa840a9e01da1c7958b17017bc8fcb..129ac71fbe8e35e5ceb66e5ee001369b7aa6a063 100644 (file)
@@ -347,6 +347,8 @@ static bool rc_send(char key)
 {
        if (rc_pending)
                return false;
+       if (!key)
+               return false;
 
        const char *s = strchr(rc_keys, key);
        if (!s)