(self)
| 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 | |
| 482 | def main(): |
no test coverage detected