@@ -669,38 +669,41 @@ def print_qspi():
669669
670670
671671def print_syswkup_h ():
672- out_h_file .write ("/* SYS_WKUP */\n " )
673- # H7xx and F446 start from 0, inc by 1
674- num = syswkup_list [0 ][2 ].replace ("SYS_WKUP" , "" )
675- inc = 0
676- if num == "0" :
677- inc = 1
678- # Fill list with missing SYS_WKUPx set to NC
679- i = 0
680- while i < 8 :
681- num = 0
682- if len (syswkup_list ) > i :
683- n = syswkup_list [i ][2 ].replace ("SYS_WKUP" , "" )
684- if len (n ) != 0 :
685- num = int (n ) if inc == 1 else int (n ) - 1
686- x = i if inc == 1 else i + 1
687- if num != i :
688- syswkup_list .insert (i , ["NC" , "NC_" + str (x ), "SYS_WKUP" + str (x )])
689- i += 1
690- # print pin name under switch
691- for p in syswkup_list :
692- num = p [2 ].replace ("SYS_WKUP" , "" )
693- if len (num ) == 0 :
694- s1 = "#ifdef PWR_WAKEUP_PIN1\n "
695- s1 += " SYS_WKUP1" # single SYS_WKUP for this product
696- else :
697- s1 = "#ifdef PWR_WAKEUP_PIN%i\n " % (int (num ) + inc )
698- s1 += " SYS_WKUP" + str (int (num ) + inc )
699- s1 += " = " + p [0 ] + ","
700- if (inc == 1 ) and (p [0 ] != "NC" ):
701- s1 += " /* " + p [2 ] + " */"
702- s1 += "\n #endif\n "
703- out_h_file .write (s1 )
672+ if len (syswkup_list ) == 0 :
673+ out_h_file .write ("/* NO SYS_WKUP */\n " )
674+ else :
675+ out_h_file .write ("/* SYS_WKUP */\n " )
676+ # H7xx and F446 start from 0, inc by 1
677+ num = syswkup_list [0 ][2 ].replace ("SYS_WKUP" , "" )
678+ inc = 0
679+ if num == "0" :
680+ inc = 1
681+ # Fill list with missing SYS_WKUPx set to NC
682+ i = 0
683+ while i < 8 :
684+ num = 0
685+ if len (syswkup_list ) > i :
686+ n = syswkup_list [i ][2 ].replace ("SYS_WKUP" , "" )
687+ if len (n ) != 0 :
688+ num = int (n ) if inc == 1 else int (n ) - 1
689+ x = i if inc == 1 else i + 1
690+ if num != i :
691+ syswkup_list .insert (i , ["NC" , "NC_" + str (x ), "SYS_WKUP" + str (x )])
692+ i += 1
693+ # print pin name under switch
694+ for p in syswkup_list :
695+ num = p [2 ].replace ("SYS_WKUP" , "" )
696+ if len (num ) == 0 :
697+ s1 = "#ifdef PWR_WAKEUP_PIN1\n "
698+ s1 += " SYS_WKUP1" # single SYS_WKUP for this product
699+ else :
700+ s1 = "#ifdef PWR_WAKEUP_PIN%i\n " % (int (num ) + inc )
701+ s1 += " SYS_WKUP" + str (int (num ) + inc )
702+ s1 += " = " + p [0 ] + ","
703+ if (inc == 1 ) and (p [0 ] != "NC" ):
704+ s1 += " /* " + p [2 ] + " */"
705+ s1 += "\n #endif\n "
706+ out_h_file .write (s1 )
704707
705708
706709def print_sd ():
0 commit comments