@@ -21,6 +21,8 @@ def init(module):
2121def prepare (module , options ):
2222 device = options [":target" ]
2323
24+ module .depends (":cmsis:device" , ":platform:rcc" )
25+
2426 if (not device .has_driver ("dma" )) or device .get_driver ("dma" )["type" ] not in \
2527 [
2628 "stm32-channel-request" ,
@@ -31,37 +33,37 @@ def prepare(module, options):
3133 did = device .identifier
3234
3335 # 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
6048 return False
6149
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
6366
64- return True
6567
6668def build (env ):
6769 device = env [":target" ]
@@ -94,7 +96,7 @@ def build(env):
9496
9597 did = device .identifier
9698 if (did .family in ['f0' ] and did .name == '30' and did .size == 'c' ) or (did .family in ['f1' ] and did .name == '02' ):
97- print ( " FIXME: Bug in modm-deviced data: Dma2 does not exist on " + str ( device .identifier ))
99+ # FIXME: Bug in modm-deviced data: Dma2 does not exist on device.identifier
98100 properties ["dma" ]["instance" ].remove ('2' )
99101
100102 signal_names = sorted (list (set (signal_names )))
0 commit comments