Pinecil pd tweaking (#1272)
* Raise PD max to 21V
* gui -> settingsGUI
* VBus probe cache
* Rough pass PD capabilities display
* Cleanup build errors
* PD Debug menu working
* Update make_translation.py
* settingsGUI
* Update GUIThread.cpp
* Nicer debug prints
* Show VBus in PD debug
* Update GUIThread.cpp
* Update make_translation.py
* Add docs
* Build tweaks for TS80P 😢
* Show PPS ranges
This commit is contained in:
@@ -67,10 +67,24 @@ bool USBPowerDelivery::fusbPresent() {
|
||||
return detectionState == 1;
|
||||
}
|
||||
|
||||
bool USBPowerDelivery::isVBUSConnected() { return fusb.isVBUSConnected(); }
|
||||
bool USBPowerDelivery::isVBUSConnected() {
|
||||
static uint8_t state = 0;
|
||||
if (state) {
|
||||
return state == 1;
|
||||
}
|
||||
if (fusb.isVBUSConnected()) {
|
||||
state = 1;
|
||||
return true;
|
||||
} else {
|
||||
state = 2;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
pd_msg lastCapabilities;
|
||||
pd_msg *USBPowerDelivery::getLastSeenCapabilities() { return &lastCapabilities; }
|
||||
|
||||
bool pdbs_dpm_evaluate_capability(const pd_msg *capabilities, pd_msg *request) {
|
||||
|
||||
memcpy(&lastCapabilities, capabilities, sizeof(pd_msg));
|
||||
/* Get the number of PDOs */
|
||||
uint8_t numobj = PD_NUMOBJ_GET(capabilities);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user