diff BootLoader/Src/base_bootlader.c @ 872:5e027b0f7475 Evo_2_23

Added first time initialization for new bluetooth module: The serial numbers are not defined when the electonic is connected to power for the first time. This event is used to run a initialization sequence which sets the defaults for the bluetooth modul. At the end the module may be accessed using a default name.
author Ideenmodellierer
date Wed, 14 Aug 2024 14:41:04 +0200
parents 4e10a3e087a1
children f012fcd7f465
line wrap: on
line diff
--- a/BootLoader/Src/base_bootlader.c	Mon Aug 12 22:25:46 2024 +0200
+++ b/BootLoader/Src/base_bootlader.c	Wed Aug 14 14:41:04 2024 +0200
@@ -513,9 +513,6 @@
 	if((i == 0) && (callForUpdate == 0))
 		firmware_JumpTo_Application();
 
-
-
-	MX_Bluetooth_PowerOn();
 	MX_SPI_Init();
 	SDRAM_Config();
 	HAL_Delay(100);
@@ -707,19 +704,26 @@
 	textVersion[ptr++] = '\020';
 	textVersion[ptr] = 0;
 
+	TIM_init();
+	MX_UART_Init();
+	MX_Bluetooth_PowerOn();
+	tComm_init();
+
 	tInfo_button_text("Exit","","Sleep");
 	tInfo_newpage("Bootloader 240812");
 	tInfo_write("start bluetooth");
 	tInfo_write("");
 	tInfo_write(textVersion);
-	tInfo_write("");
-
-	TIM_init();
-	MX_UART_Init();
-	MX_Bluetooth_PowerOn();
-	tComm_Set_Bluetooth_Name(0);
-	tComm_init();
-	tComm_StartBlueModConfig();
+	if(tComm_Set_Bluetooth_Name(0) == 0xFF)
+	{
+		tInfo_write("Init bluetooth");
+		tComm_StartBlueModBaseInit();
+	}
+	else
+	{
+		tInfo_write("");
+		tComm_StartBlueModConfig();
+	}
 
 	set_globalState_Base();