feat: Add full flash (0x0) option to flasher offset combobox

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mae PUGIN 2026-04-08 21:20:03 +02:00
parent 1420bbcc74
commit 67a883dd0b
4 changed files with 6 additions and 5 deletions

View file

@ -78,8 +78,9 @@ fn setup_flash(window: &MainWindow, ctx: &AppContext) {
let port = flasher.get_selected_prog_port().to_string();
let path = flasher.get_firmware_path().to_string();
let offset: u32 = match flasher.get_flash_offset_index() {
0 => 0x20000, // factory
1 => 0x220000, // ota_0
0 => 0x0, // full flash
1 => 0x20000, // factory
2 => 0x220000, // ota_0
_ => 0x20000,
};

View file

@ -264,7 +264,7 @@ export global FlasherBridge {
in property <[string]> prog-ports;
in-out property <string> selected-prog-port: "";
in-out property <string> firmware-path: "";
in-out property <int> flash-offset-index: 0; // 0=factory(0x20000), 1=ota_0(0x220000)
in-out property <int> flash-offset-index: 1; // 0=full(0x0), 1=factory(0x20000), 2=ota_0(0x220000)
in property <float> flash-progress: 0;
in property <string> flash-status: "";
in property <bool> flashing: false;

View file

@ -91,7 +91,7 @@ export component TabFlasher inherits Rectangle {
}
DarkComboBox {
model: ["factory (0x20000)", "ota_0 (0x220000)"];
model: ["full (0x0)", "factory (0x20000)", "ota_0 (0x220000)"];
current-index <=> FlasherBridge.flash-offset-index;
}
}

View file

@ -214,7 +214,7 @@ export component TabTools inherits Rectangle {
DarkComboBox {
width: 200px;
model: ["factory (0x20000)", "ota\\_0 (0x220000)"];
model: ["full (0x0)", "factory (0x20000)", "ota\\_0 (0x220000)"];
current-index <=> FlasherBridge.flash-offset-index;
}