Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize FuelGauge to also use alternative I2C interfaces (2nd atte… #1443

Merged
merged 3 commits into from Jan 22, 2018

Conversation

@ScruffR
Copy link
Contributor

commented Dec 2, 2017

To enable Particle Power Shield to use spark_wiring_fuel without extra
library as mentioned in connection with this issue
#1275

Replaces PR #1297 (since I couldn't rebase my original repo 😊)

ScruffR added 2 commits Dec 2, 2017
@ScruffR

This comment has been minimized.

Copy link
Contributor Author

commented Dec 2, 2017

As with my PR before, only the unit-tests fail and I could build the tests locally as mentioned by @m-mcgowan here but I've no clue what to change in the unit-test to make them build.
IMO the references should not be undefined.

The following directory should be added to compiler include paths:
    /root/.ci/boost/boost_1_59_0
The following directory should be added to linker library paths:
    /root/.ci/boost/boost_1_59_0/stage/lib
/firmware
obj/core-firmware/wiring/src/spark_wiring_fuel.o: In function `FuelGauge::begin()':
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:51: undefined reference to `__fetch_global_Wire()'
obj/core-firmware/wiring/src/spark_wiring_fuel.o: In function `FuelGauge::begin(TwoWire&)':
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:62: undefined reference to `TwoWire::isEnabled()'
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:63: undefined reference to `TwoWire::begin()'
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:64: undefined reference to `TwoWire::isEnabled()'
obj/core-firmware/wiring/src/spark_wiring_fuel.o: In function `FuelGauge::readRegister(unsigned char, unsigned char&, unsigned char&)':
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:238: undefined reference to `TwoWire::beginTransmission(int)'
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:240: undefined reference to `TwoWire::endTransmission(unsigned char)'
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:242: undefined reference to `TwoWire::requestFrom(int, int, int)'
obj/core-firmware/wiring/src/spark_wiring_fuel.o: In function `FuelGauge::writeRegister(unsigned char, unsigned char, unsigned char)':
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:254: undefined reference to `TwoWire::beginTransmission(int)'
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:258: undefined reference to `TwoWire::endTransmission(unsigned char)'
obj/core-firmware/wiring/src/spark_wiring_fuel.o: In function `FuelGauge::lock()':
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:267: undefined reference to `TwoWire::lock()'
obj/core-firmware/wiring/src/spark_wiring_fuel.o: In function `FuelGauge::unlock()':
/firmware/user/tests/unit/../../../wiring/src/spark_wiring_fuel.cpp:277: undefined reference to `TwoWire::unlock()'
collect2: error: ld returned 1 exit status
make: *** [obj/runner] Error 1
Error: Problem building unit tests. Please see build.log

If anybody could point me the the way, I'd update that PR again.

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2018

The fixes for the unit tests are here - https://github.com/particle-iot/firmware/tree/ScruffR-develop. Please merge these into your branch.

Btw, it's a good idea to use a separate branch for each PR rather than submitting a PR off of the develop branch, or the PR will change each time you push changes to that general develop branch.

boolean FuelGauge::begin(TwoWire& i2c)
{
_i2c = &i2c;
/* as per comment of Mat pointers will always be initialzed

This comment has been minimized.

Copy link
@m-mcgowan

m-mcgowan Jan 18, 2018

Contributor

It's probably a good idea to remove the commented out code so it doesn't create confusion.

This comment has been minimized.

Copy link
@ScruffR

ScruffR Jan 18, 2018

Author Contributor

Sorry, I'm not that familiar with Git so I misunderstood this request of yours in #1297

Also please rebase on develop, thanks :-)

@m-mcgowan m-mcgowan added this to the 0.8.0-rc.2 milestone Jan 18, 2018

@m-mcgowan m-mcgowan merged commit 76eb0a4 into particle-iot:develop Jan 22, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.