sparkfun / SparkFun_I2C_GPS_Arduino_Library

Library for reading and controlling MT3333 and MT3339 based GPS modules over I2C.
Other
18 stars 13 forks source link

mBed port #5

Closed idea--list closed 4 years ago

idea--list commented 4 years ago

Hi there, I ported this library to mBed and am ready to share that. My question is: would you prefer keeping separate versions for Arduino and mBed or shall merge them together by using preprocessor rules?

nseidle commented 4 years ago

Happy to merge it here if you'd like.

idea--list commented 4 years ago

Seems i was telling too early. If i run the original Arduino code on the same board then the GPS module begins to communicate via I2C, interestigly if i run my ported mbed version now I2CGPS::begin returns true and the mbed port can advance to I2C::check, I2C::availaible and I2CGPS::read methods which seem to work right.

However if i cut power and restart the board, i can not fetch any data as the mbed version of I2CGPS::begin fails to do its job. I already reviewed my code but i can not find the root of this bug, so i can not apply a fix.

Update: it seems i could resolve the issue. Problem was that the GPIO pins of my board behave somewhat different in Arduino than in mBed. As of now the current is constant on all the pins and the ported version of I2CGPS::begin works as expected.

This however shows that mbed is far more complex and will need more thorough testing before i can commit my code.

idea--list commented 4 years ago

@nseidle Just made PR #6 , please review and try it if that works as expected as i could test it only on 1 target.