Merge pull request #1396 from openmv/sensor_utils

Allow sensor_utils probe_init to take bus id/speed args.
This commit is contained in:
Ibrahim Abd Elkader 2021-07-15 22:12:25 +02:00 committed by GitHub
commit 1fd2564537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -259,7 +259,7 @@ void sensor_init0();
int sensor_init();
// Detect and initialize the image sensor.
int sensor_probe_init();
int sensor_probe_init(uint32_t bus_id, uint32_t bus_speed);
// Configure DCMI hardware interface.
int sensor_dcmi_config(uint32_t pixformat);

View File

@ -166,7 +166,7 @@ __weak int sensor_reset()
return 0;
}
int sensor_probe_init()
int sensor_probe_init(uint32_t bus_id, uint32_t bus_speed)
{
int init_ret = 0;
@ -192,7 +192,7 @@ int sensor_probe_init()
mp_hal_delay_ms(10);
// Initialize the camera bus.
cambus_init(&sensor.bus, ISC_I2C_ID, ISC_I2C_SPEED);
cambus_init(&sensor.bus, bus_id, bus_speed);
mp_hal_delay_ms(10);
// Probe the sensor

View File

@ -73,7 +73,7 @@ int sensor_init()
}
// Detect and initialize the image sensor.
if ((init_ret = sensor_probe_init()) != 0) {
if ((init_ret = sensor_probe_init(ISC_I2C_ID, ISC_I2C_SPEED)) != 0) {
// Sensor probe/init failed.
return init_ret;
}

View File

@ -99,7 +99,7 @@ int sensor_init()
}
// Detect and initialize the image sensor.
if ((init_ret = sensor_probe_init()) != 0) {
if ((init_ret = sensor_probe_init(ISC_I2C_ID, ISC_I2C_SPEED)) != 0) {
// Sensor probe/init failed.
return init_ret;
}

View File

@ -134,7 +134,7 @@ int sensor_init()
}
// Detect and initialize the image sensor.
if ((init_ret = sensor_probe_init()) != 0) {
if ((init_ret = sensor_probe_init(ISC_I2C_ID, ISC_I2C_SPEED)) != 0) {
// Sensor probe/init failed.
return init_ret;
}