Skip to content

v2.0.14 - correct #61 - thank you @Valrakk #62

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

Merged
merged 1 commit into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun u-blox GNSS Arduino Library
version=2.0.13
version=2.0.14
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for I2C and Serial Communication with u-blox GNSS modules<br/><br/>
Expand Down
11 changes: 6 additions & 5 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2933,29 +2933,30 @@ sfe_ublox_status_e SFE_UBLOX_GNSS::sendI2cCommand(ubxPacket *outgoingUBX, uint16
len = i2cTransactionSize;

_i2cPort->beginTransmission((uint8_t)_gpsI2Caddress);
//_i2cPort->write(outgoingUBX->payload, len); //Write a portion of the payload to the bus

for (uint16_t x = 0; x < len; x++)
_i2cPort->write(outgoingUBX->payload[startSpot + x]); //Write a portion of the payload to the bus

if (_i2cPort->endTransmission(false) != 0) //Don't release bus
return (SFE_UBLOX_STATUS_I2C_COMM_FAILURE); //Sensor did not ACK

//*outgoingUBX->payload += len; //Move the pointer forward
startSpot += len; //Move the pointer forward
bytesToSend -= len;
}

//Write checksum
_i2cPort->beginTransmission((uint8_t)_gpsI2Caddress);
if (bytesToSend == 1)
_i2cPort->write(outgoingUBX->payload, 1);

if (bytesToSend == 1) //Send the single remaining byte if there is one
_i2cPort->write(outgoingUBX->payload[startSpot], 1); // Thank you @Valrakk #61

//Write checksum
_i2cPort->write(outgoingUBX->checksumA);
_i2cPort->write(outgoingUBX->checksumB);

//All done transmitting bytes. Release bus.
if (_i2cPort->endTransmission() != 0)
return (SFE_UBLOX_STATUS_I2C_COMM_FAILURE); //Sensor did not ACK

return (SFE_UBLOX_STATUS_SUCCESS);
}

Expand Down