Skip to content

Commit

Permalink
fuck it 4
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed Apr 6, 2021
1 parent c81e329 commit 426aec2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/modm/platform/dma/stm32/dma.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public:
%% if signal.instance is defined
%% set peripheral = peripheral ~ signal.instance
%% else
%% if peripheral in ["Lpuart", "Swpmi"]
%% if peripheral in ["Dac", "Lpuart", "Swpmi"] and target["family"] not in ["f1"]
%% set peripheral = peripheral ~ 1
%% endif
%% endif
Expand All @@ -395,7 +395,7 @@ struct DmaController<{{ channels.instance }}>::Channel<DmaBase::Channel::Channel
%% if signal.instance is defined
%% set peripheral = peripheral ~ signal.instance
%% else
%% if peripheral in ["Lpuart", "Swpmi"]
%% if peripheral in ["Dac", "Lpuart", "Swpmi"] and target["family"] not in ["f1"]
%% set peripheral = peripheral ~ 1
%% endif
%% endif
Expand Down
18 changes: 10 additions & 8 deletions src/modm/platform/dma/stm32/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ def prepare(module, options):
if did["family"] in ["f0"] and did["name"] in ["91", "98"]:
return False

if not (did["family"] in ["l4"] \
or did["family"] in ["f0"] and did["name"] in ["42", "72"] \
or did["family"] in ["f3"] and did["name"] in ["03"] \
# Enable DMA only for some devices...
if not ( \
(did["family"] in ["l4"]) \
or (did["family"] in ["f0"] and did["name"] not in ["30", "70", "71", "72", "78"]) \
or (did["family"] in ["f3"] and did["name"] not in ["73", "78"]) \
):
return False


module.depends(":cmsis:device", ":platform:rcc")

return True
Expand Down Expand Up @@ -72,10 +75,9 @@ def build(env):
controller.append({"instance": int(channels["instance"]), "channels": int(max_channels)})

did = device.identifier
if did.family in ['f0']:
if (did.name == '30' and did.size == 'c'):
print("FIXME: Bug in modm-deviced data: Dma2 does not exist on " + str(device.identifier))
properties["dma"]["instance"].remove('2')
if (did.family in ['f0'] and did.name == '30' and did.size == 'c') or (did.family in ['f1'] and did.name == '02'):
print("FIXME: Bug in modm-deviced data: Dma2 does not exist on " + str(device.identifier))
properties["dma"]["instance"].remove('2')

signal_names = sorted(list(set(signal_names)))
properties["dmaType"] = dma["type"]
Expand All @@ -85,7 +87,7 @@ def build(env):
properties["irqList"] = dict()
for channels in dma["channels"]:
irqs = [v["name"] for v in device.get_driver("core")["vector"]]
irqs = [v for v in irqs if v.startswith("DMA" + channels["instance"])]
irqs = [v for v in irqs if v.startswith("DMA" + channels["instance"]) and not "DMA2D" in v]
irq_list = list()
for irq in irqs:
irq_channel_list = []
Expand Down

0 comments on commit 426aec2

Please sign in to comment.