From: Andrey Miroshnikov Date: Wed, 9 Mar 2022 17:28:20 +0000 (+0000) Subject: Fixed issue with single gpio not working X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7fae12dc880f174f9e75b6c4e2a9112e51446d7a;p=pinmux.git Fixed issue with single gpio not working --- diff --git a/src/spec/simple_gpio.py b/src/spec/simple_gpio.py index 2e0d31b..25c3b5a 100644 --- a/src/spec/simple_gpio.py +++ b/src/spec/simple_gpio.py @@ -297,7 +297,7 @@ class GPIOManager(): curr_gpio = row_addr * self.wordsize config_word = 0 for byte in range(0, self.wordsize): - if curr_gpio > self.n_gpios: + if curr_gpio >= self.n_gpios: break config_word += self.shadow_csr[curr_gpio].packed << (8 * byte) #print("Reading GPIO{} shadow reg".format(curr_gpio)) @@ -317,7 +317,7 @@ class GPIOManager(): curr_gpio = row_addr * self.wordsize single_csr = 0 for byte in range(0, self.wordsize): - if curr_gpio > self.n_gpios: + if curr_gpio >= self.n_gpios: break single_csr = (read_word >> (8 * byte)) & 0xFF #print("Updating GPIO{0} shadow reg to {1:x}"