From d2997d3efe36f4c4a7acacbbabc9a2a86bfe6bd1 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 10 Jun 2021 22:56:04 -0400 Subject: added test case for global registers when setFreq is called --- freq2lmx2487settings.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/freq2lmx2487settings.lua b/freq2lmx2487settings.lua index 8a9cce6..9c52bbb 100644 --- a/freq2lmx2487settings.lua +++ b/freq2lmx2487settings.lua @@ -128,3 +128,34 @@ function setFreq(freq) set_lmx2487_board_to_new_state(settings) end +-- test setFreq +set_lmx2487_board_to_default_state() +settings= initSettings() +setFreq(6.834e9) +if + get_lmx2487register(0) ~= 11192320 + and get_lmx2487register(1) ~= 4362243 + and get_lmx2487register(2) ~= 8560613 -- should not change + and get_lmx2487register(5) ~= 16003291 +then + print("ERROR in setFreq: registers do not match") +end +setFreq(6.8204e9) +if + get_lmx2487register(0) ~= 11174912 + and get_lmx2487register(1) ~= 4362243 -- should not change + and get_lmx2487register(2) ~= 8560613 -- should not change + and get_lmx2487register(5) ~= 15992043 +then + print("ERROR in setFreq: registers do not match") +end +setFreq(6.8346e9) +if + get_lmx2487register(0) ~= 11193856 + and get_lmx2487register(1) ~= 4362243 -- should not change + and get_lmx2487register(2) ~= 8560613 -- should not change + and get_lmx2487register(5) ~= 16005163 +then + print("ERROR in setFreq: registers do not match") +end + -- cgit v1.2.3