Skip to content

Commit

Permalink
Merge branch 'release-candidate' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Nov 14, 2022
2 parents 8d0faae + f3904dc commit 303c266
Show file tree
Hide file tree
Showing 277 changed files with 5,342 additions and 826 deletions.
9 changes: 7 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/applications/main/gpio/ @skotopes @DrZlo13 @hedger @nminaylov
/applications/main/ibutton/ @skotopes @DrZlo13 @hedger @gsurkov
/applications/main/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
/applications/main/nfc/ @skotopes @DrZlo13 @hedger @gornekich
/applications/main/nfc/ @skotopes @DrZlo13 @hedger @gornekich @Astrrra
/applications/main/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
/applications/main/u2f/ @skotopes @DrZlo13 @hedger @nminaylov

Expand All @@ -40,6 +40,8 @@

/applications/system/storage_move_to_sd/ @skotopes @DrZlo13 @hedger @nminaylov

/applications/debug/unit_tests/ @skotopes @DrZlo13 @hedger @nminaylov @gornekich @Astrrra @gsurkov @Skorpionm

# Documentation
/documentation/ @skotopes @DrZlo13 @hedger @drunkbatya
/scripts/toolchain/ @skotopes @DrZlo13 @hedger @drunkbatya
Expand All @@ -54,6 +56,9 @@
/lib/mbedtls/ @skotopes @DrZlo13 @hedger @nminaylov
/lib/micro-ecc/ @skotopes @DrZlo13 @hedger @nminaylov
/lib/nanopb/ @skotopes @DrZlo13 @hedger @nminaylov
/lib/nfc/ @skotopes @DrZlo13 @hedger @gornekich
/lib/nfc/ @skotopes @DrZlo13 @hedger @gornekich @Astrrra
/lib/one_wire/ @skotopes @DrZlo13 @hedger @gsurkov
/lib/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm

# CI/CD
/.github/workflows/ @skotopes @DrZlo13 @hedger @drunkbatya
2 changes: 1 addition & 1 deletion .github/workflows/amap_analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
export RODATA_SIZE="$(get_size ".rodata")"
export DATA_SIZE="$(get_size ".data")"
export FREE_FLASH_SIZE="$(get_size ".free_flash")"
python3 -m pip install mariadb
python3 -m pip install mariadb==1.1.4
python3 scripts/amap_mariadb_insert.py \
${{ secrets.AMAP_MARIADB_USER }} \
${{ secrets.AMAP_MARIADB_PASSWORD }} \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pvs_studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: 'Generate compile_comands.json'
run: |
FBT_TOOLCHAIN_PATH=/runner/_work ./fbt COMPACT=1 version_json proto_ver icons firmware_cdb dolphin_internal dolphin_blocking
FBT_TOOLCHAIN_PATH=/runner/_work ./fbt COMPACT=1 version_json proto_ver icons firmware_cdb dolphin_internal dolphin_blocking _fap_icons
- name: 'Static code analysis'
run: |
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
DEFAULT_TARGET: f7

jobs:
main:
run_units_on_test_bench:
runs-on: [self-hosted, FlipperZeroTest]
steps:
- name: Checkout code
Expand All @@ -22,31 +22,35 @@ jobs:
run: |
echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
- name: 'Compile unit tests firmware'
id: compile
- name: 'Flash unit tests firmware'
id: flashing
run: |
FBT_TOOLCHAIN_PATH=/opt ./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
- name: 'Wait for flipper to finish updating'
id: connect
if: steps.compile.outcome == 'success'
if: steps.flashing.outcome == 'success'
run: |
python3 ./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
. scripts/toolchain/fbtenv.sh
./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
- name: 'Format flipper SD card'
id: format
if: steps.connect.outcome == 'success'
run: |
. scripts/toolchain/fbtenv.sh
./scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
- name: 'Copy assets and unit tests data to flipper'
id: copy
if: steps.format.outcome == 'success'
run: |
. scripts/toolchain/fbtenv.sh
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/resources /ext
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/unit_tests /ext/unit_tests
- name: 'Run units and validate results'
if: steps.copy.outcome == 'success'
run: |
python3 ./scripts/testing/units.py ${{steps.device.outputs.flipper}}
. scripts/toolchain/fbtenv.sh
./scripts/testing/units.py ${{steps.device.outputs.flipper}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ openocd.log
# PVS Studio temporary files
.PVS-Studio/
PVS-Studio.log

.gdbinit
1 change: 1 addition & 0 deletions .pvsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//-V:BPTREE_DEF2:779,1086,557,773,512
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685
//-V:ALGO_DEF:1048,747,1044
//-V:TUPLE_DEF2:524,590,1001,760

# Non-severe malloc/null pointer deref warnings
//-V::522:2,3
Expand Down
4 changes: 4 additions & 0 deletions .vscode/example/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"postAttachCommands": [
// "compare-sections",
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
// "source debug/FreeRTOS/FreeRTOS.py",
// "svd_load debug/STM32WB55_CM4.svd"
]
Expand All @@ -59,6 +60,7 @@
"set confirm off",
"set mem inaccessible-by-default off",
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
// "compare-sections",
]
// "showDevDebugOutput": "raw",
Expand All @@ -76,6 +78,7 @@
"rtos": "FreeRTOS",
"postAttachCommands": [
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
]
// "showDevDebugOutput": "raw",
},
Expand All @@ -95,6 +98,7 @@
],
"postAttachCommands": [
"source debug/flipperapps.py",
"fap-set-debug-elf-root build/latest/.extapps",
],
// "showDevDebugOutput": "raw",
},
Expand Down
45 changes: 26 additions & 19 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# construction of certain targets behind command-line options.

import os
from fbt.util import path_as_posix

DefaultEnvironment(tools=[])

Expand All @@ -33,10 +34,6 @@ coreenv = SConscript(
)
SConscript("site_scons/cc.scons", exports={"ENV": coreenv})

# Store root dir in environment for certain tools
coreenv["ROOT_DIR"] = Dir(".")


# Create a separate "dist" environment and add construction envs to it
distenv = coreenv.Clone(
tools=[
Expand All @@ -47,6 +44,7 @@ distenv = coreenv.Clone(
"jflash",
],
ENV=os.environ,
UPDATE_BUNDLE_DIR="dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}",
)

firmware_env = distenv.AddFwProject(
Expand Down Expand Up @@ -144,21 +142,28 @@ distenv.Default(basic_dist)
dist_dir = distenv.GetProjetDirName()
fap_dist = [
distenv.Install(
f"#/dist/{dist_dir}/apps/debug_elf",
firmware_env["FW_EXTAPPS"]["debug"].values(),
distenv.Dir(f"#/dist/{dist_dir}/apps/debug_elf"),
list(
app_artifact.debug
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
),
*(
distenv.Install(f"#/dist/{dist_dir}/apps/{dist_entry[0]}", dist_entry[1])
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
distenv.Install(
f"#/dist/{dist_dir}/apps",
"#/assets/resources/apps",
),
]
Depends(fap_dist, firmware_env["FW_EXTAPPS"]["validators"].values())
Depends(
fap_dist,
list(
app_artifact.validator
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
),
)
Alias("fap_dist", fap_dist)
# distenv.Default(fap_dist)

distenv.Depends(
firmware_env["FW_RESOURCES"], firmware_env["FW_EXTAPPS"]["resources_dist"]
)
distenv.Depends(firmware_env["FW_RESOURCES"], firmware_env["FW_EXTAPPS"].resources_dist)


# Target for bundling core2 package for qFlipper
Expand Down Expand Up @@ -196,6 +201,7 @@ firmware_debug = distenv.PhonyTarget(
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")),
)
distenv.Depends(firmware_debug, firmware_flash)

Expand All @@ -205,6 +211,7 @@ distenv.PhonyTarget(
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="${BLACKMAGIC_ADDR}",
FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")),
)

# Debug alien elf
Expand All @@ -213,7 +220,7 @@ distenv.PhonyTarget(
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
GDBPYOPTS='-ex "source debug/PyCortexMDebug/PyCortexMDebug.py" ',
GDBPYOPTS='-ex "source ${FBT_DEBUG_DIR}/PyCortexMDebug/PyCortexMDebug.py" ',
)

distenv.PhonyTarget(
Expand All @@ -233,14 +240,14 @@ distenv.PhonyTarget(
# Linter
distenv.PhonyTarget(
"lint",
"${PYTHON3} scripts/lint.py check ${LINT_SOURCES}",
LINT_SOURCES=firmware_env["LINT_SOURCES"],
"${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py check ${LINT_SOURCES}",
LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
)

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

# PY_LINT_SOURCES contains recursively-built modules' SConscript files + application manifests
Expand Down Expand Up @@ -280,7 +287,7 @@ distenv.PhonyTarget(
)

# Start Flipper CLI via PySerial's miniterm
distenv.PhonyTarget("cli", "${PYTHON3} scripts/serial_cli.py")
distenv.PhonyTarget("cli", "${PYTHON3} ${FBT_SCRIPT_DIR}/serial_cli.py")


# Find blackmagic probe
Expand Down
12 changes: 12 additions & 0 deletions applications/debug/unit_tests/infrared/infrared_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ MU_TEST(infrared_test_decoder_mixed) {
infrared_test_run_decoder(InfraredProtocolRC5, 5);
infrared_test_run_decoder(InfraredProtocolSamsung32, 1);
infrared_test_run_decoder(InfraredProtocolSIRC, 3);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
}

MU_TEST(infrared_test_decoder_nec) {
Expand Down Expand Up @@ -489,6 +490,15 @@ MU_TEST(infrared_test_encoder_rc6) {
infrared_test_run_encoder(InfraredProtocolRC6, 1);
}

MU_TEST(infrared_test_decoder_kaseikyo) {
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 2);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 3);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 4);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 5);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 6);
}

MU_TEST(infrared_test_encoder_decoder_all) {
infrared_test_run_encoder_decoder(InfraredProtocolNEC, 1);
infrared_test_run_encoder_decoder(InfraredProtocolNECext, 1);
Expand All @@ -498,6 +508,7 @@ MU_TEST(infrared_test_encoder_decoder_all) {
infrared_test_run_encoder_decoder(InfraredProtocolRC6, 1);
infrared_test_run_encoder_decoder(InfraredProtocolRC5, 1);
infrared_test_run_encoder_decoder(InfraredProtocolSIRC, 1);
infrared_test_run_encoder_decoder(InfraredProtocolKaseikyo, 1);
}

MU_TEST_SUITE(infrared_test) {
Expand All @@ -515,6 +526,7 @@ MU_TEST_SUITE(infrared_test) {
MU_RUN_TEST(infrared_test_decoder_nec);
MU_RUN_TEST(infrared_test_decoder_samsung32);
MU_RUN_TEST(infrared_test_decoder_necext1);
MU_RUN_TEST(infrared_test_decoder_kaseikyo);
MU_RUN_TEST(infrared_test_decoder_mixed);
MU_RUN_TEST(infrared_test_encoder_decoder_all);
}
Expand Down
Loading

0 comments on commit 303c266

Please sign in to comment.