Got Pico SDK + FreeRTOS to work
This commit is contained in:
38
i2c-hub/firmware/i2c-hub-firmware/src/main.cpp
Normal file
38
i2c-hub/firmware/i2c-hub-firmware/src/main.cpp
Normal 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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user