ulp: fix -Wformat errors in ULP tests

pull/9523/head
Marius Vikhammer 2022-08-04 12:19:28 +08:00
rodzic 6c8375e2d2
commit 75cdc683ff
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -342,7 +342,7 @@ TEST_CASE("ULP FSM I_WR_REG instruction test", "[ulp]")
for (size_t i = 0; i < test_items_count; ++i) {
const uint32_t mask = (uint32_t) (((1ULL << test_items[i].width) - 1) << test_items[i].low);
const uint32_t not_mask = ~mask;
printf("#%2d: low: %2d width: %2d mask: %08x expected: %08x ", i,
printf("#%2d: low: %2d width: %2d mask: %08" PRIx32 " expected: %08" PRIx32 " ", i,
test_items[i].low, test_items[i].width,
mask, not_mask);
@ -377,7 +377,7 @@ TEST_CASE("ULP FSM I_WR_REG instruction test", "[ulp]")
/* Verify the test results */
uint32_t clear = REG_READ(RTC_CNTL_STORE0_REG);
uint32_t set = REG_READ(RTC_CNTL_STORE1_REG);
printf("clear: %08x set: %08x\n", clear, set);
printf("clear: %08" PRIx32 " set: %08" PRIx32 "\n", clear, set);
/* Restore initial calibration values */
REG_WRITE(RTC_CNTL_STORE0_REG, rtc_store0);
@ -548,7 +548,7 @@ TEST_CASE("ULP FSM timer setting", "[ulp]")
uint32_t expected_counter = 1000000 / cycles_to_test[i];
uint32_t tolerance = (expected_counter * 15 / 100);
tolerance = tolerance ? tolerance : 1; // Keep a tolerance of at least 1 count
printf("expected: %u\t tolerance: +/- %u\t actual: %u\n", expected_counter, tolerance, counter);
printf("expected: %" PRIu32 "\t tolerance: +/- %" PRIu32 "\t actual: %" PRIu32 "\n", expected_counter, tolerance, counter);
// Should be within 15%
TEST_ASSERT_INT_WITHIN(tolerance, expected_counter, counter);
}

Wyświetl plik

@ -6,6 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "esp_sleep.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/sens_reg.h"
@ -79,7 +80,7 @@ TEST_CASE("ULP-RISC-V and main CPU are able to exchange data", "[ulp]")
/* Verify test data */
TEST_ASSERT(ulp_command_resp == RISCV_READ_WRITE_TEST);
TEST_ASSERT(ulp_main_cpu_reply == RISCV_COMMAND_OK);
printf("data out: 0x%X, expected: 0x%X \n", ulp_riscv_test_data_out, test_data);
printf("data out: 0x%" PRIx32 ", expected: 0x%" PRIx32 " \n", ulp_riscv_test_data_out, test_data);
TEST_ASSERT(test_data == ulp_riscv_test_data_out);
/* Clear test data */
@ -139,7 +140,7 @@ static bool ulp_riscv_is_running(void)
vTaskDelay((5 * ULP_WAKEUP_PERIOD / 1000) / portTICK_PERIOD_MS);
uint32_t end_cnt = ulp_riscv_counter;
printf("start run count: %d, end run count %d\n", start_cnt, end_cnt);
printf("start run count: %" PRIu32 ", end run count %" PRIu32 "\n", start_cnt, end_cnt);
/* If the ulp is running the counter should have been incremented */
return (start_cnt != end_cnt);