Test freertos_test_project build

This commit is contained in:
lukstep
2024-04-04 21:34:27 +02:00
committed by Łukasz
parent 4457cf9404
commit 7269f053f6
3 changed files with 22 additions and 18 deletions

View File

@@ -26,4 +26,6 @@ target_link_libraries(freertos_demo
FreeRTOS-Kernel
FreeRTOS-Kernel-Heap4)
pico_enable_stdio_usb(freertos_demo 1)
pico_enable_stdio_uart(freertos_demo 1)
pico_add_extra_outputs(freertos_demo)

View File

@@ -16,30 +16,26 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) {}
void vApplicationTickHook( void ) {}
void vApplicationMallocFailedHook( void ) {}
constexpr int LED_PIN = 25;
void vBlink(void* unused_arg) {
stdio_init_all();
for (;;) {
for (;;) {
gpio_put(PICO_DEFAULT_LED_PIN, 1);
vTaskDelay(250);
gpio_put(PICO_DEFAULT_LED_PIN, 0);
vTaskDelay(250);
}
gpio_put(LED_PIN, 1);
vTaskDelay(250);
gpio_put(LED_PIN, 0);
puts("Hello FreeRTOS\n");
vTaskDelay(250);
}
}
int main() {
gpio_init(LED_PIN);
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
xTaskCreate(vBlink, "Blink", 128, NULL, 1, NULL);
vTaskStartScheduler();
xTaskCreate(vBlink, "Blink", 128, NULL, 1, NULL);
vTaskStartScheduler();
}