v2.0.14 - correct #61 - thank you @Valrakk
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name=SparkFun u-blox GNSS Arduino Library
|
name=SparkFun u-blox GNSS Arduino Library
|
||||||
version=2.0.13
|
version=2.0.14
|
||||||
author=SparkFun Electronics <techsupport@sparkfun.com>
|
author=SparkFun Electronics <techsupport@sparkfun.com>
|
||||||
maintainer=SparkFun Electronics <sparkfun.com>
|
maintainer=SparkFun Electronics <sparkfun.com>
|
||||||
sentence=Library for I2C and Serial Communication with u-blox GNSS modules<br/><br/>
|
sentence=Library for I2C and Serial Communication with u-blox GNSS modules<br/><br/>
|
||||||
|
|||||||
@@ -2933,7 +2933,6 @@ sfe_ublox_status_e SFE_UBLOX_GNSS::sendI2cCommand(ubxPacket *outgoingUBX, uint16
|
|||||||
len = i2cTransactionSize;
|
len = i2cTransactionSize;
|
||||||
|
|
||||||
_i2cPort->beginTransmission((uint8_t)_gpsI2Caddress);
|
_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++)
|
for (uint16_t x = 0; x < len; x++)
|
||||||
_i2cPort->write(outgoingUBX->payload[startSpot + x]); //Write a portion of the payload to the bus
|
_i2cPort->write(outgoingUBX->payload[startSpot + x]); //Write a portion of the payload to the bus
|
||||||
@@ -2941,21 +2940,23 @@ sfe_ublox_status_e SFE_UBLOX_GNSS::sendI2cCommand(ubxPacket *outgoingUBX, uint16
|
|||||||
if (_i2cPort->endTransmission(false) != 0) //Don't release bus
|
if (_i2cPort->endTransmission(false) != 0) //Don't release bus
|
||||||
return (SFE_UBLOX_STATUS_I2C_COMM_FAILURE); //Sensor did not ACK
|
return (SFE_UBLOX_STATUS_I2C_COMM_FAILURE); //Sensor did not ACK
|
||||||
|
|
||||||
//*outgoingUBX->payload += len; //Move the pointer forward
|
|
||||||
startSpot += len; //Move the pointer forward
|
startSpot += len; //Move the pointer forward
|
||||||
bytesToSend -= len;
|
bytesToSend -= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Write checksum
|
|
||||||
_i2cPort->beginTransmission((uint8_t)_gpsI2Caddress);
|
_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->checksumA);
|
||||||
_i2cPort->write(outgoingUBX->checksumB);
|
_i2cPort->write(outgoingUBX->checksumB);
|
||||||
|
|
||||||
//All done transmitting bytes. Release bus.
|
//All done transmitting bytes. Release bus.
|
||||||
if (_i2cPort->endTransmission() != 0)
|
if (_i2cPort->endTransmission() != 0)
|
||||||
return (SFE_UBLOX_STATUS_I2C_COMM_FAILURE); //Sensor did not ACK
|
return (SFE_UBLOX_STATUS_I2C_COMM_FAILURE); //Sensor did not ACK
|
||||||
|
|
||||||
return (SFE_UBLOX_STATUS_SUCCESS);
|
return (SFE_UBLOX_STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user