| 628 | } |
| 629 | |
| 630 | bool launcherPartitionCreateData( |
| 631 | LauncherPartitionTable &table, uint8_t subtype, const char *label, uint32_t size, |
| 632 | LauncherPartitionEntry *created, String *error |
| 633 | ) { |
| 634 | if (!label || !label[0]) { |
| 635 | setError(error, "Data partition label is required"); |
| 636 | return false; |
| 637 | } |
| 638 | |
| 639 | uint32_t partitionSize = alignUp(size, LAUNCHER_FLASH_SECTOR_SIZE); |
| 640 | LauncherPartitionRange range; |
| 641 | if (!launcherPartitionFindFreeRange(table, partitionSize, LAUNCHER_FLASH_SECTOR_SIZE, range, error)) { |
| 642 | return false; |
| 643 | } |
| 644 | |
| 645 | LauncherPartitionEntry entry; |
| 646 | entry.type = kTypeData; |
| 647 | entry.subtype = subtype; |
| 648 | entry.offset = range.offset; |
| 649 | entry.size = partitionSize; |
| 650 | entry.flags = 0; |
| 651 | memset(entry.label, 0, sizeof(entry.label)); |
| 652 | strncpy(entry.label, label, 15); |
| 653 | |
| 654 | if (!launcherPartitionAdd(table, entry, error)) return false; |
| 655 | if (created) *created = entry; |
| 656 | return true; |
| 657 | } |
| 658 | |
| 659 | String launcherPartitionSanitizedAppLabelBase(const String &name) { |
| 660 | String base; |
no test coverage detected