diff --git a/freertos_test_project/CMakeLists.txt b/freertos_test_project/CMakeLists.txt index fef85aa..651714d 100644 --- a/freertos_test_project/CMakeLists.txt +++ b/freertos_test_project/CMakeLists.txt @@ -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) diff --git a/freertos_test_project/main.cpp b/freertos_test_project/main.cpp index 0ec4ef9..c168f07 100644 --- a/freertos_test_project/main.cpp +++ b/freertos_test_project/main.cpp @@ -16,30 +16,26 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) {} void vApplicationTickHook( void ) {} void vApplicationMallocFailedHook( void ) {} -void vBlink(void* unused_arg) { - - for (;;) { - - gpio_put(PICO_DEFAULT_LED_PIN, 1); - - vTaskDelay(250); - - gpio_put(PICO_DEFAULT_LED_PIN, 0); - - vTaskDelay(250); - - } +constexpr int LED_PIN = 25; +void vBlink(void* unused_arg) { + stdio_init_all(); + for (;;) { + + gpio_put(LED_PIN, 1); + vTaskDelay(250); + gpio_put(LED_PIN, 0); + puts("Hello Word\n"); + vTaskDelay(250); + } } int main() { + gpio_init(LED_PIN); - gpio_init(PICO_DEFAULT_LED_PIN); - - gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT); - - xTaskCreate(vBlink, "Blink", 128, NULL, 1, NULL); + gpio_set_dir(LED_PIN, GPIO_OUT); - vTaskStartScheduler(); + xTaskCreate(vBlink, "Blink", 128, NULL, 1, NULL); + vTaskStartScheduler(); } diff --git a/test_sdk.sh b/test_sdk.sh index c3c9856..0364702 100644 --- a/test_sdk.sh +++ b/test_sdk.sh @@ -7,3 +7,9 @@ docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmak docker exec pico-sdk /bin/sh -c "picotool" docker container kill pico-sdk docker container rm pico-sdk + +docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/freertos_test_project,target=/home/dev $1 +docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmake .. && make -j4" +docker exec pico-sdk /bin/sh -c "picotool" +docker container kill pico-sdk +docker container rm pico-sdk