Skip to content

Commit

Permalink
remove highest voltage tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDick committed Aug 4, 2024
1 parent e54ca01 commit d93894b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/tildagon_power/fusb302b/fusb302b_pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,19 @@ void fusbpd_decode( pd_state_t* state, fusb_state_t* fusb )
*/
uint8_t fusbpd_select_pdo( pd_state_t* state )
{
uint16_t highest_voltage = 5000U;
uint8_t index = 0U;
for ( uint8_t i = 0U; i < state->last_rx_header.sop.number_objects; i++ )
uint8_t i = 0U;
for ( i = 0U ; i < state->last_rx_header.sop.number_objects; i++ )
{
const uint16_t voltage = state->pdos[i].fixed.voltage * 50;
if (
( state->pdos[i].fixed.pdo_type == PD_FIXED_SUPPLY )
&& ( voltage > highest_voltage )
&& ( voltage <= 5000U )
&& ( voltage == 5000U )
)
{
highest_voltage = voltage;
index = i;
break;
}
}
return index;
return i;
}

/**
Expand Down

0 comments on commit d93894b

Please sign in to comment.