]> mj.ucw.cz Git - home-hw.git/blobdiff - Src/main.c
Display on I2C2 (not working)
[home-hw.git] / Src / main.c
index 1810399209057f4e002d6337bc2436feb19391c8..241e3f5639dc0d56184f0e18edd20f7e12b53663 100644 (file)
@@ -41,6 +41,7 @@
 #include "main.h"
 #include "stm32f1xx_hal.h"
 #include "usb.h"
+#include "app.h"
 
 /* USER CODE BEGIN Includes */
 
@@ -118,6 +119,7 @@ int main(void)
   MX_I2C2_Init();
   MX_USB_PCD_Init();
   /* USER CODE BEGIN 2 */
+  display_init();
   usb_start(&usb);
 
   /* USER CODE END 2 */
@@ -127,11 +129,13 @@ int main(void)
   int cnt = 0;
   while (1)
   {
+    debug_printf("Counter = %d\n", cnt);
+    display_counter(cnt);
     LL_GPIO_SetOutputPin(LED_GPIO_Port, LED_Pin);
     LL_mDelay(500);
     LL_GPIO_ResetOutputPin(LED_GPIO_Port, LED_Pin);
     LL_mDelay(500);
-    debug_printf("Counter = %d\n", cnt++);
+    cnt++;
 
   /* USER CODE END WHILE */
 
@@ -261,7 +265,7 @@ static void MX_I2C2_Init(void)
     /**I2C Initialization 
     */
   I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C;
-  I2C_InitStruct.ClockSpeed = 400000;
+  I2C_InitStruct.ClockSpeed = 100000;
   I2C_InitStruct.DutyCycle = LL_I2C_DUTYCYCLE_2;
   I2C_InitStruct.OwnAddress1 = 0;
   I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK;