Zanduino / INA

Combined Arduino library for reading multiple INA2xx power monitor devices
GNU General Public License v3.0
158 stars 41 forks source link

Fixed integer division by 0 exception #65

Closed fg89o closed 4 years ago

fg89o commented 4 years ago

Description

Fixed an issue that throw an integer division by 0 exception in method conversionFinished() in INA.cpp. Included platformio.ini to be able to test it with VS Code.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Tested on ESP32 board.

Test Configuration:

Checklist:

Zanshin Logo

SV-Zanshin commented 4 years ago

While there are 2 bug fixes in the list of files, there are many other changes in this merge request which will break existing functionality.

fg89o commented 4 years ago

I didn't want to pull all my commits, sorry. I didn't know when I push commits to my repo it will automatically added to this pull request. I will cancel this pull and create good one.

About the I2C address, What sense is limiting the devices to 32 but only search in 15 address?. Today the maximum address is 0x4F but this can change in the future. obviusly is a minor change but i think it is positive.

SV-Zanshin commented 4 years ago

(I’m getting over some Root-Canal work, so haven’t been doing much on these libraries recently. I’ll get cracking again when I feel better and am not on antibiotics and painkillers)

I can’t recall with whom I discussed that change. When I wrote the library I made some assumptions about people using I2C expanders to get more devices on the bus, but never actually got an expander to test this with, hence the reduction on the I2C address search.

From: fg89o notifications@github.com Sent: 26 August 2020 09:29 To: SV-Zanshin/INA INA@noreply.github.com Cc: Arnd zanshin_github@sv-zanshin.com; Comment comment@noreply.github.com Subject: Re: [SV-Zanshin/INA] Fixed integer division by 0 exception (#65)

I didn't want to pull all my commits, sorry. I didn't know when I push commits to my repo it will automatically added to this pull request. I will cancel this pull and create good one.

About the I2C address, What sense is limiting the devices to 32 but only search in 15 address?. Today the maximum address is 0x4F but this can change in the future. obviusly is a minor change but i think it is positive.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SV-Zanshin/INA/pull/65#issuecomment-680710107 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFT5DRGVYNMMTR45PAJBFJDSCS2T7ANCNFSM4QKRPZMA . https://github.com/notifications/beacon/AFT5DRFJHW6CJEDQBZ3IT3LSCS2T7A5CNFSM4QKRPZMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFCJM7WY.gif