Skip to content

Commit 14c84ee

Browse files
committed
fix: ensure we can read ROM even when some on the ui_in DIP switches are on
1 parent 6372807 commit 14c84ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ttboard/demoboard.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,17 @@ def __init__(self,
138138
ports = ['uo_out', 'ui_in', 'uio_in', 'uio_out', 'uio_oe_pico']
139139
for p in ports:
140140
setattr(self, p, getattr(self.pins, p))
141-
141+
142+
# Make sure we can read the ROM even if the user has set some of the ui_in DIP switches
143+
pins_mode = self.pins.mode
144+
self.pins.dieOnInputControlSwitchHigh = False
145+
self.pins.mode = pins_mode # force re-init of pins to apply new setting
142146
self.shuttle = Globals.project_mux(self.user_config.force_shuttle)
143147
if self.shuttle.run == 'tt07':
144-
pins_mode = self.pins.mode
145148
GPIOMapTT06.tt07_cb_fix = True
146149
self.pins.mode = pins_mode # force re-init of pins to apply new pin map
150+
self.pins.dieOnInputControlSwitchHigh = True
151+
self.pins.mode = pins_mode # force re-init of pins to apply new setting
147152

148153
# config
149154
self.apply_configs = apply_user_config

0 commit comments

Comments
 (0)