Skip to content

Commit

Permalink
Merge branch 'ofw_dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Mar 2, 2024
2 parents 22be262 + 4b7ca73 commit 88b354b
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 71 deletions.
61 changes: 52 additions & 9 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if GetOption("fullenv") or any(

# Target for self-update package
dist_basic_arguments = [
"${ARGS}",
"--bundlever",
"${UPDATE_VERSION_STRING}",
]
Expand Down Expand Up @@ -182,6 +183,7 @@ fap_deploy = distenv.PhonyTarget(
"send",
"${SOURCE}",
"/ext/apps",
"${ARGS}",
]
]
),
Expand All @@ -208,7 +210,7 @@ distenv.Alias("jflash", firmware_jflash)

distenv.PhonyTarget(
"gdb_trace_all",
"$GDB $GDBOPTS $SOURCES $GDBFLASH",
[["${GDB}", "${GDBOPTS}", "${SOURCES}", "${GDBFLASH}"]],
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
Expand Down Expand Up @@ -272,19 +274,35 @@ distenv.PhonyTarget(
# Just start OpenOCD
distenv.PhonyTarget(
"openocd",
"${OPENOCDCOM}",
[["${OPENOCDCOM}", "${ARGS}"]],
)

# Linter
distenv.PhonyTarget(
"lint",
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "check", "${LINT_SOURCES}"]],
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/lint.py",
"check",
"${LINT_SOURCES}",
"${ARGS}",
]
],
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
)

distenv.PhonyTarget(
"format",
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "format", "${LINT_SOURCES}"]],
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/lint.py",
"format",
"${LINT_SOURCES}",
"${ARGS}",
]
],
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
)

Expand All @@ -307,7 +325,16 @@ firmware_env.Append(
)


black_commandline = "@${PYTHON3} -m black ${PY_BLACK_ARGS} ${PY_LINT_SOURCES}"
black_commandline = [
[
"@${PYTHON3}",
"-m",
"black",
"${PY_BLACK_ARGS}",
"${PY_LINT_SOURCES}",
"${ARGS}",
]
]
black_base_args = [
"--include",
'"(\\.scons|\\.py|SConscript|SConstruct|\\.fam)$"',
Expand All @@ -333,12 +360,28 @@ distenv.PhonyTarget(

# Start Flipper CLI via PySerial's miniterm
distenv.PhonyTarget(
"cli", [["${PYTHON3}", "${FBT_SCRIPT_DIR}/serial_cli.py", "-p", "${FLIP_PORT}"]]
"cli",
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/serial_cli.py",
"-p",
"${FLIP_PORT}",
"${ARGS}",
]
],
)

# Update WiFi devboard firmware
# Update WiFi devboard firmware with release channel
distenv.PhonyTarget(
"devboard_flash", [["${PYTHON3}", "${FBT_SCRIPT_DIR}/wifi_board.py"]]
"devboard_flash",
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/wifi_board.py",
"${ARGS}",
]
],
)


Expand All @@ -353,7 +396,7 @@ distenv.PhonyTarget(
distenv.PhonyTarget(
"get_stlink",
distenv.Action(
lambda **kw: distenv.GetDevices(),
lambda **_: distenv.GetDevices(),
None,
),
)
Expand Down
2 changes: 2 additions & 0 deletions applications/services/gui/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ Canvas* gui_direct_draw_acquire(Gui* gui) {
gui->direct_draw = true;
gui_unlock(gui);

canvas_set_orientation(gui->canvas, CanvasOrientationHorizontal);
canvas_frame_set(gui->canvas, 0, 0, GUI_DISPLAY_WIDTH, GUI_DISPLAY_HEIGHT);
canvas_reset(gui->canvas);
canvas_commit(gui->canvas);

Expand Down
8 changes: 4 additions & 4 deletions documentation/fbt.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ To use language servers other than the default VS Code C/C++ language server, us
- `debug` - build and flash firmware, then attach with gdb with firmware's .elf loaded.
- `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.
- `updater_debug` - attach GDB with the updater's `.elf` loaded.
- `devboard_flash` - update WiFi dev board with the latest firmware.
- `devboard_flash` - Update WiFi dev board. Supports `ARGS="..."` to pass extra arguments to the update script, e.g. `ARGS="-c dev"`.
- `blackmagic` - debug firmware with Blackmagic probe (WiFi dev board).
- `openocd` - just start OpenOCD.
- `openocd` - just start OpenOCD. You can pass extra arguments with `ARGS="..."`.
- `get_blackmagic` - output the blackmagic address in the GDB remote format. Useful for IDE integration.
- `get_stlink` - output serial numbers for attached STLink probes. Used for specifying an adapter with `SWD_TRANSPORT_SERIAL=...`.
- `lint`, `format` - run clang-format on the C source code to check and reformat it according to the `.clang-format` specs.
- `lint_py`, `format_py` - run [black](https://black.readthedocs.io/en/stable/index.html) on the Python source code, build system files & application manifests.
- `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.
- `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.
- `firmware_pvs` - generate a PVS Studio report for the firmware. Requires PVS Studio to be available on your system's `PATH`.
- `cli` - start a Flipper CLI session over USB.

Expand Down
3 changes: 3 additions & 0 deletions scripts/fbt_tools/fbt_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def generate(env):
"--interface=${SWD_TRANSPORT}",
"--serial=${SWD_TRANSPORT_SERIAL}",
"${SOURCE}",
"${ARGS}",
],
Touch("${TARGET}"),
]
Expand All @@ -162,6 +163,7 @@ def generate(env):
"-p",
"${FLIP_PORT}",
"${UPDATE_BUNDLE_DIR}/update.fuf",
"${ARGS}",
],
Touch("${TARGET}"),
]
Expand All @@ -180,6 +182,7 @@ def generate(env):
"--stack_type=${COPRO_STACK_TYPE}",
"--stack_file=${COPRO_STACK_BIN}",
"--stack_addr=${COPRO_STACK_ADDR}",
"${ARGS}",
]
],
"${COPROCOMSTR}",
Expand Down
41 changes: 36 additions & 5 deletions scripts/ufbt/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -315,26 +315,56 @@ else:

appenv.PhonyTarget(
"cli",
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/serial_cli.py", "-p", "${FLIP_PORT}"]],
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/serial_cli.py",
"-p",
"${FLIP_PORT}",
"${ARGS}",
]
],
)

# Update WiFi devboard firmware
dist_env.PhonyTarget(
"devboard_flash", [["${PYTHON3}", "${FBT_SCRIPT_DIR}/wifi_board.py"]]
"devboard_flash",
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/wifi_board.py",
"${ARGS}",
]
],
)

# Linter

dist_env.PhonyTarget(
"lint",
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "check", "${LINT_SOURCES}"]],
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/lint.py",
"check",
"${LINT_SOURCES}",
"${ARGS}",
]
],
source=original_app_dir.File(".clang-format"),
LINT_SOURCES=[original_app_dir],
)

dist_env.PhonyTarget(
"format",
[["${PYTHON3}", "${FBT_SCRIPT_DIR}/lint.py", "format", "${LINT_SOURCES}"]],
[
[
"${PYTHON3}",
"${FBT_SCRIPT_DIR}/lint.py",
"format",
"${LINT_SOURCES}",
"${ARGS}",
]
],
source=original_app_dir.File(".clang-format"),
LINT_SOURCES=[original_app_dir],
)
Expand Down Expand Up @@ -456,6 +486,7 @@ if dolphin_src_dir.exists():
"send",
"${SOURCE}",
"/ext/dolphin",
"${ARGS}",
]
],
source=ufbt_build_dir.Dir("dolphin"),
Expand Down
3 changes: 2 additions & 1 deletion scripts/ufbt/site_tools/ufbt_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
debug, debug_other, blackmagic:
Start GDB
devboard_flash:
Update WiFi dev board with the latest firmware
Update WiFi dev board.
Supports ARGS="..." to pass extra arguments to the update script, e.g. ARGS="-c dev"
Other:
cli:
Expand Down
Loading

0 comments on commit 88b354b

Please sign in to comment.