aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-04-25 15:10:43 +0200
committerlonkaars <loek@pipeframe.xyz>2024-04-25 15:10:43 +0200
commit42b3b8abd73d0f38efd607fc9dfcf768341549a1 (patch)
treec867039a66e90e3f740c7b6084701ac266cd1218 /main
parent0ef1ae11846bfcbbd63e22d1dfecf579f4069c80 (diff)
freertos works
Diffstat (limited to 'main')
-rw-r--r--main/CMakeLists.txt1
-rw-r--r--main/FreeRTOSConfig.h10
-rw-r--r--main/main.cpp4
3 files changed, 12 insertions, 3 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 590d516..29afb84 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -25,5 +25,6 @@ target_link_libraries(main
pico_cyw43_arch_lwip_threadsafe_background
pico_stdlib
FreeRTOS-Kernel
+ FreeRTOS-Kernel-Heap4
)
diff --git a/main/FreeRTOSConfig.h b/main/FreeRTOSConfig.h
index 305bcb4..4897d8d 100644
--- a/main/FreeRTOSConfig.h
+++ b/main/FreeRTOSConfig.h
@@ -1,6 +1,10 @@
#pragma once
// values from pico-examples/pico_w/wifi/freertos
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define configUSE_PREEMPTION 1
#define configUSE_TICKLESS_IDLE 0
#define configUSE_IDLE_HOOK 0
@@ -25,7 +29,7 @@
#define configSUPPORT_STATIC_ALLOCATION 0
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configTOTAL_HEAP_SIZE (128 * 1024)
-#define configAPPLICATION_ALLOCATED_HEAP 0
+#define configAPPLICATION_ALLOCATED_HEAP 4
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
@@ -67,3 +71,7 @@
#define INCLUDE_xTaskResumeFromISR 1
#define INCLUDE_xQueueGetMutexHolder 1
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
diff --git a/main/main.cpp b/main/main.cpp
index d118de2..8b3504c 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -12,9 +12,9 @@ const unsigned int LED_PIN = CYW43_WL_GPIO_LED_PIN;
void blink_task() {
while (true) {
cyw43_arch_gpio_put(LED_PIN, 0);
- sleep_ms(250);
+ vTaskDelay(250 / portTICK_PERIOD_MS);
cyw43_arch_gpio_put(LED_PIN, 1);
- sleep_ms(250);
+ vTaskDelay(250 / portTICK_PERIOD_MS);
}
}