NAK I²C write when EDID protected

This commit is contained in:
King Kévin 2022-12-07 11:18:40 +01:00
parent 8bc856095e
commit 888a5af823
1 changed files with 5 additions and 1 deletions

6
main.c
View File

@ -580,7 +580,11 @@ void i2c(void) __interrupt(IRQ_I2C) // auto wakeup
I2C_DR = *(uint8_t*)(EEPROM_ADDR + i2c_addr++); // transmit selected byte
i2c_input_new = false; // notify we send data
} else { // we will receive data
I2C_CR2 |= I2C_CR2_ACK; // ACK next received byte
if (EDID_PORT->IDR.reg & EDID_PIN) { // EDID switched off
I2C_CR2 &= I2C_CR2_ACK; // NACK next received byte to indicate programming it disabled
} else {
I2C_CR2 |= I2C_CR2_ACK; // ACK next received byte
}
i2c_input_new = true; // notify we get data
}
}