mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 08:38:35 -07:00
[FL-3629] fbt: reworked assets & resources handling (#3160)
* fbt: reworking targets & assets handling WIP * fbt: dist fixes * fbt: moved SD card resources to owning apps * unit_tests: moved resources to app folder * github: updated unit_tests paths * github: packaging fixes * unit_tests: fixes * fbt: assets: internal cleanup * fbt: reworked assets handling * github: unit_tests: reintroducing fixes * minor cleanup * fbt: naming changes to reflect private nature of scons tools * fbt: resources: fixed dist archive paths * docs: updated paths * docs: updated more paths * docs: included "resources" parameter in app manifest docs; updated assets readme * updated gitignore for assets * github: updated action versions * unit_tests: restored timeout; scripts: assets: logging changes * gh: don't upload desktop animations for unit test run Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
39
targets/f7/src/dfu.c
Normal file
39
targets/f7/src/dfu.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <flipper.h>
|
||||
#include <alt_boot.h>
|
||||
#include <assets_icons.h>
|
||||
#include <toolbox/compress.h>
|
||||
#include <gui/canvas.h>
|
||||
#include <gui/canvas_i.h>
|
||||
|
||||
void flipper_boot_dfu_show_splash() {
|
||||
// Initialize
|
||||
Canvas* canvas = canvas_init();
|
||||
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
canvas_set_font(canvas, FontPrimary);
|
||||
|
||||
canvas_draw_icon(canvas, 0, 64 - 50, &I_DFU_128x50);
|
||||
canvas_draw_str(canvas, 2, 8, "Update & Recovery Mode");
|
||||
canvas_draw_str(canvas, 2, 21, "DFU Started");
|
||||
canvas_commit(canvas);
|
||||
|
||||
canvas_free(canvas);
|
||||
}
|
||||
|
||||
void flipper_boot_dfu_exec() {
|
||||
// Show DFU splashscreen
|
||||
flipper_boot_dfu_show_splash();
|
||||
|
||||
// Errata 2.2.9, Flash OPTVERR flag is always set after system reset
|
||||
WRITE_REG(FLASH->SR, FLASH_SR_OPTVERR);
|
||||
|
||||
// Cleanup before jumping to DFU
|
||||
furi_hal_deinit_early();
|
||||
|
||||
// Remap memory to system bootloader
|
||||
LL_SYSCFG_SetRemapMemory(LL_SYSCFG_REMAP_SYSTEMFLASH);
|
||||
// Jump
|
||||
furi_hal_switch(0x0);
|
||||
}
|
||||
Reference in New Issue
Block a user