test_speed_table: improve static assertion

Test against the resulting timer speed, not against the CPU clock
pull/47/head
Yuri D'Elia 2021-07-06 15:54:27 +02:00
parent d87db1ff76
commit 16cf02726b
1 changed files with 3 additions and 2 deletions

View File

@ -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 },