mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix default OV5640 SYSTEM_CTROL0 value in sleep()
This commit is contained in:
parent
a24a9b6202
commit
6954b6d858
@ -644,6 +644,7 @@ static const uint8_t saturation_regs[NUM_SATURATION_LEVELS][6] = {
|
||||
|
||||
static int reset(sensor_t *sensor)
|
||||
{
|
||||
int ret = 0;
|
||||
readout_x = 0;
|
||||
readout_y = 0;
|
||||
|
||||
@ -653,7 +654,7 @@ static int reset(sensor_t *sensor)
|
||||
hts_target = 0;
|
||||
|
||||
// Reset all registers
|
||||
int ret = cambus_writeb2(&sensor->bus, sensor->slv_addr, SCCB_SYSTEM_CTRL_1, 0x11);
|
||||
ret |= cambus_writeb2(&sensor->bus, sensor->slv_addr, SCCB_SYSTEM_CTRL_1, 0x11);
|
||||
ret |= cambus_writeb2(&sensor->bus, sensor->slv_addr, SYSTEM_CTROL0, 0x82);
|
||||
|
||||
// Delay 5 ms
|
||||
@ -699,9 +700,9 @@ static int sleep(sensor_t *sensor, int enable)
|
||||
int ret = cambus_readb2(&sensor->bus, sensor->slv_addr, SYSTEM_CTROL0, ®);
|
||||
|
||||
if (enable) {
|
||||
reg |= 0x40;
|
||||
reg |= 0x42;
|
||||
} else {
|
||||
reg &= ~0x40;
|
||||
reg &= ~0x42;
|
||||
}
|
||||
|
||||
return cambus_writeb2(&sensor->bus, sensor->slv_addr, SYSTEM_CTROL0, reg) | ret;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user