Fix default OV5640 SYSTEM_CTROL0 value in sleep()

This commit is contained in:
iabdalkader 2021-01-21 19:44:20 +02:00
parent 6954b6d858
commit eccaeb111b

View File

@ -697,15 +697,13 @@ static int reset(sensor_t *sensor)
static int sleep(sensor_t *sensor, int enable)
{
uint8_t reg;
int ret = cambus_readb2(&sensor->bus, sensor->slv_addr, SYSTEM_CTROL0, &reg);
if (enable) {
reg |= 0x42;
reg = 0x42;
} else {
reg &= ~0x42;
reg = 0x02;
}
return cambus_writeb2(&sensor->bus, sensor->slv_addr, SYSTEM_CTROL0, reg) | ret;
return cambus_writeb2(&sensor->bus, sensor->slv_addr, SYSTEM_CTROL0, reg);
}
static int read_reg(sensor_t *sensor, uint16_t reg_addr)