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

Method to_binary

Sming/Libraries/Spiffs/spiffsgen.py:364–379  ·  view source on GitHub ↗
(self, blocks_lim)

Source from the content-addressed store, hash-verified

362 return self.remaining_pages <= 0
363
364 def to_binary(self, blocks_lim):
365 img = b''
366
367 if self.build_config.use_magic:
368 for (idx, page) in enumerate(self.pages):
369 if idx == self.build_config.OBJ_LU_PAGES_PER_BLOCK - 1:
370 page.magicfy(blocks_lim)
371 img += page.to_binary()
372 else:
373 for page in self.pages:
374 img += page.to_binary()
375
376 assert(len(img) <= self.build_config.block_size)
377
378 img += b'\xFF' * (self.build_config.block_size - len(img))
379 return img
380
381
382class SpiffsFS():

Callers 1

to_binaryMethod · 0.95

Calls 2

magicfyMethod · 0.80
to_binaryMethod · 0.45

Tested by

no test coverage detected