From 7bca0280f9d16069d843fe5d5fced0ce798c37b2 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Thu, 6 May 2021 19:46:32 +1000 Subject: [PATCH] Backoff by about 1W from approx limit --- source/Core/Drivers/FUSB302/policy_engine_user.cpp | 4 ++-- source/Core/Inc/configuration.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Core/Drivers/FUSB302/policy_engine_user.cpp b/source/Core/Drivers/FUSB302/policy_engine_user.cpp index 8b02f36e..08709e41 100644 --- a/source/Core/Drivers/FUSB302/policy_engine_user.cpp +++ b/source/Core/Drivers/FUSB302/policy_engine_user.cpp @@ -92,7 +92,7 @@ bool PolicyEngine::pdbs_dpm_evaluate_capability(const union pd_msg *capabilities bestIsPPS = false; #ifdef MODEL_HAS_DCDC // set limiter for wattage - powerSupplyWattageLimit = (voltage_mv * current_a_x100) / 100 / 1000; + powerSupplyWattageLimit = ((voltage_mv * current_a_x100) / 100 / 1000)-1; #endif } } @@ -119,7 +119,7 @@ bool PolicyEngine::pdbs_dpm_evaluate_capability(const union pd_msg *capabilities bestIsPPS = true; #ifdef MODEL_HAS_DCDC // set limiter for wattage - powerSupplyWattageLimit = (ideal_voltage_mv * max_current) / 100 / 1000; + powerSupplyWattageLimit = ((ideal_voltage_mv * max_current) / 100 / 1000)-1; #endif } } diff --git a/source/Core/Inc/configuration.h b/source/Core/Inc/configuration.h index 589a30d4..c7b30bf7 100644 --- a/source/Core/Inc/configuration.h +++ b/source/Core/Inc/configuration.h @@ -207,7 +207,7 @@ #define CALIBRATION_OFFSET 0 // the adc offset in uV - MHP compensates automagically #define POWER_LIMIT 65 // 65 watts default power limit #define MAX_POWER_LIMIT 65 // -#define POWER_LIMIT_STEPS 2 // +#define POWER_LIMIT_STEPS 1 // #define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_MHP30 // #define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate #define MODEL_HAS_DCDC // Has inductor to current filter