From 4574580af3688f5eaa85d58783e34a616438eeaa Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 16 Jul 2019 00:38:29 +0200 Subject: [PATCH] Aircon: Temporary hacks --- aircon/config.h | 2 +- aircon/main.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/aircon/config.h b/aircon/config.h index 2a577a3..2c40c0b 100644 --- a/aircon/config.h +++ b/aircon/config.h @@ -41,5 +41,5 @@ #define DS_DMA_CH 6 #define DS_NUM_SENSORS 8 -#define DS_DEBUG +#undef DS_DEBUG #undef DS_DEBUG2 diff --git a/aircon/main.c b/aircon/main.c index 6bb3528..13f23a2 100644 --- a/aircon/main.c +++ b/aircon/main.c @@ -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(); -- 2.39.2