Tools: add USBID to generated apj file

This commit is contained in:
Andrew Tridgell 2019-12-26 08:50:03 +11:00
parent 43c8efd820
commit 0888dd9087
2 changed files with 6 additions and 2 deletions

View File

@ -155,7 +155,8 @@ class generate_apj(Task.Task):
"version": "0.1",
"image_size": len(img),
"git_identity": self.generator.bld.git_head_hash(short=True),
"board_revision": 0
"board_revision": 0,
"USBID": self.env.USBID
}
if self.env.build_dates:
# we omit build_time when we don't have build_dates so that apj

View File

@ -186,7 +186,10 @@ class ManifestGenerator():
'VRCore-v10': ['0x27AC/0x1910'],
'VRUBrain-v51': ['0x27AC/0x1351']
}
if platform in USBID_MAP:
if 'USBID' in apj_json:
# newer APJ files have USBID in the json data
firmware['USBID'] = apj_json['USBID']
elif platform in USBID_MAP:
firmware['USBID'] = USBID_MAP[platform]
else:
# all others use a single USB VID/PID