diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-10-04 12:44:34 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-10-04 12:44:34 +0200 |
commit | 4a1a7be27fd359309672393446f146fefb3507c0 (patch) | |
tree | 91f58756dfb92f0add50b7c5f6aeb3db69f1b266 /stm32f091/main.c | |
parent | 45a0a4a215fb41564c1a9192d34eae0d0d3423c6 (diff) |
more HAL files compiling
Diffstat (limited to 'stm32f091/main.c')
-rw-r--r-- | stm32f091/main.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/stm32f091/main.c b/stm32f091/main.c index 5e5071e..3ada476 100644 --- a/stm32f091/main.c +++ b/stm32f091/main.c @@ -2,25 +2,28 @@ #include <task.h> #include <stm32f0xx.h> #include <stdint.h> -#include <stm32f0xx_hal_gpio.h> +#include <stm32f0xx_hal.h> void task_1() { - uint8_t led = 1; + // uint8_t led = 1; while (1) { - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, led); - led ^= 1; + // HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, led); + // led ^= 1; + HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); vTaskDelay(1000 / portTICK_RATE_MS); } } int main() { - HAL_GPIO_Init(GPIOA, &(GPIO_InitTypeDef) { - .Mode = GPIO_MODE_OUTPUT_PP, - .Pull = GPIO_NOPULL, - .Pin = GPIO_PIN_5 - }); + HAL_Init(); + GPIO_InitTypeDef GPIO_InitStruct; + GPIO_InitStruct.Pin = GPIO_PIN_5; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); xTaskCreate(task_1, "task1", 128, NULL, 1, NULL); vTaskStartScheduler(); |