mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Tools: added Hott telemetry
This commit is contained in:
parent
c5acb559ca
commit
300c6349cb
@ -89,6 +89,7 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [
|
||||
'AP_ADSB',
|
||||
'AC_PID',
|
||||
'AP_SerialLED',
|
||||
'AP_Hott_Telem',
|
||||
]
|
||||
|
||||
def get_legacy_defines(sketch_name):
|
||||
|
@ -38,12 +38,14 @@ def embed_file(out, f, idx, embedded_name, uncompressed):
|
||||
|
||||
compressed = tempfile.NamedTemporaryFile()
|
||||
if uncompressed:
|
||||
compressed.write(open(f,'rb').read())
|
||||
# ensure nul termination
|
||||
if sys.version_info[0] >= 3:
|
||||
compressed.write(bytearray(0))
|
||||
nul = bytearray(0)
|
||||
else:
|
||||
compressed.write(chr(0))
|
||||
nul = chr(0)
|
||||
if contents[-1] != nul:
|
||||
contents += nul
|
||||
compressed.write(contents)
|
||||
else:
|
||||
# compress it
|
||||
f = open(compressed.name, "wb")
|
||||
@ -66,6 +68,9 @@ def create_embedded_h(filename, files, uncompressed=False):
|
||||
out = open(filename, "wb")
|
||||
write_encode(out, '''// generated embedded files for AP_ROMFS\n\n''')
|
||||
|
||||
# remove duplicates and sort
|
||||
files = sorted(list(set(files)))
|
||||
|
||||
for i in range(len(files)):
|
||||
(name, filename) = files[i]
|
||||
if not embed_file(out, filename, i, name, uncompressed):
|
||||
|
Loading…
Reference in New Issue
Block a user