Skip to content

Commit 726bc4c

Browse files
committed
Merge remote-tracking branch 'origin/dev' into release-candidate
2 parents a5f3538 + 4f75d92 commit 726bc4c

File tree

1,544 files changed

+6447
-4631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,544 files changed

+6447
-4631
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ charset = utf-8
88
[*.{cpp,h,c,py,sh}]
99
indent_style = space
1010
indent_size = 4
11-
12-
[{Makefile,*.mk}]
13-
indent_size = tab

.github/workflows/lint_and_submodule_check.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@ jobs:
9595
echo "C Lint: all good ✨" >> $GITHUB_STEP_SUMMARY;
9696
fi
9797
98+
- name: 'Check image assets'
99+
if: always()
100+
run: |
101+
set +e;
102+
./fbt -s lint_img 2>&1 | tee lint-assets.log;
103+
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
104+
# Save multiline output
105+
echo "errors=1" >> $GITHUB_OUTPUT;
106+
printf "Image Lint errors:\n\`\`\`\n" >> $GITHUB_STEP_SUMMARY;
107+
echo "$(cat lint-assets.log)" >> $GITHUB_STEP_SUMMARY;
108+
printf "\n\`\`\`\n" >> $GITHUB_STEP_SUMMARY;
109+
exit 1;
110+
else
111+
echo "Image Lint: all good ✨" >> $GITHUB_STEP_SUMMARY;
112+
fi
113+
98114
- name: Report code formatting errors
99115
if: ( steps.syntax_check_py.outputs.errors || steps.syntax_check_cpp.outputs.errors ) && github.event.pull_request
100116
run: |

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "lib/mlib"]
22
path = lib/mlib
33
url = https://github.com/P-p-H-d/mlib.git
4-
[submodule "lib/littlefs"]
5-
path = lib/littlefs
6-
url = https://github.com/littlefs-project/littlefs.git
74
[submodule "lib/nanopb"]
85
path = lib/nanopb
96
url = https://github.com/nanopb/nanopb.git

.pvsoptions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--ignore-ccache -C gccarm --rules-config .pvsconfig -e lib/cmsis_core -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/microtar -e lib/mlib -e lib/stm32wb_cmsis -e lib/stm32wb_copro -e lib/stm32wb_hal -e lib/u8g2 -e lib/nanopb -e lib/mjs -e */arm-none-eabi/*
1+
--ignore-ccache -C gccarm --rules-config .pvsconfig -e lib/cmsis_core -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/mbedtls -e lib/microtar -e lib/mlib -e lib/stm32wb_cmsis -e lib/stm32wb_copro -e lib/stm32wb_hal -e lib/u8g2 -e lib/nanopb -e lib/mjs -e */arm-none-eabi/*

.sublime-project

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
"clangd": {
1111
"enabled": true,
1212
"initializationOptions": {
13-
// Use with toolchain version 39+
1413
// Set `"binary": "custom",` option in LSP-clangd config to use toolchain clangd
15-
// "custom_command": ["toolchain/current/bin/clangd"],
16-
14+
"custom_command": ["toolchain/current/bin/clangd"],
1715
"clangd.compile-commands-dir": "build/latest",
1816
"clangd.header-insertion": "never",
1917
"clangd.query-driver": "**/arm-none-eabi-*",

.vscode/example/settings.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"SConstruct": "python",
1313
"*.fam": "python"
1414
},
15-
// "clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@",
15+
"clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@",
1616
"clangd.arguments": [
1717
"--query-driver=**/arm-none-eabi-*",
1818
"--compile-commands-dir=${workspaceFolder}/build/latest",

.vscode/example/tasks.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,23 @@
6363
"type": "shell",
6464
"command": "./fbt updater_all"
6565
},
66-
{
67-
"label": "[Debug] Flash (USB, w/o resources)",
68-
"group": "build",
69-
"type": "shell",
70-
"command": "./fbt FORCE=1 flash_usb"
71-
},
7266
{
7367
"label": "[Release] Flash (USB, w/o resources)",
7468
"group": "build",
7569
"type": "shell",
7670
"command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb"
7771
},
7872
{
79-
"label": "[Debug:unit_tests] Flash (USB)",
73+
"label": "[Debug] Flash (USB, w/o resources)",
8074
"group": "build",
8175
"type": "shell",
82-
"command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb_full"
76+
"command": "./fbt FORCE=1 flash_usb"
8377
},
8478
{
85-
"label": "[Debug] Flash (USB, with resources)",
79+
"label": "[Debug:unit_tests] Flash (USB)",
8680
"group": "build",
8781
"type": "shell",
88-
"command": "./fbt FORCE=1 flash_usb_full"
82+
"command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb_full"
8983
},
9084
{
9185
"label": "[Release] Flash (USB, with resources)",
@@ -94,16 +88,16 @@
9488
"command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
9589
},
9690
{
97-
"label": "[Debug] Create PVS-Studio report",
91+
"label": "[Debug] Flash (USB, with resources)",
9892
"group": "build",
9993
"type": "shell",
100-
"command": "./fbt firmware_pvs"
94+
"command": "./fbt FORCE=1 flash_usb_full"
10195
},
10296
{
103-
"label": "[Debug] Build FAPs",
97+
"label": "[Debug] Create PVS-Studio report",
10498
"group": "build",
10599
"type": "shell",
106-
"command": "./fbt fap_dist"
100+
"command": "./fbt firmware_pvs"
107101
},
108102
{
109103
"label": "[Release] Build FAPs",
@@ -112,10 +106,10 @@
112106
"command": "./fbt COMPACT=1 DEBUG=0 fap_dist"
113107
},
114108
{
115-
"label": "[Debug] Build App",
109+
"label": "[Debug] Build FAPs",
116110
"group": "build",
117111
"type": "shell",
118-
"command": "./fbt build APPSRC=${relativeFileDirname}"
112+
"command": "./fbt fap_dist"
119113
},
120114
{
121115
"label": "[Release] Build App",
@@ -124,17 +118,23 @@
124118
"command": "./fbt COMPACT=1 DEBUG=0 build APPSRC=${relativeFileDirname}"
125119
},
126120
{
127-
"label": "[Debug] Launch App on Flipper",
121+
"label": "[Debug] Build App",
128122
"group": "build",
129123
"type": "shell",
130-
"command": "./fbt launch APPSRC=${relativeFileDirname}"
124+
"command": "./fbt build APPSRC=${relativeFileDirname}"
131125
},
132126
{
133127
"label": "[Release] Launch App on Flipper",
134128
"group": "build",
135129
"type": "shell",
136130
"command": "./fbt COMPACT=1 DEBUG=0 launch APPSRC=${relativeFileDirname}"
137131
},
132+
{
133+
"label": "[Debug] Launch App on Flipper",
134+
"group": "build",
135+
"type": "shell",
136+
"command": "./fbt launch APPSRC=${relativeFileDirname}"
137+
},
138138
{
139139
"label": "[Debug] Launch App on Flipper with Serial Console",
140140
"dependsOrder": "sequence",
@@ -145,16 +145,16 @@
145145
]
146146
},
147147
{
148-
"label": "[Debug] Build and upload all FAPs to Flipper over USB",
148+
"label": "[Release] Build and upload all FAPs to Flipper over USB",
149149
"group": "build",
150150
"type": "shell",
151-
"command": "./fbt fap_deploy"
151+
"command": "./fbt COMPACT=1 DEBUG=0 fap_deploy"
152152
},
153153
{
154-
"label": "[Release] Build and upload all FAPs to Flipper over USB",
154+
"label": "[Debug] Build and upload all FAPs to Flipper over USB",
155155
"group": "build",
156156
"type": "shell",
157-
"command": "./fbt COMPACT=1 DEBUG=0 fap_deploy"
157+
"command": "./fbt fap_deploy"
158158
},
159159
{
160160
// Press Ctrl+] to quit
@@ -180,4 +180,4 @@
180180
}
181181
}
182182
]
183-
}
183+
}

SConstruct

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,12 @@ firmware_env.Append(
322322
"SConstruct",
323323
"firmware.scons",
324324
"fbt_options.py",
325-
]
325+
],
326+
IMG_LINT_SOURCES=[
327+
# Image assets
328+
"applications",
329+
"assets",
330+
],
326331
)
327332

328333

@@ -359,6 +364,39 @@ distenv.PhonyTarget(
359364
PY_LINT_SOURCES=firmware_env["PY_LINT_SOURCES"],
360365
)
361366

367+
# Image assets linting
368+
distenv.PhonyTarget(
369+
"lint_img",
370+
[
371+
[
372+
"${PYTHON3}",
373+
"${FBT_SCRIPT_DIR}/imglint.py",
374+
"check",
375+
"${IMG_LINT_SOURCES}",
376+
"${ARGS}",
377+
]
378+
],
379+
IMG_LINT_SOURCES=firmware_env["IMG_LINT_SOURCES"],
380+
)
381+
382+
distenv.PhonyTarget(
383+
"format_img",
384+
[
385+
[
386+
"${PYTHON3}",
387+
"${FBT_SCRIPT_DIR}/imglint.py",
388+
"format",
389+
"${IMG_LINT_SOURCES}",
390+
"${ARGS}",
391+
]
392+
],
393+
IMG_LINT_SOURCES=firmware_env["IMG_LINT_SOURCES"],
394+
)
395+
396+
distenv.Alias("lint_all", ["lint", "lint_py", "lint_img"])
397+
distenv.Alias("format_all", ["format", "format_py", "format_img"])
398+
399+
362400
# Start Flipper CLI via PySerial's miniterm
363401
distenv.PhonyTarget(
364402
"cli",

applications/debug/accessor/accessor_view_manager.cpp

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,49 @@
55
AccessorAppViewManager::AccessorAppViewManager() {
66
event_queue = furi_message_queue_alloc(10, sizeof(AccessorEvent));
77

8-
view_dispatcher = view_dispatcher_alloc();
9-
auto callback = cbc::obtain_connector(this, &AccessorAppViewManager::previous_view_callback);
8+
view_holder = view_holder_alloc();
9+
auto callback =
10+
cbc::obtain_connector(this, &AccessorAppViewManager::view_holder_back_callback);
1011

1112
// allocate views
1213
submenu = submenu_alloc();
13-
add_view(ViewType::Submenu, submenu_get_view(submenu));
14-
1514
popup = popup_alloc();
16-
add_view(ViewType::Popup, popup_get_view(popup));
1715

18-
gui = static_cast<Gui*>(furi_record_open(RECORD_GUI));
19-
view_dispatcher_attach_to_gui(view_dispatcher, gui, ViewDispatcherTypeFullscreen);
16+
// set back callback
17+
view_holder_set_back_callback(view_holder, callback, NULL);
2018

21-
// set previous view callback for all views
22-
view_set_previous_callback(submenu_get_view(submenu), callback);
23-
view_set_previous_callback(popup_get_view(popup), callback);
19+
gui = static_cast<Gui*>(furi_record_open(RECORD_GUI));
20+
view_holder_attach_to_gui(view_holder, gui);
2421
}
2522

2623
AccessorAppViewManager::~AccessorAppViewManager() {
27-
// remove views
28-
view_dispatcher_remove_view(
29-
view_dispatcher, static_cast<uint32_t>(AccessorAppViewManager::ViewType::Submenu));
30-
view_dispatcher_remove_view(
31-
view_dispatcher, static_cast<uint32_t>(AccessorAppViewManager::ViewType::Popup));
32-
24+
// remove current view
25+
view_holder_set_view(view_holder, NULL);
3326
// free view modules
3427
furi_record_close(RECORD_GUI);
3528
submenu_free(submenu);
3629
popup_free(popup);
37-
38-
// free dispatcher
39-
view_dispatcher_free(view_dispatcher);
40-
30+
// free view holder
31+
view_holder_free(view_holder);
4132
// free event queue
4233
furi_message_queue_free(event_queue);
4334
}
4435

4536
void AccessorAppViewManager::switch_to(ViewType type) {
46-
view_dispatcher_switch_to_view(view_dispatcher, static_cast<uint32_t>(type));
37+
View* view;
38+
39+
switch(type) {
40+
case ViewType::Submenu:
41+
view = submenu_get_view(submenu);
42+
break;
43+
case ViewType::Popup:
44+
view = popup_get_view(popup);
45+
break;
46+
default:
47+
furi_crash();
48+
}
49+
50+
view_holder_set_view(view_holder, view);
4751
}
4852

4953
Submenu* AccessorAppViewManager::get_submenu() {
@@ -65,16 +69,10 @@ void AccessorAppViewManager::send_event(AccessorEvent* event) {
6569
furi_check(result == FuriStatusOk);
6670
}
6771

68-
uint32_t AccessorAppViewManager::previous_view_callback(void*) {
72+
void AccessorAppViewManager::view_holder_back_callback(void*) {
6973
if(event_queue != NULL) {
7074
AccessorEvent event;
7175
event.type = AccessorEvent::Type::Back;
7276
send_event(&event);
7377
}
74-
75-
return VIEW_IGNORE;
76-
}
77-
78-
void AccessorAppViewManager::add_view(ViewType view_type, View* view) {
79-
view_dispatcher_add_view(view_dispatcher, static_cast<uint32_t>(view_type), view);
8078
}

applications/debug/accessor/accessor_view_manager.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22
#include <furi.h>
3-
#include <gui/view_dispatcher.h>
3+
#include <gui/view_holder.h>
44
#include <gui/modules/submenu.h>
55
#include <gui/modules/popup.h>
66
#include "accessor_event.h"
@@ -10,7 +10,6 @@ class AccessorAppViewManager {
1010
enum class ViewType : uint8_t {
1111
Submenu,
1212
Popup,
13-
Tune,
1413
};
1514

1615
FuriMessageQueue* event_queue;
@@ -27,11 +26,10 @@ class AccessorAppViewManager {
2726
Popup* get_popup(void);
2827

2928
private:
30-
ViewDispatcher* view_dispatcher;
3129
Gui* gui;
30+
ViewHolder* view_holder;
3231

33-
uint32_t previous_view_callback(void* context);
34-
void add_view(ViewType view_type, View* view);
32+
void view_holder_back_callback(void* context);
3533

3634
// view elements
3735
Submenu* submenu;

0 commit comments

Comments
 (0)