Got Pico SDK + FreeRTOS to work

This commit is contained in:
AlexanderHD27
2024-12-29 17:30:22 +01:00
parent 6ef60a3f2f
commit ec2225aa4e
17 changed files with 1382 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
#include <stdio.h>
#include "pico/stdlib.h"
#include "FreeRTOSConfig.h"
#include "FreeRTOS.h"
#include "task.h"
#define LED_PIN 25
void TaskFn(void * args) {
while (true) {
gpio_put(LED_PIN, false);
vTaskDelay(500 / portTICK_PERIOD_MS);
gpio_put(LED_PIN, true);
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
int main()
{
stdio_init_all();
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, true);
stdio_init_all();
printf("HelloWorld!\n");
TaskHandle_t taskHandle;
BaseType_t res = xTaskCreate(TaskFn, "UART Task", 128, NULL, 1, &taskHandle);
printf("%d\n");
vTaskStartScheduler();
while(1) {}
}