From f1f6b44d99b7640d8d24da11c0359a2efc33c96b Mon Sep 17 00:00:00 2001 From: vanminhpe Date: Mon, 27 Jul 2026 16:27:37 +0800 Subject: [PATCH] add below-min coverage for int16 and float32 registers with min=0 --- test_modbus_limiter.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test_modbus_limiter.py b/test_modbus_limiter.py index ed5d34f..1c5a4db 100644 --- a/test_modbus_limiter.py +++ b/test_modbus_limiter.py @@ -99,14 +99,14 @@ RPU_TESTS = [ ('Cutoff_minimum_current_Q128', 51, 'uint16', 0, 640, None, 641), # ----- Precharge / CV current ----- - ('Precharge_current', 6, 'int16', 0, 1280, None, 1281), - ('CV_current_limit', 7, 'int16', 0, 1280, None, 1281), + ('Precharge_current', 6, 'int16', 0, 1280, -1, 1281), + ('CV_current_limit', 7, 'int16', 0, 1280, -1, 1281), # ----- SR control ----- ('SR_limit_lo', 16, 'uint16', 0, 1280, None, 1281), ('SR_limit_hi', 17, 'uint16', 0, 1280, None, 1281), ('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_cali_a_Iout', 20, 'int16', 950, 1100, 949, 1101), @@ -119,7 +119,7 @@ RPU_TESTS = [ # ----- CAN / Comm ----- ('CAN_bit_rate_kbps', 100, 'uint16', 100, 1000, 99, 1001), ('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), # ----- BLE ----- @@ -239,32 +239,32 @@ TPU_TESTS = [ ('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_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_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_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) ----- # 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_voltage_limit', 42, 'float32', 0.0, 450.0, None, 451.0), - ('PFC_current_limit', 44, 'float32', 0.0, 40.0, None, 41.0), + ('PFC_vdc_ref', 40, 'float32', 0.0, 450.0, -1.0, 451.0), + ('PFC_voltage_limit', 42, 'float32', 0.0, 450.0, -1.0, 451.0), + ('PFC_current_limit', 44, 'float32', 0.0, 40.0, -1.0, 41.0), # ----- Protection current / voltage limits (float32) ----- - ('PFC_current_max', 48, 'float32', 0.0, 40.0, None, 41.0), - ('INV_current_max', 50, 'float32', 0.0, 40.0, None, 41.0), - ('INV_current_min', 170, 'float32', 0.0, 40.0, None, 41.0), - ('DC_bus_voltage_min', 52, 'float32', 0.0, 450.0, None, 451.0), - ('DC_bus_voltage_max', 54, 'float32', 0.0, 450.0, None, 451.0), + ('PFC_current_max', 48, 'float32', 0.0, 40.0, -1.0, 41.0), + ('INV_current_max', 50, 'float32', 0.0, 40.0, -1.0, 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, -1.0, 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 - ('AC_in_voltage_min', 56, 'float32', 0.0, 400.0, None, 401.0), - ('AC_in_voltage_max', 58, '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, -1.0, 401.0), # ----- 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) ----- # Limits = [nominal × 0.9, nominal × 1.1] (compile-time constants in firmware)