def embed_files(self, cfg, files): '''embed some files using AP_ROMFS''' header = cfg.bldnode.make_node('sitl/ap_romfs_embedded.h').abspath() paths = [] embed_path = cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/scripts').abspath() sys.path.append(embed_path) import embed embed.create_embedded_h(header, files)
def embed_ROMFS_files(self, ctx): '''embed some files using AP_ROMFS''' import embed header = ctx.bldnode.make_node('ap_romfs_embedded.h').abspath() if not embed.create_embedded_h(header, ctx.env.ROMFS_FILES, ctx.env.ROMFS_UNCOMPRESSED): ctx.fatal("Failed to created ap_romfs_embedded.h")
def embed_ROMFS_files(self, ctx): '''embed some files using AP_ROMFS''' import embed if ctx.env.USE_NUTTX_IOFW: # use fmuv2_IO_NuttX.bin instead of fmuv2_IO.bin for i in range(len(ctx.env.ROMFS_FILES)): (name,filename) = ctx.env.ROMFS_FILES[i] if name == 'io_firmware.bin': filename = 'Tools/IO_Firmware/fmuv2_IO_NuttX.bin' print("Using IO firmware %s" % filename) ctx.env.ROMFS_FILES[i] = (name,filename); header = ctx.bldnode.make_node('ap_romfs_embedded.h').abspath() if not embed.create_embedded_h(header, ctx.env.ROMFS_FILES): ctx.fatal("Failed to created ap_romfs_embedded.h")
def write_ROMFS(outdir): '''create ROMFS embedded header''' from embed import create_embedded_h create_embedded_h(os.path.join(outdir, 'ap_romfs_embedded.h'), romfs)
def embed_ROMFS_files(self, ctx): '''embed some files using AP_ROMFS''' import embed header = ctx.bldnode.make_node('ap_romfs_embedded.h').abspath() if not embed.create_embedded_h(header, ctx.env.ROMFS_FILES): bld.fatal("Failed to created ap_romfs_embedded.h")