mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -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',
|
'AP_ADSB',
|
||||||
'AC_PID',
|
'AC_PID',
|
||||||
'AP_SerialLED',
|
'AP_SerialLED',
|
||||||
|
'AP_Hott_Telem',
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_legacy_defines(sketch_name):
|
def get_legacy_defines(sketch_name):
|
||||||
|
@ -38,12 +38,14 @@ def embed_file(out, f, idx, embedded_name, uncompressed):
|
|||||||
|
|
||||||
compressed = tempfile.NamedTemporaryFile()
|
compressed = tempfile.NamedTemporaryFile()
|
||||||
if uncompressed:
|
if uncompressed:
|
||||||
compressed.write(open(f,'rb').read())
|
|
||||||
# ensure nul termination
|
# ensure nul termination
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
compressed.write(bytearray(0))
|
nul = bytearray(0)
|
||||||
else:
|
else:
|
||||||
compressed.write(chr(0))
|
nul = chr(0)
|
||||||
|
if contents[-1] != nul:
|
||||||
|
contents += nul
|
||||||
|
compressed.write(contents)
|
||||||
else:
|
else:
|
||||||
# compress it
|
# compress it
|
||||||
f = open(compressed.name, "wb")
|
f = open(compressed.name, "wb")
|
||||||
@ -66,6 +68,9 @@ def create_embedded_h(filename, files, uncompressed=False):
|
|||||||
out = open(filename, "wb")
|
out = open(filename, "wb")
|
||||||
write_encode(out, '''// generated embedded files for AP_ROMFS\n\n''')
|
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)):
|
for i in range(len(files)):
|
||||||
(name, filename) = files[i]
|
(name, filename) = files[i]
|
||||||
if not embed_file(out, filename, i, name, uncompressed):
|
if not embed_file(out, filename, i, name, uncompressed):
|
||||||
|
Loading…
Reference in New Issue
Block a user