From 16882fee61e79b6f8a347ba7ee9f431298912053 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 12 Feb 2022 10:34:22 +1100 Subject: [PATCH] only vbus mod check on pinecil If a TS80P has it connected, other things blow up first at 20V --- source/Core/BSP/Pine64/configuration.h | 1 + source/Core/Threads/GUIThread.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/Core/BSP/Pine64/configuration.h b/source/Core/BSP/Pine64/configuration.h index d013f63f..827d45d8 100644 --- a/source/Core/BSP/Pine64/configuration.h +++ b/source/Core/BSP/Pine64/configuration.h @@ -142,6 +142,7 @@ #define ACCEL_BMA #define ACCEL_SC7 #define HALL_SENSOR +#define VBUS_MOD_TEST #define HALL_SI7210 #define DEBUG_UART_OUTPUT diff --git a/source/Core/Threads/GUIThread.cpp b/source/Core/Threads/GUIThread.cpp index c87aa443..277aaedd 100644 --- a/source/Core/Threads/GUIThread.cpp +++ b/source/Core/Threads/GUIThread.cpp @@ -734,20 +734,24 @@ void showDebugMenu(void) { } else { // We are not powered via DC, so want to display the appropriate state for PD or QC bool poweredbyPD = false; - bool pdHasVBUSConnected = true; + bool pdHasVBUSConnected = false; #if POW_PD if (USBPowerDelivery::fusbPresent()) { // We are PD capable if (USBPowerDelivery::negotiationComplete()) { // We are powered via PD - poweredbyPD = true; + poweredbyPD = true; +#ifdef VBUS_MOD_TEST pdHasVBUSConnected = USBPowerDelivery::isVBUSConnected(); +#endif } } #endif if (poweredbyPD) { - sourceNumber = 2; - if (!pdHasVBUSConnected) { + + if (pdHasVBUSConnected) { + sourceNumber = 2; + } else { sourceNumber = 3; } } else {