From 7fae12dc880f174f9e75b6c4e2a9112e51446d7a Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Wed, 9 Mar 2022 17:28:20 +0000 Subject: [PATCH] Fixed issue with single gpio not working --- src/spec/simple_gpio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}" -- 2.30.2