Skip to content

Commit 426aec2

Browse files
committed
fuck it 4
1 parent c81e329 commit 426aec2

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/modm/platform/dma/stm32/dma.hpp.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public:
369369
%% if signal.instance is defined
370370
%% set peripheral = peripheral ~ signal.instance
371371
%% else
372-
%% if peripheral in ["Lpuart", "Swpmi"]
372+
%% if peripheral in ["Dac", "Lpuart", "Swpmi"] and target["family"] not in ["f1"]
373373
%% set peripheral = peripheral ~ 1
374374
%% endif
375375
%% endif
@@ -395,7 +395,7 @@ struct DmaController<{{ channels.instance }}>::Channel<DmaBase::Channel::Channel
395395
%% if signal.instance is defined
396396
%% set peripheral = peripheral ~ signal.instance
397397
%% else
398-
%% if peripheral in ["Lpuart", "Swpmi"]
398+
%% if peripheral in ["Dac", "Lpuart", "Swpmi"] and target["family"] not in ["f1"]
399399
%% set peripheral = peripheral ~ 1
400400
%% endif
401401
%% endif

src/modm/platform/dma/stm32/module.lb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ def prepare(module, options):
3232
if did["family"] in ["f0"] and did["name"] in ["91", "98"]:
3333
return False
3434

35-
if not (did["family"] in ["l4"] \
36-
or did["family"] in ["f0"] and did["name"] in ["42", "72"] \
37-
or did["family"] in ["f3"] and did["name"] in ["03"] \
35+
# Enable DMA only for some devices...
36+
if not ( \
37+
(did["family"] in ["l4"]) \
38+
or (did["family"] in ["f0"] and did["name"] not in ["30", "70", "71", "72", "78"]) \
39+
or (did["family"] in ["f3"] and did["name"] not in ["73", "78"]) \
3840
):
3941
return False
4042

43+
4144
module.depends(":cmsis:device", ":platform:rcc")
4245

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

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

8082
signal_names = sorted(list(set(signal_names)))
8183
properties["dmaType"] = dma["type"]
@@ -85,7 +87,7 @@ def build(env):
8587
properties["irqList"] = dict()
8688
for channels in dma["channels"]:
8789
irqs = [v["name"] for v in device.get_driver("core")["vector"]]
88-
irqs = [v for v in irqs if v.startswith("DMA" + channels["instance"])]
90+
irqs = [v for v in irqs if v.startswith("DMA" + channels["instance"]) and not "DMA2D" in v]
8991
irq_list = list()
9092
for irq in irqs:
9193
irq_channel_list = []

0 commit comments

Comments
 (0)