aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/setup.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-28 14:31:56 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-28 14:31:56 +0200
commitbabb6dc29a5c4af60292ffad5216317d13e2a685 (patch)
treed5de3240e0112310c5ffc90ead6935333d5f9f78 /stm32f091/setup.c
parent4cd465332087e4ab12709f28fae55df10e1a1154 (diff)
fix off-by-one error and create macro for switching serial debug print color
Diffstat (limited to 'stm32f091/setup.c')
-rw-r--r--stm32f091/setup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stm32f091/setup.c b/stm32f091/setup.c
index 3bf331f..1591649 100644
--- a/stm32f091/setup.c
+++ b/stm32f091/setup.c
@@ -9,6 +9,7 @@
#include "setup.h"
#include "backlog.h"
#include "server.h"
+#include "util.h"
I2C_HandleTypeDef hi2c1 = {
.Instance = I2C1,
@@ -95,6 +96,12 @@ void ws_io_setup() {
ws_backlog_alloc(24 * 60);
// ws_backlog_alloc(10);
+#ifdef WS_DBG_PRINT_ESP_OVER_USART2
+ ws_dbg_set_usart2_tty_color(7);
+ const char restart_str[] = "\r\n--- stm restart ---\r\n";
+ HAL_UART_Transmit(&huart2, restart_str, strlen(restart_str), 100);
+#endif
+
#ifdef WS_ESP8266_WLAN_MAC
ws_esp8266_set_mac();
#endif