NAK I²C write when EDID protected

hdmi_firewall
King Kévin 6 months ago
parent 8bc856095e
commit 888a5af823
  1. 6
      main.c

@ -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
}
}

Loading…
Cancel
Save