Enforce no EPR polling for non >20V devices

This commit is contained in:
Ben V. Brown
2023-12-09 23:02:20 +11:00
parent 20ad63d020
commit ea72aea47d
7 changed files with 19 additions and 13 deletions

View File

@@ -152,8 +152,9 @@
#define PROFILE_SUPPORT #define PROFILE_SUPPORT
#define POW_PD 1 #define POW_PD 1
#define POW_PD_EXT 0 #define POW_PD_EXT 0
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define TEMP_NTC #define TEMP_NTC
#define I2C_SOFT_BUS_2 1 #define I2C_SOFT_BUS_2 1
#define I2C_SOFT_BUS_1 1 #define I2C_SOFT_BUS_1 1

View File

@@ -198,6 +198,7 @@
#define TIP_HAS_DIRECT_PWM 1 #define TIP_HAS_DIRECT_PWM 1
#define POW_DC 1 #define POW_DC 1
#define POW_PD 1 #define POW_PD 1
#define USB_PD_EPR_WATTAGE 140 /* EPR Supported */
#define I2C_SOFT_BUS_2 1 #define I2C_SOFT_BUS_2 1
#define OLED_I2CBB1 1 #define OLED_I2CBB1 1
#define USB_PD_I2CBB2 1 #define USB_PD_I2CBB2 1
@@ -252,8 +253,9 @@
#define OLED_I2CBB1 1 #define OLED_I2CBB1 1
#define ACCEL_I2CBB1 1 #define ACCEL_I2CBB1 1
#define POW_PD 1 #define POW_PD 1
#define POW_QC 1 #define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define POW_QC 1
#define TEMP_NTC #define TEMP_NTC
#define SC7_ORI_FLIP #define SC7_ORI_FLIP
#endif /* TS80P */ #endif /* TS80P */

View File

@@ -86,7 +86,7 @@
#define POWER_PULSE_DEFAULT 0 #define POWER_PULSE_DEFAULT 0
#else #else
#define POWER_PULSE_DEFAULT 5 #define POWER_PULSE_DEFAULT 5
#endif /* Pinecil */ #endif /* Pinecil */
#define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s #define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s
#define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms #define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms
@@ -145,12 +145,13 @@
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C #define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F #define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define POW_PD 1 #define POW_PD 1
#define POW_PD_EXT 0 #define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */
#define POW_QC 1 #define POW_PD_EXT 0
#define POW_DC 1 #define POW_QC 1
#define POW_QC_20V 1 #define POW_DC 1
#define ENABLE_QC2 1 #define POW_QC_20V 1
#define ENABLE_QC2 1
#define TEMP_TMP36 #define TEMP_TMP36
#define ACCEL_BMA #define ACCEL_BMA
#define ACCEL_SC7 #define ACCEL_SC7

View File

@@ -146,6 +146,7 @@
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F #define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define DEVICE_HAS_VALIDATION_CODE // We have 2 digit validations #define DEVICE_HAS_VALIDATION_CODE // We have 2 digit validations
#define POW_PD 1 // Supported features #define POW_PD 1 // Supported features
#define USB_PD_EPR_WATTAGE 140 // USB PD EPR Wattage
#define POW_PD_EXT 0 // Future-proof macro for other models with other PD modes #define POW_PD_EXT 0 // Future-proof macro for other models with other PD modes
#define POW_QC 1 // Supported features #define POW_QC 1 // Supported features
#define POW_DC 1 // Supported features #define POW_DC 1 // Supported features

View File

@@ -156,6 +156,7 @@
#define OLED_128x32 #define OLED_128x32
#define GPIO_VIBRATION #define GPIO_VIBRATION
#define POW_PD_EXT 1 #define POW_PD_EXT 1
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define DEBUG_POWER_MENU_BUTTON_B 1 #define DEBUG_POWER_MENU_BUTTON_B 1
#define HAS_POWER_DEBUG_MENU #define HAS_POWER_DEBUG_MENU
#define TEMP_NTC #define TEMP_NTC

View File

@@ -27,7 +27,7 @@ bool pdbs_dpm_evaluate_capability(const pd_msg *capabilities, pd_msg *re
void pdbs_dpm_get_sink_capability(pd_msg *cap, const bool isPD3); void pdbs_dpm_get_sink_capability(pd_msg *cap, const bool isPD3);
bool EPREvaluateCapabilityFunc(const epr_pd_msg *capabilities, pd_msg *request); bool EPREvaluateCapabilityFunc(const epr_pd_msg *capabilities, pd_msg *request);
FUSB302 fusb((0x22 << 1), fusb_read_buf, fusb_write_buf, ms_delay); // Create FUSB driver FUSB302 fusb((0x22 << 1), fusb_read_buf, fusb_write_buf, ms_delay); // Create FUSB driver
PolicyEngine pe(fusb, get_ms_timestamp, ms_delay, pdbs_dpm_get_sink_capability, pdbs_dpm_evaluate_capability, EPREvaluateCapabilityFunc, 140); PolicyEngine pe(fusb, get_ms_timestamp, ms_delay, pdbs_dpm_get_sink_capability, pdbs_dpm_evaluate_capability, EPREvaluateCapabilityFunc, USB_PD_EPR_WATTAGE);
int USBPowerDelivery::detectionState = 0; int USBPowerDelivery::detectionState = 0;
uint16_t requested_voltage_mv = 0; uint16_t requested_voltage_mv = 0;