io ctrl button polarity change

fixing_gr_cariboulite
David Michaeli 2024-01-29 11:25:26 +02:00
rodzic 0ed53aa3ff
commit 35e832e25d
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -267,7 +267,13 @@ int cariboulite_get_leds_state (int *led0, int *led1)
//=============================================================================
int cariboulite_get_button_state (int *btn)
{
return caribou_fpga_get_io_ctrl_dig (&sys.fpga, NULL, NULL, btn, NULL);
int btn_temp = 0;
int ret = caribou_fpga_get_io_ctrl_dig (&sys.fpga, NULL, NULL, &btn_temp, NULL);
// its open collector style - we need to negate
if (btn) *btn = !btn_temp;
return ret;
}
//=============================================================================