Skip to content

Commit 88b354b

Browse files
committed
Merge branch 'ofw_dev' into dev
2 parents 22be262 + 4b7ca73 commit 88b354b

File tree

8 files changed

+172
-71
lines changed

8 files changed

+172
-71
lines changed

SConstruct

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ if GetOption("fullenv") or any(
6666

6767
# Target for self-update package
6868
dist_basic_arguments = [
69+
"${ARGS}",
6970
"--bundlever",
7071
"${UPDATE_VERSION_STRING}",
7172
]
@@ -182,6 +183,7 @@ fap_deploy = distenv.PhonyTarget(
182183
"send",
183184
"${SOURCE}",
184185
"/ext/apps",
186+
"${ARGS}",
185187
]
186188
]
187189
),
@@ -208,7 +210,7 @@ distenv.Alias("jflash", firmware_jflash)
208210

209211
distenv.PhonyTarget(
210212
"gdb_trace_all",
211-
"$GDB $GDBOPTS $SOURCES $GDBFLASH",
213+
[["${GDB}", "${GDBOPTS}", "${SOURCES}", "${GDBFLASH}"]],
212214
source=firmware_env["FW_ELF"],
213215
GDBOPTS="${GDBOPTS_BASE}",
214216
GDBREMOTE="${OPENOCD_GDB_PIPE}",
@@ -272,19 +274,35 @@ distenv.PhonyTarget(
272274
# Just start OpenOCD
273275
distenv.PhonyTarget(
274276
"openocd",
275-
"${OPENOCDCOM}",
277+
[["${OPENOCDCOM}", "${ARGS}"]],
276278
)
277279

278280
# Linter
279281
distenv.PhonyTarget(
280282
"lint",
281-
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "check", "${LINT_SOURCES}"]],
283+
[
284+
[
285+
"${PYTHON3}",
286+
"${FBT_SCRIPT_DIR}/lint.py",
287+
"check",
288+
"${LINT_SOURCES}",
289+
"${ARGS}",
290+
]
291+
],
282292
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
283293
)
284294

285295
distenv.PhonyTarget(
286296
"format",
287-
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "format", "${LINT_SOURCES}"]],
297+
[
298+
[
299+
"${PYTHON3}",
300+
"${FBT_SCRIPT_DIR}/lint.py",
301+
"format",
302+
"${LINT_SOURCES}",
303+
"${ARGS}",
304+
]
305+
],
288306
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
289307
)
290308

@@ -307,7 +325,16 @@ firmware_env.Append(
307325
)
308326

309327

310-
black_commandline = "@${PYTHON3} -m black ${PY_BLACK_ARGS} ${PY_LINT_SOURCES}"
328+
black_commandline = [
329+
[
330+
"@${PYTHON3}",
331+
"-m",
332+
"black",
333+
"${PY_BLACK_ARGS}",
334+
"${PY_LINT_SOURCES}",
335+
"${ARGS}",
336+
]
337+
]
311338
black_base_args = [
312339
"--include",
313340
'"(\\.scons|\\.py|SConscript|SConstruct|\\.fam)$"',
@@ -333,12 +360,28 @@ distenv.PhonyTarget(
333360

334361
# Start Flipper CLI via PySerial's miniterm
335362
distenv.PhonyTarget(
336-
"cli", [["${PYTHON3}", "${FBT_SCRIPT_DIR}/serial_cli.py", "-p", "${FLIP_PORT}"]]
363+
"cli",
364+
[
365+
[
366+
"${PYTHON3}",
367+
"${FBT_SCRIPT_DIR}/serial_cli.py",
368+
"-p",
369+
"${FLIP_PORT}",
370+
"${ARGS}",
371+
]
372+
],
337373
)
338374

339-
# Update WiFi devboard firmware
375+
# Update WiFi devboard firmware with release channel
340376
distenv.PhonyTarget(
341-
"devboard_flash", [["${PYTHON3}", "${FBT_SCRIPT_DIR}/wifi_board.py"]]
377+
"devboard_flash",
378+
[
379+
[
380+
"${PYTHON3}",
381+
"${FBT_SCRIPT_DIR}/wifi_board.py",
382+
"${ARGS}",
383+
]
384+
],
342385
)
343386

344387

@@ -353,7 +396,7 @@ distenv.PhonyTarget(
353396
distenv.PhonyTarget(
354397
"get_stlink",
355398
distenv.Action(
356-
lambda **kw: distenv.GetDevices(),
399+
lambda **_: distenv.GetDevices(),
357400
None,
358401
),
359402
)

applications/services/gui/gui.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ Canvas* gui_direct_draw_acquire(Gui* gui) {
499499
gui->direct_draw = true;
500500
gui_unlock(gui);
501501

502+
canvas_set_orientation(gui->canvas, CanvasOrientationHorizontal);
503+
canvas_frame_set(gui->canvas, 0, 0, GUI_DISPLAY_WIDTH, GUI_DISPLAY_HEIGHT);
502504
canvas_reset(gui->canvas);
503505
canvas_commit(gui->canvas);
504506

documentation/fbt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ To use language servers other than the default VS Code C/C++ language server, us
7171
- `debug` - build and flash firmware, then attach with gdb with firmware's .elf loaded.
7272
- `debug_other`, `debug_other_blackmagic` - attach GDB without loading any `.elf`. It will allow you to manually add external `.elf` files with `add-symbol-file` in GDB.
7373
- `updater_debug` - attach GDB with the updater's `.elf` loaded.
74-
- `devboard_flash` - update WiFi dev board with the latest firmware.
74+
- `devboard_flash` - Update WiFi dev board. Supports `ARGS="..."` to pass extra arguments to the update script, e.g. `ARGS="-c dev"`.
7575
- `blackmagic` - debug firmware with Blackmagic probe (WiFi dev board).
76-
- `openocd` - just start OpenOCD.
76+
- `openocd` - just start OpenOCD. You can pass extra arguments with `ARGS="..."`.
7777
- `get_blackmagic` - output the blackmagic address in the GDB remote format. Useful for IDE integration.
7878
- `get_stlink` - output serial numbers for attached STLink probes. Used for specifying an adapter with `SWD_TRANSPORT_SERIAL=...`.
79-
- `lint`, `format` - run clang-format on the C source code to check and reformat it according to the `.clang-format` specs.
80-
- `lint_py`, `format_py` - run [black](https://black.readthedocs.io/en/stable/index.html) on the Python source code, build system files & application manifests.
79+
- `lint`, `format` - run clang-format on the C source code to check and reformat it according to the `.clang-format` specs. Supports `ARGS="..."` to pass extra arguments to clang-format.
80+
- `lint_py`, `format_py` - run [black](https://black.readthedocs.io/en/stable/index.html) on the Python source code, build system files & application manifests. Supports `ARGS="..."` to pass extra arguments to black.
8181
- `firmware_pvs` - generate a PVS Studio report for the firmware. Requires PVS Studio to be available on your system's `PATH`.
8282
- `cli` - start a Flipper CLI session over USB.
8383

scripts/fbt_tools/fbt_dist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def generate(env):
150150
"--interface=${SWD_TRANSPORT}",
151151
"--serial=${SWD_TRANSPORT_SERIAL}",
152152
"${SOURCE}",
153+
"${ARGS}",
153154
],
154155
Touch("${TARGET}"),
155156
]
@@ -162,6 +163,7 @@ def generate(env):
162163
"-p",
163164
"${FLIP_PORT}",
164165
"${UPDATE_BUNDLE_DIR}/update.fuf",
166+
"${ARGS}",
165167
],
166168
Touch("${TARGET}"),
167169
]
@@ -180,6 +182,7 @@ def generate(env):
180182
"--stack_type=${COPRO_STACK_TYPE}",
181183
"--stack_file=${COPRO_STACK_BIN}",
182184
"--stack_addr=${COPRO_STACK_ADDR}",
185+
"${ARGS}",
183186
]
184187
],
185188
"${COPROCOMSTR}",

scripts/ufbt/SConstruct

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,26 +315,56 @@ else:
315315

316316
appenv.PhonyTarget(
317317
"cli",
318-
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/serial_cli.py", "-p", "${FLIP_PORT}"]],
318+
[
319+
[
320+
"${PYTHON3}",
321+
"${FBT_SCRIPT_DIR}/serial_cli.py",
322+
"-p",
323+
"${FLIP_PORT}",
324+
"${ARGS}",
325+
]
326+
],
319327
)
320328

321329
# Update WiFi devboard firmware
322330
dist_env.PhonyTarget(
323-
"devboard_flash", [["${PYTHON3}", "${FBT_SCRIPT_DIR}/wifi_board.py"]]
331+
"devboard_flash",
332+
[
333+
[
334+
"${PYTHON3}",
335+
"${FBT_SCRIPT_DIR}/wifi_board.py",
336+
"${ARGS}",
337+
]
338+
],
324339
)
325340

326341
# Linter
327-
328342
dist_env.PhonyTarget(
329343
"lint",
330-
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "check", "${LINT_SOURCES}"]],
344+
[
345+
[
346+
"${PYTHON3}",
347+
"${FBT_SCRIPT_DIR}/lint.py",
348+
"check",
349+
"${LINT_SOURCES}",
350+
"${ARGS}",
351+
]
352+
],
331353
source=original_app_dir.File(".clang-format"),
332354
LINT_SOURCES=[original_app_dir],
333355
)
334356

335357
dist_env.PhonyTarget(
336358
"format",
337-
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "format", "${LINT_SOURCES}"]],
359+
[
360+
[
361+
"${PYTHON3}",
362+
"${FBT_SCRIPT_DIR}/lint.py",
363+
"format",
364+
"${LINT_SOURCES}",
365+
"${ARGS}",
366+
]
367+
],
338368
source=original_app_dir.File(".clang-format"),
339369
LINT_SOURCES=[original_app_dir],
340370
)
@@ -456,6 +486,7 @@ if dolphin_src_dir.exists():
456486
"send",
457487
"${SOURCE}",
458488
"/ext/dolphin",
489+
"${ARGS}",
459490
]
460491
],
461492
source=ufbt_build_dir.Dir("dolphin"),

scripts/ufbt/site_tools/ufbt_help.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
debug, debug_other, blackmagic:
3030
Start GDB
3131
devboard_flash:
32-
Update WiFi dev board with the latest firmware
32+
Update WiFi dev board.
33+
Supports ARGS="..." to pass extra arguments to the update script, e.g. ARGS="-c dev"
3334
3435
Other:
3536
cli:

0 commit comments

Comments
 (0)