Skip to content
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

I2C: Reduce timeout on F7 from 10s to 10ms #4753

Merged
merged 1 commit into from
May 27, 2019
Merged
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
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