comparison Discovery/Src/tComm.c @ 893:1b05a84f6d0f Evo_2_23 tip

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 d398ecc7d103
children
comparison
equal deleted inserted replaced
892:0e084e5554a8 893:1b05a84f6d0f
2191 break; 2191 break;
2192 case BM_CONFIG_ESCAPE_DELAY: sprintf(TxBuffer,"ATS12=10\r"); 2192 case BM_CONFIG_ESCAPE_DELAY: sprintf(TxBuffer,"ATS12=10\r");
2193 break; 2193 break;
2194 case BM_CONFIG_SIGNAL_POLL: sprintf(TxBuffer,"AT+BSTPOLL=100\r"); 2194 case BM_CONFIG_SIGNAL_POLL: sprintf(TxBuffer,"AT+BSTPOLL=100\r");
2195 break; 2195 break;
2196 case BM_CONFIG_BAUD: sprintf(TxBuffer,"AT%%B22\r"); 2196 case BM_CONFIG_BAUD:
2197 #ifdef ENABLE_FAST_COMM
2198 sprintf(TxBuffer,"AT%%B22\r");
2199 #else
2200 BmTmpConfig++;
2201 #endif
2197 break; 2202 break;
2198 case BM_CONFIG_RETRY: ConfigRetryCnt--; 2203 case BM_CONFIG_RETRY: ConfigRetryCnt--;
2199 HAL_Delay(1); 2204 HAL_Delay(1);
2200 if(ConfigRetryCnt == 0) 2205 if(ConfigRetryCnt == 0)
2201 { 2206 {
2258 HAL_UART_DeInit(&UartHandle); 2263 HAL_UART_DeInit(&UartHandle);
2259 HAL_Delay(1); 2264 HAL_Delay(1);
2260 UartHandle.Init.BaudRate = 460800; 2265 UartHandle.Init.BaudRate = 460800;
2261 HAL_UART_Init(&UartHandle); 2266 HAL_UART_Init(&UartHandle);
2262 } 2267 }
2263 if((BmTmpConfig == BM_CONFIG_BAUD) && (result == HAL_OK) && (UartHandle.Init.BaudRate == 460800)) /* This shut not happen because default speed is 115200 => update module configuration */ 2268 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 */
2264 { 2269 {
2265 sprintf(TxBuffer,"AT%%B8\r"); /* set default baudrate */ 2270 sprintf(TxBuffer,"AT%%B8\r"); /* set default baudrate */
2266 CmdSize = strlen(TxBuffer); 2271 CmdSize = strlen(TxBuffer);
2267 HAL_UART_Transmit(&UartHandle, (uint8_t*)TxBuffer,CmdSize, 2000); 2272 HAL_UART_Transmit(&UartHandle, (uint8_t*)TxBuffer,CmdSize, 2000);
2268 HAL_UART_DeInit(&UartHandle); 2273 HAL_UART_DeInit(&UartHandle);