Skip to content

Commit

Permalink
Fixes #2103: calculate memory depth for WS2812
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Oct 25, 2024
1 parent c122573 commit 2f99c57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion litex/soc/cores/led.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def __init__(self, pad, nleds, sys_clk_freq, bus_mastering=False, bus_base=None,
self.bus = bus = wishbone.Interface(data_width=32, address_width=32, addressing="word")
else:
# Memory.
mem = Memory(32, nleds, init=init)
mem_depth = max(nleds, 2)
mem = Memory(32, mem_depth, init=init)
port = mem.get_port()
self.specials += mem, port

Expand Down

0 comments on commit 2f99c57

Please sign in to comment.