Skip to content

Conversation

tazomatalax
Copy link
Contributor

Summary

This pull request comments out all code related to INA226 current sensing in order to prevent microcontroller lockups caused by a faulty or missing INA226 component. The code remains in place and is clearly commented, so it can be easily re-enabled in the future by simply uncommenting the relevant lines.

Details

  • main.cpp
    • All INA226 initialization and runtime code is commented out.
    • The handle_current_sensor() function and its calls are commented out.
    • Forward declarations and related logic are commented out.
  • sys_init.h
    • INA226 header include, object instantiation, and calibration defines are commented out.
  • README.md
    • Added a section explaining that INA226 current sensing is present but disabled by default.
    • Provided instructions for re-enabling current sensing if hardware is available and working.
    • Clarified that all other features (ADC, RPM, Modbus, etc.) remain fully functional.

Motivation

  • Prevents microcontroller lockups on hardware with a faulty or missing INA226.
  • Makes it easy for future users to restore current sensing by uncommenting code.
  • Documents the change and the reason for it in the README.

How to Re-enable Current Sensing

  1. Uncomment all INA226-related code in main.cpp and sys_init.h.
  2. Ensure the INA226 is present and connected correctly on your hardware.
  3. Rebuild and upload the firmware.

This PR is safe for all users and does not remove any features—current sensing can be restored at any time.

- Updated README to explain that all INA226 (current sensing) code is present but commented out due to hardware issues.
- Provided instructions for re-enabling current sensing in the future.
- Noted that all other features (ADC, RPM, Modbus, etc.) remain fully functional with current sensing disabled.
- Commented out INA226 code in main.cpp and sys_init.h for safe operation on hardware with a faulty or missing INA226.
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.

1 participant