Update QC to allow 20V theoretically + allow query for power source
This commit is contained in:
@@ -68,6 +68,8 @@ bool getHallSensorFitted();
|
||||
// If the sensor is single polarity (or polarity insensitive) just return 0..32768
|
||||
int16_t getRawHallEffect();
|
||||
|
||||
//Returns true if power is from dumb "DC" input rather than "smart" QC or PD
|
||||
bool getIsPoweredByDCIN();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ uint8_t getButtonB() {
|
||||
}
|
||||
|
||||
void reboot() {
|
||||
// TODO
|
||||
//Spin for watchdog
|
||||
for (;;) {
|
||||
}
|
||||
}
|
||||
@@ -127,3 +127,4 @@ void reboot() {
|
||||
void delay_ms(uint16_t count) {
|
||||
delay_1ms(count);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,3 +34,16 @@ uint8_t usb_pd_detect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getIsPoweredByDCIN() {
|
||||
//We return false until we are sure we are not using PD
|
||||
if (PolicyEngine::setupCompleteOrTimedOut() == false) {
|
||||
return false;
|
||||
}
|
||||
if (PolicyEngine::pdHasNegotiated()) {
|
||||
return false; // We are using PD
|
||||
}
|
||||
if (hasQCNegotiated()) {
|
||||
return false; // We are using QC
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user