mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Use a different timeout for cambus/i2c scanning.
This commit is contained in:
parent
b652e6625a
commit
193ea31ec3
@ -15,7 +15,8 @@
|
||||
#include "omv_boardconfig.h"
|
||||
#include "cambus.h"
|
||||
#define I2C_FREQUENCY (100000)
|
||||
#define I2C_TIMEOUT (100)
|
||||
#define I2C_TIMEOUT (1000)
|
||||
#define I2C_SCAN_TIMEOUT (100)
|
||||
|
||||
int cambus_init(I2C_HandleTypeDef *i2c, I2C_TypeDef *instance, uint32_t timing)
|
||||
{
|
||||
@ -78,7 +79,7 @@ int cambus_deinit(I2C_HandleTypeDef *i2c)
|
||||
int cambus_scan(I2C_HandleTypeDef *i2c)
|
||||
{
|
||||
for (uint8_t addr=0x09; addr<=0x77; addr++) {
|
||||
if (HAL_I2C_IsDeviceReady(i2c, addr << 1, 10, I2C_TIMEOUT) == HAL_OK) {
|
||||
if (HAL_I2C_IsDeviceReady(i2c, addr << 1, 10, I2C_SCAN_TIMEOUT) == HAL_OK) {
|
||||
return (addr << 1);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user