Skip to content

Commit

Permalink
Added Hello World task.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbar committed Sep 14, 2023
1 parent 0640fda commit 32b79fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "main.h"

#include <stdbool.h>
#include <stdio.h>

#include <pico/stdlib.h>

Expand All @@ -45,6 +46,14 @@ void vBlinkTask()
}
}

void vHelloWorldTask()
{
while(true)
{
printf("Hello world\n");
vTaskDelay(1000);
}
}
int main()
{
// Initialize the stdio library
Expand All @@ -59,6 +68,9 @@ int main()
// Create background blink task
BaseType_t blinkTask = xTaskCreate(vBlinkTask, "Blink Task", 128, NULL, 1, NULL);

// Create background hello world task
BaseType_t helloWorldTask = xTaskCreate(vHelloWorldTask, "Hello World Task", 128, NULL, 1, NULL);

// Start background tasks
vTaskStartScheduler();

Expand Down

0 comments on commit 32b79fb

Please sign in to comment.