diff --git a/production_apsct.py b/production_apsct.py index 97fb0011d2a2dde0a4b86b93db696942ec43843a..66b9f32edb50d1d6703411a8434060dac7a91348 100644 --- a/production_apsct.py +++ b/production_apsct.py @@ -17,7 +17,7 @@ Check APSCT_CLK import apsct_lib import sys -READ_ALL = True +READ_ALL = False # True CLK_FREQ = '200MHz' @@ -28,32 +28,16 @@ if len(sys.argv) < 2: apsct = apsct_lib.ApsctClass(CLK_FREQ) -print*("Check APSCT in 200MHz mode") -apsct.frequency = "200MHz" -apsct.set_apsct() -apsct.pll_200.read_lock() -apsct.pll_200.read_lol() -apsct.pll_160.read_lock() -apsct.pll_160.read_lol() -apsct.sensors.apsct_sensors() +modi = ["200MHz", "160MHz", "OFF"] +for mode in modi: + print(f"Check APSCT in {mode} mode") + apsct.frequency = mode + apsct.set_apsct() + apsct.pll_200.read_lock() + apsct.pll_160.read_lock() + apsct.sensors.apsct_sensors() + apsct.check_apsct() -print*("Check APSCT in 160MHz mode") -apsct.frequency = "160MHz" -apsct.set_apsct() -apsct.pll_200.read_lock() -apsct.pll_200.read_lol() -apsct.pll_160.read_lock() -apsct.pll_160.read_lol() -apsct.sensors.apsct_sensors() - -print*("Check APSCT in off mode") -apsct.frequency = "OFF" -apsct.set_apsct() -apsct.pll_200.read_lock() -apsct.pll_200.read_lol() -apsct.pll_160.read_lock() -apsct.pll_160.read_lol() -apsct.sensors.apsct_sensors() if READ_ALL: apsct.pll_200.read_all_regs_pll() @@ -67,4 +51,4 @@ if apsct.check_apsct(): if rw_ok: rw_ok = apsct.eeprom.wr_rd_eeprom(serial, address=0x20) if not rw_ok: - print("EEPROM Error") \ No newline at end of file + print("EEPROM Error")