@@ -726,44 +726,6 @@ def print_qspi(list):
726726 )
727727
728728
729- def print_syswkup_h ():
730- if len (syswkup_list ) == 0 :
731- out_h_file .write ("/* NO SYS_WKUP */\n " )
732- else :
733- out_h_file .write ("/* SYS_WKUP */\n " )
734- # H7xx and F446 start from 0, inc by 1
735- num = syswkup_list [0 ][2 ].replace ("SYS_WKUP" , "" )
736- inc = 0
737- if num == "0" :
738- inc = 1
739- # Fill list with missing SYS_WKUPx set to NC
740- i = 0
741- while i < 8 :
742- num = 0
743- if len (syswkup_list ) > i :
744- n = syswkup_list [i ][2 ].replace ("SYS_WKUP" , "" )
745- if len (n ) != 0 :
746- num = int (n ) if inc == 1 else int (n ) - 1
747- x = i if inc == 1 else i + 1
748- if num != i :
749- syswkup_list .insert (i , ["NC" , "NC_" + str (x ), "SYS_WKUP" + str (x )])
750- i += 1
751- # print pin name under switch
752- for p in syswkup_list :
753- num = p [2 ].replace ("SYS_WKUP" , "" )
754- if len (num ) == 0 :
755- s1 = "#ifdef PWR_WAKEUP_PIN1\n "
756- s1 += " SYS_WKUP1" # single SYS_WKUP for this product
757- else :
758- s1 = "#ifdef PWR_WAKEUP_PIN%i\n " % (int (num ) + inc )
759- s1 += " SYS_WKUP" + str (int (num ) + inc )
760- s1 += " = " + p [0 ] + ","
761- if (inc == 1 ) and (p [0 ] != "NC" ):
762- s1 += " /* " + p [2 ] + " */"
763- s1 += "\n #endif\n "
764- out_h_file .write (s1 )
765-
766-
767729def print_sd ():
768730 for p in sd_list :
769731 result = get_gpio_af_num (p [1 ], p [2 ])
@@ -842,6 +804,44 @@ def print_usb(lst):
842804 )
843805
844806
807+ def print_syswkup_h ():
808+ if len (syswkup_list ) == 0 :
809+ out_h_file .write ("/* NO SYS_WKUP */\n " )
810+ else :
811+ out_h_file .write ("/* SYS_WKUP */\n " )
812+ # H7xx and F446 start from 0, inc by 1
813+ num = syswkup_list [0 ][2 ].replace ("SYS_WKUP" , "" )
814+ inc = 0
815+ if num == "0" :
816+ inc = 1
817+ # Fill list with missing SYS_WKUPx set to NC
818+ i = 0
819+ while i < 8 :
820+ num = 0
821+ if len (syswkup_list ) > i :
822+ n = syswkup_list [i ][2 ].replace ("SYS_WKUP" , "" )
823+ if len (n ) != 0 :
824+ num = int (n ) if inc == 1 else int (n ) - 1
825+ x = i if inc == 1 else i + 1
826+ if num != i :
827+ syswkup_list .insert (i , ["NC" , "NC_" + str (x ), "SYS_WKUP" + str (x )])
828+ i += 1
829+ # print pin name under switch
830+ for p in syswkup_list :
831+ num = p [2 ].replace ("SYS_WKUP" , "" )
832+ if len (num ) == 0 :
833+ s1 = "#ifdef PWR_WAKEUP_PIN1\n "
834+ s1 += " SYS_WKUP1" # single SYS_WKUP for this product
835+ else :
836+ s1 = "#ifdef PWR_WAKEUP_PIN%i\n " % (int (num ) + inc )
837+ s1 += " SYS_WKUP" + str (int (num ) + inc )
838+ s1 += " = " + p [0 ] + ","
839+ if (inc == 1 ) and (p [0 ] != "NC" ):
840+ s1 += " /* " + p [2 ] + " */"
841+ s1 += "\n #endif\n "
842+ out_h_file .write (s1 )
843+
844+
845845def print_usb_h ():
846846 if usb_list or usb_otgfs_list or usb_otghs_list :
847847 out_h_file .write ("/* USB */\n " )
0 commit comments