WTF
This commit is contained in:
parent
2de059e0cc
commit
614b328a58
Binary file not shown.
@ -12,10 +12,9 @@ namespace BootloaderGUI
|
|||||||
public const byte ERASE = 0x01;
|
public const byte ERASE = 0x01;
|
||||||
public const byte RECEIVE = 0x02;
|
public const byte RECEIVE = 0x02;
|
||||||
public const byte WRITE = 0x03;
|
public const byte WRITE = 0x03;
|
||||||
public const byte VERIFY = 0x04;
|
public const byte JUMP = 0x04;
|
||||||
public const byte JUMP = 0x05;
|
public const byte RESET = 0x05;
|
||||||
public const byte RESET = 0x06;
|
public const byte GO_TO_BOOT = 0x06;
|
||||||
public const byte GO_TO_BOOT = 0x07;
|
|
||||||
|
|
||||||
public const int PAGE_SIZE = 2048;
|
public const int PAGE_SIZE = 2048;
|
||||||
public const int CAN_ID_BOOTLOADER = 0x123;
|
public const int CAN_ID_BOOTLOADER = 0x123;
|
||||||
|
@ -74,13 +74,12 @@ namespace BootloaderGUI
|
|||||||
|
|
||||||
top += numPage.Height + gap;
|
top += numPage.Height + gap;
|
||||||
btnErase = new Button() { Top = top, Left = left, Width = wBtn, Text = "ERASE Firmware" };
|
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, });
|
||||||
Tab.Controls.AddRange(new Control[] { btnErase, btnReceive });
|
|
||||||
|
|
||||||
top += hBtn + gap;
|
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" };
|
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[] { btnReceive, btnWrite });
|
||||||
Tab.Controls.AddRange(new Control[] { btnWrite, btnVerify });
|
|
||||||
|
|
||||||
top += hBtn + gap;
|
top += hBtn + gap;
|
||||||
btnJump = new Button() { Top = top, Left = left, Width = wBtn, Text = "JUMP to App" };
|
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);
|
btnErase.Click += (s, e) => sendCmdSync(BootloaderCommands.ERASE);
|
||||||
btnReceive.Click += (s, e) => sendPage((int)numPage.Value);
|
btnReceive.Click += (s, e) => sendPage((int)numPage.Value);
|
||||||
btnWrite.Click += (s, e) => sendCmdSync(BootloaderCommands.WRITE);
|
btnWrite.Click += (s, e) => sendCmdSync(BootloaderCommands.WRITE);
|
||||||
btnVerify.Click += (s, e) => sendCmdSync(BootloaderCommands.VERIFY);
|
|
||||||
btnJump.Click += (s, e) => sendCmdSync(BootloaderCommands.JUMP);
|
btnJump.Click += (s, e) => sendCmdSync(BootloaderCommands.JUMP);
|
||||||
btnReset.Click += (s, e) => sendCmdSync(BootloaderCommands.RESET);
|
btnReset.Click += (s, e) => sendCmdSync(BootloaderCommands.RESET);
|
||||||
btnGoBoot.Click += (s, e) => sendCmdSync(BootloaderCommands.GO_TO_BOOT);
|
btnGoBoot.Click += (s, e) => sendCmdSync(BootloaderCommands.GO_TO_BOOT);
|
||||||
|
@ -110,14 +110,6 @@ namespace BootloaderGUI
|
|||||||
await Task.Delay(5); // небольшая пауза для UI
|
await Task.Delay(5); // небольшая пауза для UI
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus("Verifying...");
|
|
||||||
await Task.Delay(5); // небольшая пауза для UI
|
|
||||||
if (!sendCmdSync(BootloaderCommands.VERIFY))
|
|
||||||
{
|
|
||||||
UpdateStatus("Verify failed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateStatus("Jumping to app...");
|
UpdateStatus("Jumping to app...");
|
||||||
await Task.Delay(5); // небольшая пауза для UI
|
await Task.Delay(5); // небольшая пауза для UI
|
||||||
sendCmdSync(BootloaderCommands.JUMP);
|
sendCmdSync(BootloaderCommands.JUMP);
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user