Skip to content

Commit

Permalink
Change for Issue #30
Browse files Browse the repository at this point in the history
  • Loading branch information
SV-Zanshin authored and SV-Zanshin committed Oct 17, 2018
1 parent 8c39910 commit f547a74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/INA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,19 @@ uint8_t INA_Class::begin(const uint8_t maxBusAmps, const uint32_t microOhmR, con
uint16_t originalRegister,tempRegister; // Stores 16-bit register contents //
if (_DeviceCount==0) // Enumerate devices in first call //
{ // //
uint8_t maxDevices = 0; // declare variable //
#if defined(ESP32) || defined(ESP2866) // //
EEPROM.begin(512); // If ESP32 then allocate 512 Bytes //
maxDevices = 512 / sizeof(inaEE); // and compute number of devices //
#else
Wire.begin(); // Start I2C communications //
#endif // //
#ifdef __STM32F1__ // Emulated EEPROM for STM32F1 //
uint8_t maxDevices = EEPROM.maxcount() / sizeof(inaEE); // Compute number devices possible //
maxDevices = EEPROM.maxcount() / sizeof(inaEE); // Compute number devices possible //
#elif defined(CORE_TEENSY) // TEENSY doesn't have EEPROM.length//
maxDevices = 2048 / sizeof(inaEE); // defined, so use 2Kb as value //
#else // EEPROM Library V2.0 for Arduino //
uint8_t maxDevices = EEPROM.length() / sizeof(inaEE); // Compute number devices possible //
maxDevices = EEPROM.length() / sizeof(inaEE); // Compute number devices possible //
#endif // //
for(uint8_t deviceAddress = 0x40;deviceAddress<0x80;deviceAddress++) // Loop for each possible address //
{ // //
Expand Down

0 comments on commit f547a74

Please sign in to comment.