Skip to content

Conversation

@finger563
Copy link
Contributor

@finger563 finger563 commented Oct 21, 2025

Description

  • Fix configuration / initialization of ina226
  • Add reset function
  • Fix computation of bus voltage

Motivation and Context

Ensures the ina226 component does what it is supposed to do properly.

How has this been tested?

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Copilot AI review requested due to automatic review settings October 21, 2025 18:04
@finger563 finger563 self-assigned this Oct 21, 2025
@finger563 finger563 added bug Something isn't working power ina226 labels Oct 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes critical bugs in the INA226 power monitor driver's configuration and initialization. The changes correct bit field mappings in the configuration register, fix the bus voltage calculation formula, and add proper device verification during initialization.

Key Changes

  • Fixed incorrect bit positions for AVG, VBUSCT, and VSHCT fields in the CONFIG register
  • Corrected bus voltage calculation by removing incorrect bit shift operation
  • Added device ID verification and reset functionality to initialization sequence

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

✅Static analysis result - no issues found! ✅

@finger563 finger563 merged commit 89f173f into main Oct 21, 2025
98 of 99 checks passed
@finger563 finger563 deleted the fix/ina226 branch October 21, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ina226 power

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants