Skip to content

Commit 37cb619

Browse files
committed
Resend PPS request at every interrupt
1 parent 088cbda commit 37cb619

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Braccio.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,13 @@ void BraccioClass::pd_thread() {
158158
while (1) {
159159
auto ret = pd_events.wait_any(0xFF);
160160
if ((ret & 1) && (millis() - start_pd_burst > 1000)) {
161+
PD_UFP.set_PPS(PPS_V(7.2), PPS_A(2.0));
161162
pd_timer.detach();
162163
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 1s);
163164
}
164165
if (ret & 2) {
165166
pd_timer.detach();
166-
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 50ms);
167+
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 10ms);
167168
}
168169
i2c_mutex.lock();
169170
PD_UFP.run();

src/lib/powerdelivery/PD_UFP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void PD_UFP_core_c::run(void)
106106

107107
bool PD_UFP_core_c::set_PPS(uint16_t PPS_voltage, uint8_t PPS_current)
108108
{
109-
if (status_power == STATUS_POWER_PPS && PD_protocol_set_PPS(&protocol, PPS_voltage, PPS_current, true)) {
109+
if (status_power == STATUS_POWER_PPS) { // && PD_protocol_set_PPS(&protocol, PPS_voltage, PPS_current, true)) {
110110
send_request = 1;
111111
return true;
112112
}

0 commit comments

Comments
 (0)