changeset 893:1b05a84f6d0f Evo_2_23

Reenabled fast communication: The communication may be improved with regard to speed by increasing the baud rate between bluetooth module and CPU. This may now be activated using a compile switch.
author Ideenmodellierer
date Wed, 11 Sep 2024 22:32:05 +0200
parents 0e084e5554a8
children 94535e672583
files Common/Inc/configuration.h Discovery/Src/tComm.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/configuration.h	Tue Sep 10 21:18:36 2024 +0200
+++ b/Common/Inc/configuration.h	Wed Sep 11 22:32:05 2024 +0200
@@ -81,4 +81,7 @@
 /* Enable if the menu item predive check shall be available */
 /* #define ENABLE_PREDIVE_CHECK */
 
+/* Enable to have a faster transfer speed between bluetooth module and CPU */
+#define ENABLE_FAST_COMM
+
 #endif
--- a/Discovery/Src/tComm.c	Tue Sep 10 21:18:36 2024 +0200
+++ b/Discovery/Src/tComm.c	Wed Sep 11 22:32:05 2024 +0200
@@ -2193,7 +2193,12 @@
 			break;
 		case BM_CONFIG_SIGNAL_POLL:		sprintf(TxBuffer,"AT+BSTPOLL=100\r");
 			break;
-		case BM_CONFIG_BAUD:			sprintf(TxBuffer,"AT%%B22\r");
+		case BM_CONFIG_BAUD:
+#ifdef ENABLE_FAST_COMM
+										sprintf(TxBuffer,"AT%%B22\r");
+#else
+										BmTmpConfig++;
+#endif
 			break;
 		case BM_CONFIG_RETRY:			ConfigRetryCnt--;
 										HAL_Delay(1);
@@ -2260,7 +2265,7 @@
 				UartHandle.Init.BaudRate   = 460800;
 				HAL_UART_Init(&UartHandle);
 			}
-			if((BmTmpConfig == BM_CONFIG_BAUD) && (result == HAL_OK) && (UartHandle.Init.BaudRate == 460800)) /* This shut not happen because default speed is 115200 => update module configuration */
+			else if((BmTmpConfig == BM_CONFIG_BAUD) && (result == HAL_OK) && (UartHandle.Init.BaudRate == 460800)) /* This shut not happen because default speed is 115200 => update module configuration */
 			{
 				sprintf(TxBuffer,"AT%%B8\r");	/* set default baudrate */
 				CmdSize = strlen(TxBuffer);