aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-25 18:08:28 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-25 18:12:54 +0200
commit7a1316483ff8962f581d686f4e812c7ec5a2b6cc (patch)
treea17ac10d556574fc23369736ed6782ebe907f2e4
parent931b357fee219f7d69e3b2e1c5c275413de6010b (diff)
finish merge
-rw-r--r--stm32f091/esp8266.c2
-rw-r--r--stm32f091/main.c9
-rw-r--r--stm32f091/setup.c13
3 files changed, 12 insertions, 12 deletions
diff --git a/stm32f091/esp8266.c b/stm32f091/esp8266.c
index 6a9f254..341f052 100644
--- a/stm32f091/esp8266.c
+++ b/stm32f091/esp8266.c
@@ -34,7 +34,7 @@ void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size){
}
// start DMA again
// memset(g_ws_esp8266_dma_rx_buffer,'\0',g_ws_esp8266_dma_rx_buffer_Size); // clear rx_buff
- HAL_UARTEx_ReceiveToIdle_DMA(&huart1, g_ws_esp8266_dma_rx_buffer, WS_DMA_RX_BUFFER_SIZE);
+ HAL_UART_Receive_DMA(&huart1, (uint8_t*) g_ws_esp8266_dma_rx_buffer, WS_DMA_RX_BUFFER_SIZE);
__HAL_DMA_DISABLE_IT(&hdma_usart1_rx,DMA_IT_HT);
}
diff --git a/stm32f091/main.c b/stm32f091/main.c
index 7cb0718..ed0dacd 100644
--- a/stm32f091/main.c
+++ b/stm32f091/main.c
@@ -5,18 +5,9 @@
#include "main.h"
#include "setup.h"
#include "sensor.h"
-#include "backlog.h"
int main() {
ws_io_setup();
- HAL_GPIO_Init(GPIOA, &(GPIO_InitTypeDef) {
- .Pin = GPIO_PIN_5,
- .Mode = GPIO_MODE_OUTPUT_PP,
- .Pull = GPIO_NOPULL
- });
-
- ws_backlog_alloc(24 * 60);
-
xTaskCreate(ws_sensor_read_task, "sensor", 128, NULL, 1, NULL);
vTaskStartScheduler();
}
diff --git a/stm32f091/setup.c b/stm32f091/setup.c
index 318de5a..63efd37 100644
--- a/stm32f091/setup.c
+++ b/stm32f091/setup.c
@@ -7,6 +7,7 @@
#include "esp8266.h"
#include "setup.h"
+#include "backlog.h"
I2C_HandleTypeDef hi2c1 = {
.Instance = I2C1,
@@ -57,7 +58,7 @@ DMA_HandleTypeDef hdma_usart1_rx = {
.Init.Priority = DMA_PRIORITY_LOW,
};
-DMA_HandleTypeDef hdma_usart1_tx {
+DMA_HandleTypeDef hdma_usart1_tx = {
.Instance = DMA1_Channel2,
.Init.Direction = DMA_MEMORY_TO_PERIPH,
.Init.PeriphInc = DMA_PINC_DISABLE,
@@ -83,6 +84,14 @@ void ws_io_setup() {
ws_io_usart1_setup();
ws_io_usart2_setup();
ws_io_dma_setup();
+
+ HAL_GPIO_Init(GPIOA, &(GPIO_InitTypeDef) {
+ .Pin = GPIO_PIN_5,
+ .Mode = GPIO_MODE_OUTPUT_PP,
+ .Pull = GPIO_NOPULL
+ });
+
+ ws_backlog_alloc(24 * 60);
}
static void ws_io_clock_setup() {
@@ -123,7 +132,7 @@ static void ws_io_usart1_setup() {
if (HAL_UART_Init(&huart1) != HAL_OK)
return ws_setup_error_handler();
- HAL_UARTEx_ReceiveToIdle_DMA(&huart1, g_ws_esp8266_dma_rx_buffer, WS_DMA_RX_BUFFER_SIZE);
+ HAL_UART_Receive_DMA(&huart1, (uint8_t*) g_ws_esp8266_dma_rx_buffer, WS_DMA_RX_BUFFER_SIZE);
__HAL_DMA_DISABLE_IT(&hdma_usart1_rx, DMA_IT_HT);
}