From: Jean-François Nguyen Date: Tue, 18 May 2021 17:11:39 +0000 (+0200) Subject: periph.event: clear pending bits of level-triggered events. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a1c05e8edb8c821b92d11b8d9f5577ac7f5ce8b;p=lambdasoc.git periph.event: clear pending bits of level-triggered events. --- diff --git a/lambdasoc/periph/event.py b/lambdasoc/periph/event.py index 53df4aa..87b631f 100644 --- a/lambdasoc/periph/event.py +++ b/lambdasoc/periph/event.py @@ -127,8 +127,11 @@ class InterruptSource(Elaboratable): else: assert False # :nocov: - with m.If(event_trigger): - m.d.sync += self.pending.r_data[i].eq(1) + if event.mode == "level": + m.d.sync += self.pending.r_data[i].eq(event_trigger) + else: + with m.If(event_trigger): + m.d.sync += self.pending.r_data[i].eq(1) m.d.comb += self.irq.eq((self.pending.r_data & self.enable.r_data).any())