From f536fb4f92eda7ba5e80230a023b144d373dd86b Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 29 Oct 2022 13:19:24 +0200 Subject: garbage delay - esp still too slow!? --- stm32f091/server.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/stm32f091/server.c b/stm32f091/server.c index e0c97dc..cc47251 100644 --- a/stm32f091/server.c +++ b/stm32f091/server.c @@ -167,16 +167,18 @@ void ws_server_buffer_send_finish() { } */ #ifdef WS_DBG_PRINT_ESP_OVER_USART2 ws_dbg_set_usart2_tty_color(WS_DBG_TTY_COLOR_TX); - HAL_UART_Transmit(&huart2, g_ws_esp8266_dma_tx_buffer, g_ws_esp8266_dma_tx_buffer_size, 100); #endif - HAL_UART_Transmit(&huart1, g_ws_esp8266_dma_tx_buffer, g_ws_esp8266_dma_tx_buffer_size, 100); - // for (unsigned j = 0; j < 10000; j++) asm("nop"); // esp garbage - // for (unsigned int i = 0; i < g_ws_esp8266_dma_tx_buffer_size; i++) { - // // send as slow as possible because the esp is garbage - // for (unsigned j = 0; j < 1000; j++) asm("nop"); // did i mention the esp is garbage - // HAL_UART_Transmit(&huart1, &g_ws_esp8266_dma_tx_buffer[i], 1, 100); - // } + // HAL_UART_Transmit(&huart1, g_ws_esp8266_dma_tx_buffer, g_ws_esp8266_dma_tx_buffer_size, 100); + for (unsigned j = 0; j < 1000000; j++) asm("nop"); // esp garbage + for (unsigned int i = 0; i < g_ws_esp8266_dma_tx_buffer_size; i++) { + // send as slow as possible because the esp is garbage + for (unsigned j = 0; j < 10000; j++) asm("nop"); // did i mention the esp is garbage + HAL_UART_Transmit(&huart1, &g_ws_esp8266_dma_tx_buffer[i], 1, 100); +#ifdef WS_DBG_PRINT_ESP_OVER_USART2 + HAL_UART_Transmit(&huart2, &g_ws_esp8266_dma_tx_buffer[i], 1, 100); +#endif + } g_ws_esp8266_dma_tx_buffer_size = 0; } -- cgit v1.2.3