]> mj.ucw.cz Git - home-hw.git/blobdiff - aircon/firmware/main.c
Auto: Meditation mode turned off
[home-hw.git] / aircon / firmware / main.c
index 737aafb97110b552cc7c0802898b4dd29ec86ab7..da9df476d2e6403e1fc47cf0d726e2e5f47285d1 100644 (file)
@@ -198,6 +198,7 @@ int main(void)
 
                modbus_loop();
 
+#if 0
                if (usart_get_flag(USART1, USART_SR_RXNE)) {
                        uint ch = usart_recv(USART1);
                        if (ch == 'B') {
@@ -230,6 +231,7 @@ int main(void)
                                rc_send(ch);
                        }
                }
+#endif
 
                if (ms_ticks - last_show_temp >= 5000) {
                        show_temperature();
@@ -347,13 +349,15 @@ static bool rc_send(char key)
 {
        if (rc_pending)
                return false;
+       if (!key)
+               return false;
 
        const char *s = strchr(rc_keys, key);
        if (!s)
                return false;
        rc_pending = key;
        rc_pattern_pos = rc_patterns[s - rc_keys];
-       debug_printf("RC sending: %c", key);
+       debug_printf("RC sending: %c\n", key);
 
        gpio_clear(GPIOC, GPIO13);