aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2022-02-12 11:58:52 +1100
committerGitHub <[email protected]>2022-02-12 11:58:52 +1100
commitd6f4e1ee921241f90a39e9b5e3bb7016175d4cf4 (patch)
tree0b12defbda33698bdb357e45045e3a46ab7b8497
parent3747d22773996bdc6e10aab9d4ececabb30dbc34 (diff)
parent6ecf6302c441e9637933132fbd32277d39c0b1a5 (diff)
downloadIronOS-d6f4e1ee921241f90a39e9b5e3bb7016175d4cf4.tar.gz
IronOS-d6f4e1ee921241f90a39e9b5e3bb7016175d4cf4.zip
Merge branch 'master' into ts80-accel
-rw-r--r--source/Core/BSP/Pine64/configuration.h1
-rw-r--r--source/Core/Threads/GUIThread.cpp12
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 {