@@ -21,6 +21,8 @@ def init(module):
21
21
def prepare (module , options ):
22
22
device = options [":target" ]
23
23
24
+ module .depends (":cmsis:device" , ":platform:rcc" )
25
+
24
26
if (not device .has_driver ("dma" )) or device .get_driver ("dma" )["type" ] not in \
25
27
[
26
28
"stm32-channel-request" ,
@@ -31,37 +33,37 @@ def prepare(module, options):
31
33
did = device .identifier
32
34
33
35
# Enable DMA for all but some devices...
34
- if not (
35
- (did ["family" ] in ["f0" ]
36
- # STM32F09x has shared interrupts between DMA1 and DMA2, not supported...
37
- and did ["name" ] not in ["30" , "71" , "72" , "78" , "91" , "98" ])
38
- or (did ["family" ] in ["f1" ] and
39
- (did ["name" ] in ["02" , "05" , "07" ]
40
- or
41
- (did ["name" ] in ["00" , "01" , "03" ]
42
- and did ["pin" ] in ["r" , "v" , "z" ]
43
- and did ["size" ] in ["c" , "d" , "e" , "f" , "g" ]
44
- )
45
- )
46
- )
47
- or (did ["family" ] in ["f3" ] and
48
- did ["name" ] not in ["73" , "78" ]
49
- and
50
- (did ["name" ] in ["02" ]
51
- and did ["pin" ] not in ["c" ]
52
- and did ["size" ] not in ["b" , "c" ]
53
- )
54
- )
55
- or (did ["family" ] in ["l0" ])
56
- or (did ["family" ] in ["l1" ]
57
- and did ["size" ] not in ["c" ])
58
- or (did ["family" ] in ["l4" ])
59
- ):
36
+
37
+ if did ["family" ] in ["f0" ]:
38
+ if did ["name" ] in ["30" , "71" , "72" , "78" , "91" , "98" ]:
39
+ # STM32F09x has shared interrupts between DMA1 and DMA2, not supported...
40
+ return False
41
+ return True
42
+
43
+ if did ["family" ] in ["f1" ]:
44
+ if did ["name" ] in ["02" , "05" , "07" ]:
45
+ return True
46
+ if did ["name" ] in ["00" , "01" , "03" ] and did ["pin" ] in ["r" , "v" , "z" ] and did ["size" ] in ["c" , "d" , "e" , "f" , "g" ]:
47
+ return True
60
48
return False
61
49
62
- module .depends (":cmsis:device" , ":platform:rcc" )
50
+ if did ["family" ] in ["f3" ]:
51
+ if did ["name" ] in ["73" , "78" ]:
52
+ return False
53
+ if did ["name" ] in ["02" ] and did ["pin" ] in ["c" ] and did ["size" ] in ["b" , "c" ]:
54
+ return False
55
+ return True
56
+
57
+ if did ["family" ] in ["l0" , "l4" ]:
58
+ return True
59
+
60
+ if did ["family" ] in ["l1" ]:
61
+ if did ["size" ] in ["c" ]:
62
+ return False
63
+ return True
64
+
65
+ return False
63
66
64
- return True
65
67
66
68
def build (env ):
67
69
device = env [":target" ]
0 commit comments