mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2026-04-05 06:25:36 +00:00
append reset dfu command and CONFIG -> ENTER DFU
This commit is contained in:
parent
496b41fa1c
commit
5e9756e4e0
5 changed files with 44 additions and 0 deletions
19
ui.c
19
ui.c
|
|
@ -414,6 +414,22 @@ show_version(void)
|
|||
touch_start_watchdog();
|
||||
}
|
||||
|
||||
void
|
||||
enter_dfu(void)
|
||||
{
|
||||
adc_stop(ADC1);
|
||||
|
||||
int x = 5, y = 5;
|
||||
|
||||
ili9341_fill(0, 0, 320, 240, 0);
|
||||
ili9341_drawstring_5x7("DFU: Device Firmware Update Mode", x, y += 10, 0xffff, 0x0000);
|
||||
ili9341_drawstring_5x7("To exit DFU, please reset device yourself.", x, y += 10, 0xffff, 0x0000);
|
||||
|
||||
// see __early_init in NANOVNA_STM32_F072/board.c
|
||||
*((unsigned long *)BOOT_FROM_SYTEM_MEMORY_MAGIC_ADDRESS) = BOOT_FROM_SYTEM_MEMORY_MAGIC;
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
|
||||
// type of menu item
|
||||
enum {
|
||||
|
|
@ -525,6 +541,8 @@ menu_config_cb(int item)
|
|||
redraw_frame();
|
||||
request_to_redraw_grid();
|
||||
draw_menu();
|
||||
case 4:
|
||||
enter_dfu();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -903,6 +921,7 @@ const menuitem_t menu_config[] = {
|
|||
{ MT_CALLBACK, "TOUCH TEST", menu_config_cb },
|
||||
{ MT_CALLBACK, "SAVE", menu_config_cb },
|
||||
{ MT_CALLBACK, "VERSION", menu_config_cb },
|
||||
{ MT_CALLBACK, "ENTER DFU", menu_config_cb },
|
||||
{ MT_CANCEL, S_LARROW" BACK", NULL },
|
||||
{ MT_NONE, NULL, NULL } // sentinel
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue