diff --git a/components/freertos/test_apps/freertos/kernel/CMakeLists.txt b/components/freertos/test_apps/freertos/kernel/CMakeLists.txt index 3e02a64a33..cf385fa395 100644 --- a/components/freertos/test_apps/freertos/kernel/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/kernel/CMakeLists.txt @@ -21,6 +21,3 @@ idf_component_register(SRC_DIRS ${src_dirs} PRIV_INCLUDE_DIRS ${priv_include_dirs} PRIV_REQUIRES test_utils esp_timer driver WHOLE_ARCHIVE) - -# Todo: Fix no-format errors -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/freertos/test_apps/freertos/kernel/tasks/test_preemption.c b/components/freertos/test_apps/freertos/kernel/tasks/test_preemption.c index 7826d8a6d8..9751472aff 100644 --- a/components/freertos/test_apps/freertos/kernel/tasks/test_preemption.c +++ b/components/freertos/test_apps/freertos/kernel/tasks/test_preemption.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,6 +10,7 @@ #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -77,7 +78,7 @@ TEST_CASE("Yield from lower priority task, same CPU", "[freertos]") TEST_ASSERT( flag ); delta = now_ccount - yield_ccount; - printf("Yielding from lower priority task took %u cycles\n", delta); + printf("Yielding from lower priority task took %"PRIu32" cycles\n", delta); TEST_ASSERT(delta < MAX_YIELD_COUNT); vTaskDelete(sender_task); @@ -114,7 +115,7 @@ TEST_CASE("Yield from lower priority task, other CPU", "[freertos]") TEST_ASSERT( flag ); delta = now_ccount - trigger_ccount; - printf("Yielding from task on other core took %u cycles\n", delta); + printf("Yielding from task on other core took %"PRIu32" cycles\n", delta); TEST_ASSERT(delta < MAX_YIELD_COUNT); vQueueDelete(queue); diff --git a/components/freertos/test_apps/freertos/kernel/tasks/test_task_suspend_resume.c b/components/freertos/test_apps/freertos/kernel/tasks/test_task_suspend_resume.c index 307c91cb77..15c2449da0 100644 --- a/components/freertos/test_apps/freertos/kernel/tasks/test_task_suspend_resume.c +++ b/components/freertos/test_apps/freertos/kernel/tasks/test_task_suspend_resume.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,7 @@ /* Tests for FreeRTOS task suspend & resume */ #include #include +#include #include "sdkconfig.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -341,7 +342,7 @@ static void test_scheduler_suspend2(int cpu) vTaskDelay(waiting_ms * 2 / portTICK_PERIOD_MS); esp_deregister_freertos_tick_hook(tick_hook); - printf("tick_hook_ms[cpu0] = %d, tick_hook_ms[cpu1] = %d\n", tick_hook_ms[0], tick_hook_ms[1]); + printf("tick_hook_ms[cpu0] = %"PRIu32", tick_hook_ms[cpu1] = %"PRIu32"\n", tick_hook_ms[0], tick_hook_ms[1]); TEST_ASSERT_INT_WITHIN(portTICK_PERIOD_MS * 2, waiting_ms * 2, tick_hook_ms[0]); TEST_ASSERT_INT_WITHIN(portTICK_PERIOD_MS * 2, waiting_ms * 2, tick_hook_ms[1]); diff --git a/components/freertos/test_apps/freertos/misc/CMakeLists.txt b/components/freertos/test_apps/freertos/misc/CMakeLists.txt index 783c5a6af2..cb1b5fdeb8 100644 --- a/components/freertos/test_apps/freertos/misc/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/misc/CMakeLists.txt @@ -5,6 +5,3 @@ idf_component_register(SRC_DIRS "." PRIV_REQUIRES test_utils WHOLE_ARCHIVE) - -# Todo: Fix no-format errors -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/freertos/test_apps/freertos/performance/CMakeLists.txt b/components/freertos/test_apps/freertos/performance/CMakeLists.txt index 8b2b417d5e..2fc8feb739 100644 --- a/components/freertos/test_apps/freertos/performance/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/performance/CMakeLists.txt @@ -5,6 +5,3 @@ idf_component_register(SRC_DIRS "." PRIV_REQUIRES test_utils WHOLE_ARCHIVE) - -# Todo: Fix no-format errors -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/freertos/test_apps/freertos/performance/test_freertos_scheduling_time.c b/components/freertos/test_apps/freertos/performance/test_freertos_scheduling_time.c index 238a58d538..c41f3a54e5 100644 --- a/components/freertos/test_apps/freertos/performance/test_freertos_scheduling_time.c +++ b/components/freertos/test_apps/freertos/performance/test_freertos_scheduling_time.c @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/semphr.h" @@ -71,5 +72,5 @@ TEST_CASE("scheduling time test", "[freertos]") BaseType_t result = xSemaphoreTake(context.end_sema, portMAX_DELAY); TEST_ASSERT_EQUAL_HEX32(pdTRUE, result); - TEST_PERFORMANCE_LESS_THAN(SCHEDULING_TIME , "%d cycles" ,context.cycles_to_sched); + TEST_PERFORMANCE_LESS_THAN(SCHEDULING_TIME , "%"PRIu32" cycles" ,context.cycles_to_sched); } diff --git a/components/freertos/test_apps/freertos/performance/test_isr_latency.c b/components/freertos/test_apps/freertos/performance/test_isr_latency.c index 02d50bc096..7a13d82668 100644 --- a/components/freertos/test_apps/freertos/performance/test_isr_latency.c +++ b/components/freertos/test_apps/freertos/performance/test_isr_latency.c @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include #include +#include #include "sdkconfig.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -94,8 +95,8 @@ TEST_CASE("isr latency test vport-yield-from-isr with no parameter", "[freertos] vTaskDelay(100); BaseType_t result = xSemaphoreTake(end_sema, portMAX_DELAY); TEST_ASSERT_EQUAL_HEX32(pdTRUE, result); - TEST_PERFORMANCE_LESS_THAN(ISR_ENTER_CYCLES, "%d cycles" ,delta_enter_cycles); - TEST_PERFORMANCE_LESS_THAN(ISR_EXIT_CYCLES, "%d cycles" ,delta_exit_cycles); + TEST_PERFORMANCE_LESS_THAN(ISR_ENTER_CYCLES, "%"PRIu32" cycles" ,delta_enter_cycles); + TEST_PERFORMANCE_LESS_THAN(ISR_EXIT_CYCLES, "%"PRIu32" cycles" ,delta_exit_cycles); esp_intr_free(handle); } @@ -113,8 +114,8 @@ TEST_CASE("isr latency test vport-yield-from-isr with parameter", "[freertos][ig xTaskCreatePinnedToCore(test_task, "tst" , 4096, NULL, configMAX_PRIORITIES - 1, NULL, 0); BaseType_t result = xSemaphoreTake(end_sema, portMAX_DELAY); TEST_ASSERT_EQUAL_HEX32(pdTRUE, result); - TEST_PERFORMANCE_LESS_THAN(ISR_ENTER_CYCLES, "%d cycles" ,delta_enter_cycles); - TEST_PERFORMANCE_LESS_THAN(ISR_EXIT_CYCLES, "%d cycles" ,delta_exit_cycles); + TEST_PERFORMANCE_LESS_THAN(ISR_ENTER_CYCLES, "%"PRIu32" cycles" ,delta_enter_cycles); + TEST_PERFORMANCE_LESS_THAN(ISR_EXIT_CYCLES, "%"PRIu32" cycles" ,delta_exit_cycles); esp_intr_free(handle); } diff --git a/components/freertos/test_apps/freertos/port/CMakeLists.txt b/components/freertos/test_apps/freertos/port/CMakeLists.txt index 594e8a8295..04522f2caf 100644 --- a/components/freertos/test_apps/freertos/port/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/port/CMakeLists.txt @@ -5,6 +5,3 @@ idf_component_register(SRC_DIRS "." PRIV_REQUIRES test_utils WHOLE_ARCHIVE) - -# Todo: Fix no-format errors -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/freertos/test_apps/freertos/port/test_spinlocks.c b/components/freertos/test_apps/freertos/port/test_spinlocks.c index f5ab39788d..06e887fa79 100644 --- a/components/freertos/test_apps/freertos/port/test_spinlocks.c +++ b/components/freertos/test_apps/freertos/port/test_spinlocks.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,6 +10,7 @@ #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -32,7 +33,7 @@ static uint32_t start, end; #define BENCHMARK_END(OPERATION) do { \ end = esp_cpu_get_cycle_count(); \ - printf("%s took %d cycles/op (%d cycles for %d ops)\n", \ + printf("%s took %"PRIu32" cycles/op (%"PRIu32" cycles for %d ops)\n", \ OPERATION, (end - start)/REPEAT_OPS, \ (end - start), REPEAT_OPS); \ } while(0) @@ -49,12 +50,12 @@ TEST_CASE("portMUX spinlocks (no contention)", "[freertos]") BENCHMARK_END("no contention lock"); #ifdef CONFIG_FREERTOS_UNICORE - TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP_UNICORE, "%d cycles/op", ((end - start)/REPEAT_OPS)); + TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP_UNICORE, "%"PRIu32" cycles/op", ((end - start)/REPEAT_OPS)); #else #if CONFIG_SPIRAM - TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM, "%d cycles/op", ((end - start)/REPEAT_OPS)); + TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM, "%"PRIu32" cycles/op", ((end - start)/REPEAT_OPS)); #else - TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP, "%d cycles/op", ((end - start)/REPEAT_OPS)); + TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP, "%"PRIu32" cycles/op", ((end - start)/REPEAT_OPS)); #endif #endif } diff --git a/components/freertos/test_apps/freertos/port/test_thread_local.c b/components/freertos/test_apps/freertos/port/test_thread_local.c index 8fb9772ad2..de38bee040 100644 --- a/components/freertos/test_apps/freertos/port/test_thread_local.c +++ b/components/freertos/test_apps/freertos/port/test_thread_local.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,6 +11,7 @@ #include #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -51,7 +52,7 @@ static void task_test_tls(void *arg) GET_THREADPTR(tp); for (int i = 0; i < 5; i++) { - printf("Task[%x]: var = 0x%x 0x%x step=%d\n", tp, tl_test_var1, tl_test_var2, step); + printf("Task[%"PRIx32"]: var1 = %d var2 = 0x%"PRIx8" step=%d\n", tp, tl_test_var1, tl_test_var2, step); if (i == 0) { TEST_ASSERT_EQUAL(0, tl_test_var1); TEST_ASSERT_EQUAL(55, tl_test_var2);