aboutsummaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorThomasintAnker <thomasintanker1@gmail.com>2024-05-31 02:19:28 +0200
committerThomasintAnker <thomasintanker1@gmail.com>2024-05-31 02:19:28 +0200
commit377644354f15d283f37450bd7a473153d681316d (patch)
tree58013f13661df14c2cdad37ed83c63c64ae1fcc4 /main/main.c
parent519ffcefbe607dcb89dd9da654628dd3b0c588eb (diff)
added queue for bbetween thread-communication
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c
index b38030f..33912ec 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1,4 +1,5 @@
#include <FreeRTOS.h>
+#include <queue.h>
#include <task.h>
#include <pico/stdlib.h>
@@ -9,6 +10,8 @@
#include "sock.h"
#include "i2c.h"
+QueueHandle_t queue;
+
void blink_task() {
await_init(); // `blink_task` uses GPIO
@@ -23,10 +26,21 @@ void blink_task() {
int main() {
init();
+ // change queue size(?) + queue
+ uint8_t i2cData[2];
+ queue = xQueueCreate(10, sizeof(i2cData));
+
xTaskCreate((TaskFunction_t) blink_task, "blink", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 2, NULL);
xTaskCreate((TaskFunction_t) serve_task, "serve", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 2, NULL);
xTaskCreate((TaskFunction_t) bus_task, "bus", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 2, NULL);
vTaskStartScheduler();
+
+ while(1) {
+ // we should have never gotten here
+ printf("Why are we here?!\n");
+ }
+
+ return 0;
}