This commit is contained in:
Razvalyaev 2025-09-12 10:26:03 +03:00
parent 2de059e0cc
commit 614b328a58
9 changed files with 6 additions and 17 deletions

Binary file not shown.

View File

@ -12,10 +12,9 @@ namespace BootloaderGUI
public const byte ERASE = 0x01;
public const byte RECEIVE = 0x02;
public const byte WRITE = 0x03;
public const byte VERIFY = 0x04;
public const byte JUMP = 0x05;
public const byte RESET = 0x06;
public const byte GO_TO_BOOT = 0x07;
public const byte JUMP = 0x04;
public const byte RESET = 0x05;
public const byte GO_TO_BOOT = 0x06;
public const int PAGE_SIZE = 2048;
public const int CAN_ID_BOOTLOADER = 0x123;

View File

@ -74,13 +74,12 @@ namespace BootloaderGUI
top += numPage.Height + gap;
btnErase = new Button() { Top = top, Left = left, Width = wBtn, Text = "ERASE Firmware" };
btnReceive = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "SEND Page" };
Tab.Controls.AddRange(new Control[] { btnErase, btnReceive });
Tab.Controls.AddRange(new Control[] { btnErase, });
top += hBtn + gap;
btnReceive = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "SEND Page" };
btnWrite = new Button() { Top = top, Left = left, Width = wBtn, Text = "WRITE Page" };
btnVerify = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "VERIFY Firmware" };
Tab.Controls.AddRange(new Control[] { btnWrite, btnVerify });
Tab.Controls.AddRange(new Control[] { btnReceive, btnWrite });
top += hBtn + gap;
btnJump = new Button() { Top = top, Left = left, Width = wBtn, Text = "JUMP to App" };
@ -92,7 +91,6 @@ namespace BootloaderGUI
btnErase.Click += (s, e) => sendCmdSync(BootloaderCommands.ERASE);
btnReceive.Click += (s, e) => sendPage((int)numPage.Value);
btnWrite.Click += (s, e) => sendCmdSync(BootloaderCommands.WRITE);
btnVerify.Click += (s, e) => sendCmdSync(BootloaderCommands.VERIFY);
btnJump.Click += (s, e) => sendCmdSync(BootloaderCommands.JUMP);
btnReset.Click += (s, e) => sendCmdSync(BootloaderCommands.RESET);
btnGoBoot.Click += (s, e) => sendCmdSync(BootloaderCommands.GO_TO_BOOT);

View File

@ -110,14 +110,6 @@ namespace BootloaderGUI
await Task.Delay(5); // небольшая пауза для UI
}
UpdateStatus("Verifying...");
await Task.Delay(5); // небольшая пауза для UI
if (!sendCmdSync(BootloaderCommands.VERIFY))
{
UpdateStatus("Verify failed");
return;
}
UpdateStatus("Jumping to app...");
await Task.Delay(5); // небольшая пауза для UI
sendCmdSync(BootloaderCommands.JUMP);