]> mj.ucw.cz Git - home-hw.git/commitdiff
Aircon: Temporary hacks
authorMartin Mares <mj@ucw.cz>
Mon, 15 Jul 2019 22:38:29 +0000 (00:38 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 15 Jul 2019 22:38:29 +0000 (00:38 +0200)
aircon/config.h
aircon/main.c

index 2a577a342ba7f0d0468f305d7b3affbf3cdeb11b..2c40c0b8c1205feabf957966737bc70e99c7f8e7 100644 (file)
@@ -41,5 +41,5 @@
 #define DS_DMA_CH 6
 #define DS_NUM_SENSORS 8
 
-#define DS_DEBUG
+#undef DS_DEBUG
 #undef DS_DEBUG2
index 6bb3528ba6a05acc52b30ac286e454d15229ef6c..13f23a25f5f3296071f8f936246c723a41d29154 100644 (file)
@@ -123,7 +123,10 @@ static void usart_setup(void)
 // TIM4 will run on CPU clock, it will overflow with frequency 38 kHz (IR modulation frequency)
 #define T4_CYCLE ((CPU_CLOCK_MHZ * 1000000 + 37999) / 38000)
 
-#if 0
+// FIXME
+static byte bypass_active;
+static byte pwm;
+
 static void show_temperature(void)
 {
        debug_putc('#');
@@ -139,7 +142,6 @@ static void show_temperature(void)
        debug_printf(" %d", pwm);
        debug_puts("\r\n");
 }
-#endif
 
 static void pwm_init(void)
 {
@@ -177,24 +179,29 @@ int main(void)
        ds_init();
        modbus_init();
 
+       gpio_clear(GPIOB, GPIO0);
+
+#if 0
        for (;;) {
                debug_led_toggle();
 
-               gpio_clear(GPIOB, GPIO0);
-               delay_ms(50);
-               gpio_set(GPIOB, GPIO0);
-               delay_ms(50);
+               //gpio_clear(GPIOB, GPIO0);
+               //delay_ms(50);
+               //gpio_set(GPIOB, GPIO0);
+               delay_ms(100);
 
                modbus_loop();
                ds_step();
        }
+#endif
 
-#if 0
+#if 1
        byte cycles = 0;
        for (;;) {
-               gpio_toggle(GPIOC, GPIO13);
+               debug_led_toggle();
                delay_ms(100);
                ds_step();
+#if 0
                if (usart_get_flag(USART1, USART_SR_RXNE)) {
                        uint ch = usart_recv(USART1);
                        if (ch == 'B') {
@@ -225,6 +232,7 @@ int main(void)
                                timer_set_oc_value(TIM4, TIM_OC1, pwm);
                        }
                }
+#endif
                if (cycles++ >= 50) {
                        cycles = 0;
                        show_temperature();