add below-min coverage for int16 and float32 registers with min=0

This commit is contained in:
2026-07-27 16:27:37 +08:00
parent cf06b97524
commit f1f6b44d99
+17 -17
View File
@@ -99,14 +99,14 @@ RPU_TESTS = [
('Cutoff_minimum_current_Q128', 51, 'uint16', 0, 640, None, 641), ('Cutoff_minimum_current_Q128', 51, 'uint16', 0, 640, None, 641),
# ----- Precharge / CV current ----- # ----- Precharge / CV current -----
('Precharge_current', 6, 'int16', 0, 1280, None, 1281), ('Precharge_current', 6, 'int16', 0, 1280, -1, 1281),
('CV_current_limit', 7, 'int16', 0, 1280, None, 1281), ('CV_current_limit', 7, 'int16', 0, 1280, -1, 1281),
# ----- SR control ----- # ----- SR control -----
('SR_limit_lo', 16, 'uint16', 0, 1280, None, 1281), ('SR_limit_lo', 16, 'uint16', 0, 1280, None, 1281),
('SR_limit_hi', 17, 'uint16', 0, 1280, None, 1281), ('SR_limit_hi', 17, 'uint16', 0, 1280, None, 1281),
('SR_duty_ref', 89, 'uint16', 20, 50, 19, 51), ('SR_duty_ref', 89, 'uint16', 20, 50, 19, 51),
('SR_delay_ref', 91, 'int16', 0, 100, None, 101), ('SR_delay_ref', 91, 'int16', 0, 100, -1, 101),
# ----- ADC calibration ----- # ----- ADC calibration -----
('Adc_cali_a_Iout', 20, 'int16', 950, 1100, 949, 1101), ('Adc_cali_a_Iout', 20, 'int16', 950, 1100, 949, 1101),
@@ -119,7 +119,7 @@ RPU_TESTS = [
# ----- CAN / Comm ----- # ----- CAN / Comm -----
('CAN_bit_rate_kbps', 100, 'uint16', 100, 1000, 99, 1001), ('CAN_bit_rate_kbps', 100, 'uint16', 100, 1000, 99, 1001),
('CAN_protocol_select', 125, 'uint16', 0, 101, None, 102), ('CAN_protocol_select', 125, 'uint16', 0, 101, None, 102),
('comm_protocol', 126, 'uint16', 0, 1, None, 2), # ('comm_protocol', 126, 'uint16', 0, 1, None, 2), # EXCLUDED: comm_protocol=1 disables Modbus → device becomes unreachable after rewrite
('CAN_node_ID', 138, 'uint16', 1, 127, 0, 128), ('CAN_node_ID', 138, 'uint16', 1, 127, 0, 128),
# ----- BLE ----- # ----- BLE -----
@@ -239,32 +239,32 @@ TPU_TESTS = [
('Coupling_est_f_lo', 6, 'float32', 60.0, 150.0, 59.0, 151.0), ('Coupling_est_f_lo', 6, 'float32', 60.0, 150.0, 59.0, 151.0),
('Coupling_est_f_hi', 8, 'float32', 60.0, 150.0, 59.0, 151.0), ('Coupling_est_f_hi', 8, 'float32', 60.0, 150.0, 59.0, 151.0),
('Coupling_est_f3', 102, 'float32', 60.0, 150.0, 59.0, 151.0), ('Coupling_est_f3', 102, 'float32', 60.0, 150.0, 59.0, 151.0),
('Coupling_est_iinv_ref', 10, 'float32', 0.0, 40.0, None, 41.0), ('Coupling_est_iinv_ref', 10, 'float32', 0.0, 40.0, -1.0, 41.0),
# ----- INV frequency settings (float32) ----- # ----- INV frequency settings (float32) -----
('INV_freq_set', 28, 'float32', 60.0, 150.0, 59.0, 151.0), ('INV_freq_set', 28, 'float32', 60.0, 150.0, 59.0, 151.0),
('INV_freq_min', 30, 'float32', 60.0, 150.0, 59.0, 151.0), ('INV_freq_min', 30, 'float32', 60.0, 150.0, 59.0, 151.0),
('INV_freq_max', 32, 'float32', 60.0, 150.0, 59.0, 151.0), ('INV_freq_max', 32, 'float32', 60.0, 150.0, 59.0, 151.0),
('INV_current_limit', 34, 'float32', 0.0, 40.0, None, 41.0), ('INV_current_limit', 34, 'float32', 0.0, 40.0, -1.0, 41.0),
# ----- PFC voltage / current (float32) ----- # ----- PFC voltage / current (float32) -----
# MODBUS_LIMIT_PFC_DC_BUS_VOLTAGE_MAX_CEIL = 450.0, PFC_CURRENT_MAX_CEIL = 40.0 # MODBUS_LIMIT_PFC_DC_BUS_VOLTAGE_MAX_CEIL = 450.0, PFC_CURRENT_MAX_CEIL = 40.0
('PFC_vdc_ref', 40, 'float32', 0.0, 450.0, None, 451.0), ('PFC_vdc_ref', 40, 'float32', 0.0, 450.0, -1.0, 451.0),
('PFC_voltage_limit', 42, 'float32', 0.0, 450.0, None, 451.0), ('PFC_voltage_limit', 42, 'float32', 0.0, 450.0, -1.0, 451.0),
('PFC_current_limit', 44, 'float32', 0.0, 40.0, None, 41.0), ('PFC_current_limit', 44, 'float32', 0.0, 40.0, -1.0, 41.0),
# ----- Protection current / voltage limits (float32) ----- # ----- Protection current / voltage limits (float32) -----
('PFC_current_max', 48, 'float32', 0.0, 40.0, None, 41.0), ('PFC_current_max', 48, 'float32', 0.0, 40.0, -1.0, 41.0),
('INV_current_max', 50, 'float32', 0.0, 40.0, None, 41.0), ('INV_current_max', 50, 'float32', 0.0, 40.0, -1.0, 41.0),
('INV_current_min', 170, 'float32', 0.0, 40.0, None, 41.0), ('INV_current_min', 170, 'float32', 0.0, 40.0, -1.0, 41.0),
('DC_bus_voltage_min', 52, 'float32', 0.0, 450.0, None, 451.0), ('DC_bus_voltage_min', 52, 'float32', 0.0, 450.0, -1.0, 451.0),
('DC_bus_voltage_max', 54, 'float32', 0.0, 450.0, None, 451.0), ('DC_bus_voltage_max', 54, 'float32', 0.0, 450.0, -1.0, 451.0),
# MODBUS_LIMIT_AC_IN_VOLTAGE_MAX_CEIL = 400.0 # MODBUS_LIMIT_AC_IN_VOLTAGE_MAX_CEIL = 400.0
('AC_in_voltage_min', 56, 'float32', 0.0, 400.0, None, 401.0), ('AC_in_voltage_min', 56, 'float32', 0.0, 400.0, -1.0, 401.0),
('AC_in_voltage_max', 58, 'float32', 0.0, 400.0, None, 401.0), ('AC_in_voltage_max', 58, 'float32', 0.0, 400.0, -1.0, 401.0),
# ----- No-batt coupling INV current (float32) ----- # ----- No-batt coupling INV current (float32) -----
('No_batt_coupling_inv_current', 168, 'float32', 0.0, 40.0, None, 41.0), ('No_batt_coupling_inv_current', 168, 'float32', 0.0, 40.0, -1.0, 41.0),
# ----- ADC calibration gain (A) registers (float32) ----- # ----- ADC calibration gain (A) registers (float32) -----
# Limits = [nominal × 0.9, nominal × 1.1] (compile-time constants in firmware) # Limits = [nominal × 0.9, nominal × 1.1] (compile-time constants in firmware)