quicklogic_quickfeather: Fix build with GPIOIn when cpu-type=None (IRQ not supported).

This commit is contained in:
Florent Kermarrec 2021-11-14 09:30:52 +01:00
parent ed67b91fcc
commit 138dc1467e

View file

@ -46,7 +46,7 @@ class _CRG(Module):
# BaseSoC ------------------------------------------------------------------------------------------
class BaseSoC(SoCCore):
def __init__(self, sys_clk_freq=int(10e6), with_led_chaser=True, with_gpioin=True, **kwargs):
def __init__(self, sys_clk_freq=int(10e6), with_led_chaser=True, with_gpio_in=True, **kwargs):
platform = quicklogic_quickfeather.Platform()
# SoCCore ----------------------------------------------------------------------------------
@ -60,17 +60,18 @@ class BaseSoC(SoCCore):
# CRG --------------------------------------------------------------------------------------
self.submodules.crg = _CRG(platform, with_eos_s3=kwargs["cpu_type"] == "eos-s3")
# GPIOIn -> interrupt test
if with_gpioin:
self.submodules.gpio = GPIOIn(
pads = platform.request_all("user_btn_n"), with_irq=True)
self.irq.add("gpio", use_loc_if_exists=True)
# Leds -------------------------------------------------------------------------------------
if with_led_chaser:
self.submodules.leds = LedChaser(
pads = platform.request_all("user_led"),
sys_clk_freq = sys_clk_freq)
# GPIOIn (Interrupt test) ------------------------------------------------------------------
if with_gpio_in:
self.submodules.gpio = GPIOIn(platform.request_all("user_btn_n"), with_irq=True)
if kwargs["cpu_type"] == "eos-s3":
self.irq.add("gpio", use_loc_if_exists=True)
# Build --------------------------------------------------------------------------------------------
def main():