39 lines
683 B
C++
39 lines
683 B
C++
#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) {}
|
|
}
|