1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

Fix I2C timeout

Makes I2C timeout independent of system clock speed.
Timeout is now in microseconds and is set to 10000us(same as in INAV).
This commit is contained in:
Hans Christian Olaussen 2021-03-23 22:45:21 +01:00
parent 76d9babab6
commit bb6cb9ebfe
4 changed files with 50 additions and 43 deletions

View file

@ -25,9 +25,8 @@
#include "drivers/io_types.h"
#include "drivers/rcc_types.h"
#define I2C_SHORT_TIMEOUT ((uint32_t)0x1000)
#define I2C_LONG_TIMEOUT ((uint32_t)(10 * I2C_SHORT_TIMEOUT))
#define I2C_DEFAULT_TIMEOUT I2C_SHORT_TIMEOUT
#define I2C_TIMEOUT_US 10000
#define I2C_TIMEOUT_SYS_TICKS (I2C_TIMEOUT_US / 1000)
#define I2C_PIN_SEL_MAX 4