- gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
+ gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
+
+ usart_set_baudrate(USART1, 115200);
+ usart_set_databits(USART1, 8);
+ usart_set_stopbits(USART1, USART_STOPBITS_1);
+ usart_set_mode(USART1, USART_MODE_TX_RX);
+ usart_set_parity(USART1, USART_PARITY_NONE);
+ usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);
+
+ usart_enable(USART1);
+}
+
+static bool bypass_active;
+static byte pwm;
+
+static void show_temperature(void)
+{
+ debug_putc('#');
+ for (uint i=0; ds_sensors[i].address[0]; i++) {
+ debug_putc(' ');
+ int t = ds_sensors[i].current_temp;
+ if (t == DS_TEMP_UNKNOWN)
+ debug_puts("---.---");
+ else
+ debug_printf("%3d.%03d", t / 1000, t % 1000);
+ }
+ debug_printf(" %d", bypass_active);
+ debug_printf(" %d", pwm);
+ debug_puts("\r\n");
+}