From 16cf02726ba3dbcfab29b178ab555fdf2a43d055 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Tue, 6 Jul 2021 15:54:27 +0200 Subject: [PATCH] test_speed_table: improve static assertion Test against the resulting timer speed, not against the CPU clock --- tests/unit/modules/speed_table/test_speed_table.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/modules/speed_table/test_speed_table.cpp b/tests/unit/modules/speed_table/test_speed_table.cpp index 21c8801..1531849 100644 --- a/tests/unit/modules/speed_table/test_speed_table.cpp +++ b/tests/unit/modules/speed_table/test_speed_table.cpp @@ -5,8 +5,9 @@ using Catch::Matchers::Equals; using namespace modules::speed_table; -// The following reference values are calculated for 16MHz F_CPU -static_assert(F_CPU == 16000000); +// The following reference values are calculated for 2MHz timer +static_assert(F_CPU / cpuFrequencyDivider == 2000000, + "speed tables not compatible for the requested frequency"); static const st_timer_t reference[][3] = { { 1, 62500, 1 },