Skip to content

Commit 449c317

Browse files
committed
Test freertos_test_project build
1 parent 3195fa3 commit 449c317

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

freertos_test_project/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ target_link_libraries(freertos_demo
2626
FreeRTOS-Kernel
2727
FreeRTOS-Kernel-Heap4)
2828

29+
pico_enable_stdio_usb(freertos_demo 1)
30+
pico_enable_stdio_uart(freertos_demo 1)
2931
pico_add_extra_outputs(freertos_demo)

freertos_test_project/main.cpp

+15-19
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,26 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) {}
1616
void vApplicationTickHook( void ) {}
1717
void vApplicationMallocFailedHook( void ) {}
1818

19-
void vBlink(void* unused_arg) {
20-
21-
for (;;) {
22-
23-
gpio_put(PICO_DEFAULT_LED_PIN, 1);
24-
25-
vTaskDelay(250);
26-
27-
gpio_put(PICO_DEFAULT_LED_PIN, 0);
28-
29-
vTaskDelay(250);
30-
31-
}
19+
constexpr int LED_PIN = 25;
3220

21+
void vBlink(void* unused_arg) {
22+
stdio_init_all();
23+
for (;;) {
24+
25+
gpio_put(LED_PIN, 1);
26+
vTaskDelay(250);
27+
gpio_put(LED_PIN, 0);
28+
puts("Hello Word\n");
29+
vTaskDelay(250);
30+
}
3331
}
3432

3533
int main() {
34+
gpio_init(LED_PIN);
3635

37-
gpio_init(PICO_DEFAULT_LED_PIN);
38-
39-
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
40-
41-
xTaskCreate(vBlink, "Blink", 128, NULL, 1, NULL);
36+
gpio_set_dir(LED_PIN, GPIO_OUT);
4237

43-
vTaskStartScheduler();
38+
xTaskCreate(vBlink, "Blink", 128, NULL, 1, NULL);
4439

40+
vTaskStartScheduler();
4541
}

test_sdk.sh

+6
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmak
77
docker exec pico-sdk /bin/sh -c "picotool"
88
docker container kill pico-sdk
99
docker container rm pico-sdk
10+
11+
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/freertos_test_project,target=/home/dev $1
12+
docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmake .. && make -j4"
13+
docker exec pico-sdk /bin/sh -c "picotool"
14+
docker container kill pico-sdk
15+
docker container rm pico-sdk

0 commit comments

Comments
 (0)