aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/server.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-29 13:19:24 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-29 13:19:24 +0200
commitf536fb4f92eda7ba5e80230a023b144d373dd86b (patch)
tree94a9c8f0d4f5d1a9e69f008c8728547191db2e94 /stm32f091/server.c
parent7b4dbb553a4d22e88bafc38163d1b2f951c40fde (diff)
garbage delay - esp still too slow!?
Diffstat (limited to 'stm32f091/server.c')
-rw-r--r--stm32f091/server.c18
1 files 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;
}