Skip to content

Commit

Permalink
Test freertos_test_project build
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstep committed Apr 4, 2024
1 parent 4457cf9 commit 7269f05
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
2 changes: 2 additions & 0 deletions freertos_test_project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
34 changes: 15 additions & 19 deletions freertos_test_project/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 FreeRTOS\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();
}
6 changes: 6 additions & 0 deletions test_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7269f05

Please sign in to comment.