diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/charge_ramp.c | 34 | ||||
-rw-r--r-- | test/test_config.h | 2 |
2 files changed, 24 insertions, 12 deletions
diff --git a/test/charge_ramp.c b/test/charge_ramp.c index 4c5c01b64c..e3dce7a860 100644 --- a/test/charge_ramp.c +++ b/test/charge_ramp.c @@ -36,12 +36,34 @@ static int charge_limit_ma; /* Mock functions */ -int board_is_ramp_allowed(int supplier) +/* Override test_mockable implementations in charge_ramp module */ +int chg_ramp_allowed(int supplier) { /* Ramp for TEST4-TEST8 */ return supplier > CHARGE_SUPPLIER_TEST3; } +int chg_ramp_max(int supplier, int sup_curr) +{ + if (supplier == CHARGE_SUPPLIER_TEST7) + return 1600; + else if (supplier == CHARGE_SUPPLIER_TEST8) + return 2400; + else + return 3000; +} + +/* These usb_charger functions are unused, but necessary to link */ +int usb_charger_ramp_allowed(int supplier) +{ + return 0; +} + +int usb_charger_ramp_max(int supplier, int sup_curr) +{ + return 0; +} + int board_is_consuming_full_charge(void) { return charge_limit_ma <= system_load_current_ma; @@ -61,16 +83,6 @@ void board_set_charge_limit(int port, int supplier, int limit_ma, task_set_event(TASK_ID_TEST_RUNNER, TASK_EVENT_OVERCURRENT, 0); } -int board_get_ramp_current_limit(int supplier, int sup_curr) -{ - if (supplier == CHARGE_SUPPLIER_TEST7) - return 1600; - else if (supplier == CHARGE_SUPPLIER_TEST8) - return 2400; - else - return 3000; -} - /* Test utilities */ static void plug_charger_with_ts(int supplier_type, int port, int min_current, diff --git a/test/test_config.h b/test/test_config.h index 6ed975eb18..20cca9806d 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -195,7 +195,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #endif #ifdef TEST_CHARGE_RAMP -#define CONFIG_CHARGE_RAMP +#define CONFIG_CHARGE_RAMP_SW #define CONFIG_USB_PD_PORT_COUNT 2 #endif |