Merge pull request #2166 from kwagyeman/kwabena/fix_gc2145_vflip_hmirror

sensors/gc2145: Fix hmirror and vflip.
This commit is contained in:
Ibrahim Abdelkader 2024-02-26 21:58:13 +02:00 committed by GitHub
commit 6f86a2b78c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -893,6 +893,9 @@ static int set_framesize(sensor_t *sensor, framesize_t framesize) {
static int set_hmirror(sensor_t *sensor, int enable) {
int ret = 0;
uint8_t reg;
#if (OMV_GC2145_ROTATE == 1)
enable = !enable;
#endif
// P0 regs
ret |= omv_i2c_writeb(&sensor->i2c_bus, sensor->slv_addr, 0xFE, 0x00);
@ -904,6 +907,9 @@ static int set_hmirror(sensor_t *sensor, int enable) {
static int set_vflip(sensor_t *sensor, int enable) {
int ret = 0;
uint8_t reg;
#if (OMV_GC2145_ROTATE == 1)
enable = !enable;
#endif
// P0 regs
ret |= omv_i2c_writeb(&sensor->i2c_bus, sensor->slv_addr, 0xFE, 0x00);