From 4696f0f90783c89e9cf34fdf86e270047f9d6c36 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 18 Sep 2022 18:48:35 +1000 Subject: [PATCH] Enable EPR if vbus is not connected --- source/Core/BSP/Pinecil/configuration.h | 3 ++- source/Core/Drivers/USBPD.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/Core/BSP/Pinecil/configuration.h b/source/Core/BSP/Pinecil/configuration.h index a6ae918e..306c7afa 100644 --- a/source/Core/BSP/Pinecil/configuration.h +++ b/source/Core/BSP/Pinecil/configuration.h @@ -127,7 +127,8 @@ #define POWER_LIMIT_STEPS 5 // #define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_PINECIL // Uses TS100 resistors #define TEMP_uV_LOOKUP_HAKKO // Use Hakko lookup table -#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate +#define USB_PD_VMAX 24 // Maximum voltage for PD to negotiate +#define POW_EPR 1 // EPR mode is tentatively enabled #define PID_TIM_HZ (8) // Tick rate of the PID loop #define MAX_TEMP_C 450 // Max soldering temp selectable °C #define MAX_TEMP_F 850 // Max soldering temp selectable °F diff --git a/source/Core/Drivers/USBPD.cpp b/source/Core/Drivers/USBPD.cpp index 29524a0d..9bad3441 100644 --- a/source/Core/Drivers/USBPD.cpp +++ b/source/Core/Drivers/USBPD.cpp @@ -287,7 +287,9 @@ bool pdbs_dpm_evaluate_capability(const pd_msg *capabilities, pd_msg *request) { // We dont do usb // request->obj[0] |= PD_RDO_USB_COMMS; #ifdef POW_EPR - request->obj[0] |= PD_RDO_EPR_CAPABLE; + if (USBPowerDelivery::isVBUSConnected() == false ) { + request->obj[0] |= PD_RDO_EPR_CAPABLE; + } #endif /* Update requested voltage */