Skip to content

Commit

Permalink
More build error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ameall committed Mar 17, 2024
1 parent 9444505 commit d0f27ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions Core/Inc/compute.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ bool compute_charger_connected();

/**
* @brief Sets the desired fan speed
*
* @param new_fan_speed
*
* @param new_fan_speed
* @param fan_select
* @return uint8_t
*/
void compute_set_fan_speed(uint8_t new_fan_speed);
uint8_t compute_set_fan_speed(uint8_t new_fan_speed, uint8_t fan_select);

/**
* @brief Returns the pack current sensor reading
Expand Down
10 changes: 5 additions & 5 deletions Core/Src/compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ uint8_t compute_set_fan_speed(uint8_t new_fan_speed, uint8_t fan_select)
CCR_value = (TIM1->ARR * new_fan_speed) / 100;
}
else if (fan_select > NUM_FANS_ON_TIM1 && fan_select <= NUM_FANS_TOTAL){
htim.instance = TIM8;
htim.Instance = TIM8;
CCR_value = (TIM8->ARR * new_fan_speed) / 100;
}

// Set object to how PWM channel should be configured
PWMConfig->OCMode = TIM_OCMODE_PWM1;
PWMConfig->Pulse = CCR_value;
PWMConfig->OCPolarity = TIM_OCPOLARITY_HIGH;
PWMConfig->OCFastMode = TIM_OCFAST_DISABLE;
PWMConfig.OCMode = TIM_OCMODE_PWM1;
PWMConfig.Pulse = CCR_value;
PWMConfig.OCPolarity = TIM_OCPOLARITY_HIGH;
PWMConfig.OCFastMode = TIM_OCFAST_DISABLE;

// Attempt to configure PWM channel
if (HAL_TIM_PWM_ConfigChannel(&htim, &PWMConfig, channels[fan_select]) != HAL_OK){
Expand Down

0 comments on commit d0f27ab

Please sign in to comment.