Skip to content

Commit

Permalink
Merge pull request #4753 from iNavFlight/agh_i2c_hal_timeout
Browse files Browse the repository at this point in the history
I2C: Reduce timeout on F7 from 10s to 10ms
  • Loading branch information
digitalentity authored May 27, 2019
2 parents 01d4c34 + ae8d97f commit 61f79cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/drivers/bus_i2c_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ static i2cDevice_t i2cHardwareMap[] = {

static volatile uint16_t i2cErrorCount = 0;

#define I2C_DEFAULT_TIMEOUT 10000
// Note that I2C_TIMEOUT is in us, while the HAL
// functions expect the timeout to be in ticks.
// Since we're setting up the ticks a 1khz, each
// tick equals 1ms.
#define I2C_DEFAULT_TIMEOUT (I2C_TIMEOUT / 1000)

typedef struct i2cState_s {
volatile bool initialised;
Expand Down

0 comments on commit 61f79cf

Please sign in to comment.