From 2f5212f4ec5a189908c53184bb3c30d2b49a3fcd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 3 Aug 2018 07:47:33 +0100 Subject: [PATCH] read config mux and output to slow_peripherals.bsv --- src/bsv/peripheral_gen/gpio.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bsv/peripheral_gen/gpio.py b/src/bsv/peripheral_gen/gpio.py index b9f8504..095d654 100644 --- a/src/bsv/peripheral_gen/gpio.py +++ b/src/bsv/peripheral_gen/gpio.py @@ -36,8 +36,10 @@ class gpio(PBase): def mkslow_peripheral(self, size=0): print "gpioslow", self.peripheral, dir(self.peripheral) + print "gpioslow", self.peripheral.configs size = len(self.peripheral.pinspecs) - dflt = "%s" % ("0"*size*2) # XX TODO: read default from config + dflt_ = "%s" % ("0"*size*2) # default if not set in spec + dflt = self.peripheral.configs[0].get("muxconfig", dflt_) return "MUX#(%d) mux{0} <- mkmux(`b%s);\n" % (size, dflt)+ \ "GPIO#(%d) gpio{0} <- mkgpio();" % size -- 2.30.2