update pd test

This commit is contained in:
不吃油炸鸡
2025-10-19 21:17:15 +08:00
parent 210db67ae2
commit 4b62e5007e
4 changed files with 37 additions and 23 deletions

View File

@@ -10,8 +10,6 @@
/* Private variables ---------------------------------------------------------*/
uint8_t timer_flag = 0;
/* Private function prototypes -----------------------------------------------*/
/**
@@ -24,12 +22,11 @@ void PDUFPTask(void *argument)
// FUSB init
fusb302_dev_init();
// set
PD_protocol_set_power_option(&pd_protocol, PD_POWER_OPTION_MAX_9V);
PD_protocol_set_PPS(&pd_protocol, PD_V(8.4), PD_A(2.0), true);
PD_protocol_set_power_option(&pd_protocol, PD_POWER_OPTION_MAX_VOLTAGE);
PD_protocol_set_PPS(&pd_protocol, PD_V(8.4), PD_A(2.0), false);
while(1)
{
timer_flag = fusb302_timer();
if (timer_flag) {
if (fusb302_timer() || HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_4) == GPIO_PIN_RESET) {
FUSB302_event_t FUSB302_events = 0;
for (uint8_t i = 0; i < 3 && FUSB302_alert(&fusb302_dev, &FUSB302_events) != FUSB302_SUCCESS; i++) {}
if (FUSB302_events) {
@@ -37,6 +34,6 @@ void PDUFPTask(void *argument)
}
}
osDelay(100);
osDelay(50);
}
}