diff --git a/i2c_peripheral.c b/i2c_peripheral.c index 234f157..5571fe4 100644 --- a/i2c_peripheral.c +++ b/i2c_peripheral.c @@ -324,6 +324,13 @@ void i2c_task() { if (input2_value != i2c_registers.registers[I2C_REGISTER_INPUT2]) interrupt_target = true; i2c_registers.registers[I2C_REGISTER_INTERRUPT2] |= (input2_value ^ i2c_registers.registers[I2C_REGISTER_INPUT2]); i2c_registers.registers[I2C_REGISTER_INPUT2] = input2_value; + } else { + // The CDONE pin is part of the input register but should not be polled slowly, so if we're not polling the other buttons just read the FPGA cdone pin and update the register + if (!gpio_get(FPGA_CDONE)) { + i2c_registers.registers[I2C_REGISTER_INPUT1] |= 1 << 5; + } else { + i2c_registers.registers[I2C_REGISTER_INPUT1] &= ~(1 << 5); + } } #ifdef NDEBUG diff --git a/version.h b/version.h index 6e1e3fd..253700b 100644 --- a/version.h +++ b/version.h @@ -1,3 +1,3 @@ #pragma once -#define FW_VERSION 0x0B +#define FW_VERSION 0x0C