MCPcopy Create free account
hub / github.com/SmingHub/Sming / to_binary

Method to_binary

Sming/Libraries/Spiffs/spiffsgen.py:464–479  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

462 self.cur_obj_id += 1
463
464 def to_binary(self):
465 img = b''
466 for block in self.blocks:
467 img += block.to_binary(self.blocks_lim)
468 bix = len(self.blocks)
469 if self.build_config.use_magic:
470 # Create empty blocks with magic numbers
471 while self.remaining_blocks > 0:
472 block = SpiffsBlock(bix, self.blocks_lim, self.build_config)
473 img += block.to_binary(self.blocks_lim)
474 self.remaining_blocks -= 1
475 bix += 1
476 else:
477 # Just fill remaining spaces FF's
478 img += b'\xFF' * (self.img_size - len(img))
479 return img
480
481
482def main():

Callers 2

mainFunction · 0.95
to_binaryMethod · 0.45

Calls 2

to_binaryMethod · 0.95
SpiffsBlockClass · 0.85

Tested by

no test coverage detected