Skip to content

Commit

Permalink
Fix CDONE pin polling rate
Browse files Browse the repository at this point in the history
  • Loading branch information
renzenicolai committed Aug 15, 2022
1 parent 4084d37 commit 12051d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions i2c_peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once

#define FW_VERSION 0x0B
#define FW_VERSION 0x0C

0 comments on commit 12051d9

Please sign in to comment.