Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,15 @@ bool get_json_int(json value, T& out) {
}
}

bool get_json_boolean(json value, bool& out) {
if (value.is_boolean()) {
out = value.get<bool>();
return true;
} else {
return false;
}
}

uint32_t bootrom_func_lookup_rp2040(memory_access& access, uint16_t tag) {
model_t model = access.get_model();
// we are only used on RP2040
Expand Down Expand Up @@ -6564,8 +6573,21 @@ bool partition_create_command::execute(device_map &devices) {

if(p.contains("no_reboot_on_uf2_download")) new_p.flags |= PICOBIN_PARTITION_FLAGS_UF2_DOWNLOAD_NO_REBOOT_BITS;
if(p.contains("ab_non_bootable_owner_affinity")) new_p.flags |= PICOBIN_PARTITION_FLAGS_UF2_DOWNLOAD_AB_NON_BOOTABLE_OWNER_AFFINITY;
if(p.contains("ignored_during_riscv_boot")) new_p.flags |= PICOBIN_PARTITION_FLAGS_IGNORED_DURING_RISCV_BOOT_BITS;
if(p.contains("ignored_during_arm_boot")) new_p.flags |= PICOBIN_PARTITION_FLAGS_IGNORED_DURING_ARM_BOOT_BITS;

if(p.contains("ignored_during_riscv_boot")) {
bool ignored_value;
if (get_json_boolean(p["ignored_during_riscv_boot"], ignored_value) && ignored_value) {
new_p.flags |= PICOBIN_PARTITION_FLAGS_IGNORED_DURING_RISCV_BOOT_BITS;
}
}

if(p.contains("ignored_during_arm_boot")) {
bool ignored_value;
if (get_json_boolean(p["ignored_during_arm_boot"], ignored_value) && ignored_value) {
new_p.flags |= PICOBIN_PARTITION_FLAGS_IGNORED_DURING_ARM_BOOT_BITS;
}
}

pt.partitions.push_back(new_p);
}

Expand Down
Loading