@@ -110,15 +110,24 @@ def BuildHeader(name, vendor_name, product_name, vidtouse, pidtouse, vid, pid, p
110110 print ("# %s" % (prettyname ))
111111 print ("# -----------------------------------" )
112112 print ("%s.name=%s" % (name , prettyname ))
113- usb = 0 ;
114- for kb in [ "0" , "0x8000" ]:
115- for ms in [ "0" , "0x4000" ]:
116- for jy in [ "0" , "0x0100" ]:
117- thispid = int (pidtouse , 16 ) | int (kb , 16 ) | int (ms , 16 ) | int (jy , 16 )
118- print ("%s.vid.%d=%s" % (name , usb , vidtouse ))
119- print ("%s.pid.%d=0x%04x" % (name , usb , thispid ))
120- usb = usb + 1
121- print ("%s.build.usbpid=-DSERIALUSB_PID=%s" % (name , pid ))
113+ usb = 0
114+ if type (pidtouse ) == list :
115+ for tp in pid :
116+ print ("%s.vid.%d=%s" % (name , usb , vidtouse ))
117+ print ("%s.pid.%d=0x%04x" % (name , usb , int (tp , 16 )))
118+ usb = usb + 1
119+ else :
120+ for kb in [ "0" , "0x8000" ]:
121+ for ms in [ "0" , "0x4000" ]:
122+ for jy in [ "0" , "0x0100" ]:
123+ thispid = int (pidtouse , 16 ) | int (kb , 16 ) | int (ms , 16 ) | int (jy , 16 )
124+ print ("%s.vid.%d=%s" % (name , usb , vidtouse ))
125+ print ("%s.pid.%d=0x%04x" % (name , usb , thispid ))
126+ usb = usb + 1
127+ if type (pid ) == list :
128+ print ("%s.build.usbpid=-DSERIALUSB_PID=%s" % (name , pid [0 ]))
129+ else :
130+ print ("%s.build.usbpid=-DSERIALUSB_PID=%s" % (name , pid ))
122131 print ("%s.build.usbpwr=-DUSBD_MAX_POWER_MA=%s" % (name , pwr ))
123132 print ("%s.build.board=%s" % (name , boarddefine ))
124133 print ("%s.build.mcu=cortex-m0plus" % (name ))
@@ -141,7 +150,10 @@ def BuildHeader(name, vendor_name, product_name, vidtouse, pidtouse, vid, pid, p
141150 print ("%s.build.debugscript=%s" % (name , dbg ))
142151 print ("%s.build.boot2=%s" % (name , boot2 ))
143152 print ("%s.build.vid=%s" % (name , vid ))
144- print ("%s.build.pid=%s" % (name , pid ))
153+ if type (pid ) == list :
154+ print ("%s.build.pid=%s" % (name , pid [0 ]))
155+ else :
156+ print ("%s.build.pid=%s" % (name , pid ))
145157 print ('%s.build.usb_manufacturer="%s"' % (name , vendor_name ))
146158 print ('%s.build.usb_product="%s"' % (name , product_name ))
147159 if extra != None :
@@ -221,6 +233,8 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flash
221233 pkgjson ['packages' ][0 ]['platforms' ][0 ]['boards' ].append (thisbrd )
222234
223235def MakeBoardJSON (name , vendor_name , product_name , vid , pid , pwr , boarddefine , flashsizemb , boot2 , extra ):
236+ if type (pid ) == list :
237+ pid = pid [0 ]
224238 if extra != None :
225239 m_extra = ' '
226240 for m_item in extra :
@@ -321,7 +335,7 @@ def MakeBoardJSON(name, vendor_name, product_name, vid, pid, pwr, boarddefine, f
321335MakeBoard ("adafruit_kb2040" , "Adafruit" , "KB2040" , "0x239a" , "0x8105" , 250 , "ADAFRUIT_KB2040_RP2040" , 8 , "boot2_w25q080_2_padded_checksum" )
322336
323337# Arduino
324- MakeBoard ("arduino_nano_connect" , "Arduino" , "Nano RP2040 Connect" , "0x2341" , "0x0058" , 250 , "NANO_RP2040_CONNECT" , 16 , "boot2_w25q080_2_padded_checksum" )
338+ MakeBoard ("arduino_nano_connect" , "Arduino" , "Nano RP2040 Connect" , "0x2341" , [ "0x005e" , "0x805e" , "0x015e" , "0x025e" ] , 250 , "NANO_RP2040_CONNECT" , 16 , "boot2_w25q080_2_padded_checksum" )
325339
326340# BridgeTek
327341MakeBoard ("bridgetek_idm2040-7a" , "BridgeTek" , "IDM2040-7A" , "0x2e8a" , "0x1041" , 250 , "BRIDGETEK_IDM2040-7A" , 8 , "boot2_w25q080_2_padded_checksum" , ["FT8XX_TYPE=BT817" , "DISPLAY_RES=WVGA" , "PLATFORM_RP2040" ])
0 commit comments