aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'stm32f091/main.c')
-rw-r--r--stm32f091/main.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/stm32f091/main.c b/stm32f091/main.c
index 6d1fb38..68e8dd4 100644
--- a/stm32f091/main.c
+++ b/stm32f091/main.c
@@ -1,30 +1,22 @@
#include <FreeRTOS.h>
#include <task.h>
-#include <stm32f0xx.h>
-#include <stdint.h>
#include <stm32f0xx_hal.h>
-void task_1() {
- uint8_t led = 1;
+#include "main.h"
+#include "setup.h"
+#include "sensor.h"
- while (1) {
- HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, led);
- led ^= 1;
-
- vTaskDelay(1000 / portTICK_RATE_MS);
- }
-}
+I2C_HandleTypeDef hi2c2;
+UART_HandleTypeDef huart2;
int main() {
HAL_Init();
- __HAL_RCC_GPIOA_CLK_ENABLE();
- HAL_GPIO_Init(GPIOA, &(GPIO_InitTypeDef) {
- .Pin = GPIO_PIN_5,
- .Mode = GPIO_MODE_OUTPUT_PP,
- .Pull = GPIO_NOPULL
- });
+ SystemClock_Config();
+ MX_GPIO_Init();
+ MX_USART2_UART_Init();
+ MX_I2C2_Init();
- xTaskCreate(task_1, "task1", 128, NULL, 1, NULL);
+ xTaskCreate(ws_sensor_read_task, "sensor", 128, NULL, 1, NULL);
vTaskStartScheduler();
}