1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

pios_i2c.c: last commit broke reading; need to ack the incoming bytes

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@252 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
FredericG 2010-03-05 18:36:28 +00:00 committed by FredericG
parent 595a8f2cef
commit dd429536f7

View File

@ -386,6 +386,8 @@ int32_t PIOS_I2C_Transfer(I2CTransferTypeDef transfer, uint8_t address, uint8_t
/* Ensure that previous TX buffer won't be accessed */
i2cx->tx_buffer_ptr = NULL;
i2cx->rx_buffer_ptr = buffer;
// Ack the bytes we will be getting
I2C_AcknowledgeConfig(i2cx->base, ENABLE);
} else if(transfer == I2C_Write || transfer == I2C_Write_WithoutStop) {
/* Take new address/buffer/len */
/* Clear bit 0 for write operation */