1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Fix in bmp085 driver. Was not checking correctly if lock on I2C succeeded => caused an assert when used in combination with other I2C devices

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1163 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
FredericG 2010-07-27 09:52:45 +00:00 committed by FredericG
parent efaa6c910b
commit 66e22b56ce

View File

@ -199,7 +199,8 @@ int32_t PIOS_BMP085_GetPressure(void)
int32_t PIOS_BMP085_Read(uint8_t address, uint8_t *buffer, uint8_t len)
{
/* Try to get the I2C peripheral */
if(PIOS_I2C_LockDevice(0) < 0) {
if(PIOS_I2C_LockDevice(0) == FALSE)
{
/* Request a retry */
return -2;
}
@ -233,7 +234,8 @@ int32_t PIOS_BMP085_Read(uint8_t address, uint8_t *buffer, uint8_t len)
int32_t PIOS_BMP085_Write(uint8_t address, uint8_t buffer)
{
/* Try to get the IIC peripheral */
if(PIOS_I2C_LockDevice(0) < 0) {
if(PIOS_I2C_LockDevice(0) == FALSE)
{
/* Request a retry */
return -2;
}