aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'stm32f091/main.c')
-rw-r--r--stm32f091/main.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/stm32f091/main.c b/stm32f091/main.c
index 6d1fb38..9235f1b 100644
--- a/stm32f091/main.c
+++ b/stm32f091/main.c
@@ -1,30 +1,23 @@
#include <FreeRTOS.h>
#include <task.h>
-#include <stm32f0xx.h>
-#include <stdint.h>
#include <stm32f0xx_hal.h>
-void task_1() {
- uint8_t led = 1;
-
- while (1) {
- HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, led);
- led ^= 1;
-
- vTaskDelay(1000 / portTICK_RATE_MS);
- }
-}
+#include "main.h"
+#include "setup.h"
+#include "sensor.h"
+#include "backlog.h"
int main() {
- HAL_Init();
- __HAL_RCC_GPIOA_CLK_ENABLE();
-
+ ws_io_setup();
HAL_GPIO_Init(GPIOA, &(GPIO_InitTypeDef) {
.Pin = GPIO_PIN_5,
.Mode = GPIO_MODE_OUTPUT_PP,
.Pull = GPIO_NOPULL
});
- xTaskCreate(task_1, "task1", 128, NULL, 1, NULL);
+ ws_backlog_alloc(24 * 60);
+ ws_sensor_read();
+
+ xTaskCreate(ws_sensor_read_task, "sensor", 128, NULL, 1, NULL);
vTaskStartScheduler();
}