Skip to content

charge better#254

Open
jr1221 wants to merge 3 commits intodevelopfrom
better-charging-algo
Open

charge better#254
jr1221 wants to merge 3 commits intodevelopfrom
better-charging-algo

Conversation

@jr1221
Copy link
Copy Markdown
Contributor

@jr1221 jr1221 commented Jun 7, 2025

Changes

Explanation of changes goes here

Notes

Any other notes go here

Test Cases

  • Case A
  • Edge case
  • ...

To Do

Any remaining things that need to get done

  • item 1
  • ...

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please reach out to your Project Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • No merge conflicts
  • All checks passing
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes # (issue #)

@jr1221 jr1221 requested a review from caiodasilva2005 June 7, 2025 01:35
// STAGE 1 -- COUNTDOWN=charge, COUNTUP=settle
if (bmsdata->max_voltage.val < MAX_CHARGE_VOLT && !reached_stage_2) {
// BEGIN COUNTDOWN (first run only)
if (!is_timer_expired(&charger_settle_countdown_stage1)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also add a !is_timer_active() in this block here because this will infinitely keep restarting the timer since completed will be false and then timer start time will reset

reached_stage_2 = true;

// BEGIN COUNTDOWN (first run only)
if (!is_timer_expired(&charger_settle_countdown)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants