]> mj.ucw.cz Git - home-hw.git/blobdiff - Src/main.c
More I2C debugging
[home-hw.git] / Src / main.c
index e2769f28a80d9b21d157df368d6bc03692020fb1..7b5b75d0e3921e514183d9feb8bd79c6cdc78492 100644 (file)
@@ -123,7 +123,7 @@ int main(void)
   MX_USB_PCD_Init();
   MX_TIM4_Init();
   /* USER CODE BEGIN 2 */
-  display_init();
+  //display_init();
   usb_start(&usb);
   bmp_init();
 
@@ -131,10 +131,12 @@ int main(void)
   LL_TIM_EnableIT_UPDATE(TIM4);
   LL_TIM_GenerateEvent_UPDATE(TIM4);
 
+#if 0
   {
     byte buf[5] = { 0xff, 0xff, 10, 0xff, 0xff };
     display_buffer(buf);
   }
+#endif
 
   /* USER CODE END 2 */
 
@@ -144,7 +146,14 @@ int main(void)
   {
     if (rx_packet_state == 1 && !tx_packet_state)
       {
-       display_buffer(rx_packet);
+    static byte led_state;
+    if (led_state)
+      LL_GPIO_SetOutputPin(LED_GPIO_Port, LED_Pin);
+    else
+      LL_GPIO_ResetOutputPin(LED_GPIO_Port, LED_Pin);
+    led_state ^= 1;
+
+       // display_buffer(rx_packet);
        tx_packet_state = 1;
        tx_packet[0] = adjusted_temp >> 8;
        tx_packet[1] = adjusted_temp & 0xff;
@@ -160,13 +169,6 @@ int main(void)
     // debug_printf("Counter = %d\n", cnt);
     // display_counter(cnt);
 
-    static byte led_state;
-    if (led_state)
-      LL_GPIO_SetOutputPin(LED_GPIO_Port, LED_Pin);
-    else
-      LL_GPIO_ResetOutputPin(LED_GPIO_Port, LED_Pin);
-    led_state ^= 1;
-
     __WFI();
 
   /* USER CODE END WHILE */