Skip to content

Commit

Permalink
Merge branch 'dev' into raed_skylanders_faster
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes authored Dec 23, 2024
2 parents 8cd202b + 631d7a4 commit 9919e88
Show file tree
Hide file tree
Showing 65 changed files with 275 additions and 162 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,56 @@ on:
env:
TARGETS: f7
DEFAULT_TARGET: f7
FBT_TOOLCHAIN_PATH: /opt
FBT_TOOLCHAIN_PATH: /opt/
FBT_GIT_SUBMODULE_SHALLOW: 1

jobs:
run_units_on_bench:
runs-on: [self-hosted, FlipperZeroUnitTest]
runs-on: [ self-hosted, FlipperZeroTest ]
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Get flipper from device manager (mock)'
id: device
run: |
echo "flipper=auto" >> $GITHUB_OUTPUT
- name: 'Flash unit tests firmware'
id: flashing
if: success()
timeout-minutes: 10
run: |
./fbt resources firmware_latest flash SWD_TRANSPORT_SERIAL=2A0906016415303030303032 LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
- name: 'Wait for flipper and format ext'
id: format_ext
if: steps.flashing.outcome == 'success'
timeout-minutes: 5
timeout-minutes: 20
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/testops.py -p=${{steps.device.outputs.flipper}} -t=120 await_flipper
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
./fbt resources firmware_latest flash LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
- name: 'Copy assets and unit data, reboot and wait for flipper'
id: copy
if: steps.format_ext.outcome == 'success'
if: steps.flashing.outcome == 'success'
timeout-minutes: 7
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/testops.py -p=${{steps.device.outputs.flipper}} -t=15 await_flipper
rm -rf build/latest/resources/dolphin
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send build/latest/resources /ext
python3 scripts/power.py -p ${{steps.device.outputs.flipper}} reboot
python3 scripts/testops.py -p=${{steps.device.outputs.flipper}} -t=15 await_flipper
python3 scripts/testops.py -t=15 await_flipper
python3 scripts/storage.py -f send build/latest/resources /ext
python3 scripts/storage.py -f send /region_data /ext/.int/.region_data
python3 scripts/power.py reboot
python3 scripts/testops.py -t=30 await_flipper
- name: 'Run units and validate results'
id: run_units
if: steps.copy.outcome == 'success'
timeout-minutes: 7
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/testops.py run_units -p ${{steps.device.outputs.flipper}}
python3 scripts/testops.py run_units
- name: 'Upload test results'
if: failure() && steps.flashing.outcome == 'success' && steps.run_units.outcome != 'skipped'
uses: actions/upload-artifact@v4
with:
name: unit-tests_output
path: unit_tests*.txt

- name: 'Check GDB output'
if: failure() && steps.flashing.outcome == 'success'
run: |
./fbt gdb_trace_all SWD_TRANSPORT_SERIAL=2A0906016415303030303032 LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
./fbt gdb_trace_all LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
54 changes: 10 additions & 44 deletions .github/workflows/updater_test.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
name: 'Updater test'
on:
pull_request:

env:
TARGETS: f7
DEFAULT_TARGET: f7
FBT_TOOLCHAIN_PATH: /opt
FBT_TOOLCHAIN_PATH: /opt/
FBT_GIT_SUBMODULE_SHALLOW: 1

jobs:
test_updater_on_bench:
runs-on: [self-hosted, FlipperZeroUpdaterTest]
runs-on: [self-hosted, FlipperZeroTest ]
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Get flipper from device manager (mock)'
id: device
run: |
echo "flipper=auto" >> $GITHUB_OUTPUT
echo "stlink=0F020D026415303030303032" >> $GITHUB_OUTPUT
- name: 'Flashing target firmware'
id: first_full_flash
timeout-minutes: 10
timeout-minutes: 20
run: |
source scripts/toolchain/fbtenv.sh
./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
python3 scripts/testops.py -p=${{steps.device.outputs.flipper}} -t=180 await_flipper
python3 scripts/testops.py -t=180 await_flipper
./fbt flash_usb_full FORCE=1
- name: 'Validating updater'
id: second_full_flash
timeout-minutes: 10
if: success()
run: |
source scripts/toolchain/fbtenv.sh
./fbt flash_usb PORT=${{steps.device.outputs.flipper}} FORCE=1
python3 scripts/testops.py -p=${{steps.device.outputs.flipper}} -t=180 await_flipper
- name: 'Get last release tag'
id: release_tag
if: failure()
run: |
echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
python3 scripts/testops.py -t=180 await_flipper
./fbt flash_usb FORCE=1
python3 scripts/testops.py -t=180 await_flipper
- name: 'Checkout latest release'
uses: actions/checkout@v4
if: failure()
with:
fetch-depth: 1
ref: ${{ steps.release_tag.outputs.tag }}

- name: 'Flash last release'
if: failure()
run: |
./fbt flash SWD_TRANSPORT_SERIAL=${{steps.device.outputs.stlink}} FORCE=1
- name: 'Wait for flipper and format ext'
if: failure()
run: |
source scripts/toolchain/fbtenv.sh
python3 scripts/testops.py -p=${{steps.device.outputs.flipper}} -t=180 await_flipper
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
2 changes: 1 addition & 1 deletion applications/system/js_app/packages/fz-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flipperdevices/fz-sdk",
"version": "0.1.2",
"version": "0.1.3",
"description": "Type declarations and documentation for native JS modules available on Flipper Zero",
"keywords": [
"flipper",
Expand Down
13 changes: 6 additions & 7 deletions applications/system/js_app/packages/fz-sdk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions applications/system/js_app/packages/fz-sdk/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,21 @@ async function build(config) {

async function upload(config) {
const appFile = fs.readFileSync(config.input, "utf8");
const flippers = (await SerialPort.list()).filter(x => x.serialNumber?.startsWith("flip_"));
const serialPorts = await SerialPort.list();

let flippers = serialPorts
.filter(x => x.serialNumber?.startsWith("flip_"))
.map(x => ({ path: x.path, name: x.serialNumber.replace("flip_", "") }));

if (!flippers.length) {
// some Windows installations don't report the serial number correctly;
// filter by STM VCP VID:PID instead
flippers = serialPorts
.filter(x => x?.vendorId === "0483" && x?.productId === "5740")
.map(x => ({ path: x.path, name: x.path }));
}

if (!flippers) {
if (!flippers.length) {
console.error("No Flippers found");
process.exit(1);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions assets/dolphin/external/L1_Happy_holidays_128x64/meta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Filetype: Flipper Animation
Version: 1

Width: 128
Height: 64
Passive frames: 10
Active frames: 18
Frames order: 0 1 2 1 0 1 2 1 0 1 2 3 4 5 6 5 4 7 2 8 9 10 11 10 9 10 11 12
Active cycles: 1
Frame rate: 2
Duration: 3600
Active cooldown: 7

Bubble slots: 1

Slot: 0
X: 11
Y: 19
Text: HAPPY\nHOLIDAYS!
AlignH: Right
AlignV: Center
StartFrame: 22
EndFrame: 27
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions assets/dolphin/external/L1_Sleigh_ride_128x64/meta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Filetype: Flipper Animation
Version: 1

Width: 128
Height: 64
Passive frames: 18
Active frames: 19
Frames order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Active cycles: 1
Frame rate: 2
Duration: 3600
Active cooldown: 7

Bubble slots: 1

Slot: 0
X: 21
Y: 25
Text: AAAAaAAAAHHh!!
AlignH: Right
AlignV: Bottom
StartFrame: 30
EndFrame: 32
20 changes: 17 additions & 3 deletions assets/dolphin/external/manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,32 @@ Min butthurt: 0
Max butthurt: 8
Min level: 1
Max level: 3
Weight: 4
Weight: 3

Name: L3_Intruder_alert_128x64
Min butthurt: 0
Max butthurt: 12
Min level: 3
Max level: 3
Weight: 4
Weight: 3

Name: L1_Procrastinating_128x64
Min butthurt: 0
Max butthurt: 8
Min level: 1
Max level: 3
Weight: 6
Weight: 3

Name: L1_Happy_holidays_128x64
Min butthurt: 0
Max butthurt: 14
Min level: 1
Max level: 3
Weight: 4

Name: L1_Sleigh_ride_128x64
Min butthurt: 0
Max butthurt: 14
Min level: 1
Max level: 3
Weight: 4
2 changes: 2 additions & 0 deletions firmware.scons
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ env = ENV.Clone(
TARGETS_ROOT=Dir("#/targets"),
LINT_SOURCES=[
Dir("applications"),
# Not C code
Dir("!applications/system/js_app/packages"),
],
LIBPATH=[
"${LIB_DIST_DIR}",
Expand Down
14 changes: 8 additions & 6 deletions lib/ble_profile/extra_services/hid_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#define TAG "BleHid"

#define BLE_SVC_HID_REPORT_MAP_MAX_LEN (255)
#define BLE_SVC_HID_REPORT_MAX_LEN (255)
#define BLE_SVC_HID_REPORT_REF_LEN (2)
#define BLE_SVC_HID_INFO_LEN (4)
#define BLE_SVC_HID_CONTROL_POINT_LEN (1)
#define BLE_SVC_HID_REPORT_MAX_LEN (255)
#define BLE_SVC_HID_REPORT_REF_LEN (2)
#define BLE_SVC_HID_INFO_LEN (4)
#define BLE_SVC_HID_CONTROL_POINT_LEN (1)

#define BLE_SVC_HID_INPUT_REPORT_COUNT (3)
#define BLE_SVC_HID_OUTPUT_REPORT_COUNT (0)
#define BLE_SVC_HID_INPUT_REPORT_COUNT (3)
#define BLE_SVC_HID_OUTPUT_REPORT_COUNT (0)
#define BLE_SVC_HID_FEATURE_REPORT_COUNT (0)
#define BLE_SVC_HID_REPORT_COUNT \
(BLE_SVC_HID_INPUT_REPORT_COUNT + BLE_SVC_HID_OUTPUT_REPORT_COUNT + \
Expand Down Expand Up @@ -157,6 +157,7 @@ static BleEventAckStatus ble_svc_hid_event_handler(void* event, void* context) {
hci_event_pckt* event_pckt = (hci_event_pckt*)(((hci_uart_pckt*)event)->data);
evt_blecore_aci* blecore_evt = (evt_blecore_aci*)event_pckt->data;
// aci_gatt_attribute_modified_event_rp0* attribute_modified;

if(event_pckt->evt == HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE) {
if(blecore_evt->ecode == ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE) {
// Process modification events
Expand Down Expand Up @@ -274,6 +275,7 @@ bool ble_svc_hid_update_input_report(
.data_ptr = data,
.data_len = len,
};

return ble_gatt_characteristic_update(
hid_svc->svc_handle, &hid_svc->input_report_chars[input_report_num], &report_data);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/nfc/protocols/mf_plus/mf_plus_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void mf_plus_poller_set_callback(

static NfcCommand mf_plus_poller_run(NfcGenericEvent event, void* context) {
furi_assert(context);
furi_assert(event.protocol = NfcProtocolIso14443_4a);
furi_assert(event.protocol == NfcProtocolIso14443_4a);
furi_assert(event.event_data);

MfPlusPoller* instance = context;
Expand Down Expand Up @@ -178,7 +178,7 @@ void mf_plus_poller_free(MfPlusPoller* instance) {

static bool mf_plus_poller_detect(NfcGenericEvent event, void* context) {
furi_assert(context);
furi_assert(event.protocol = NfcProtocolIso14443_4a);
furi_assert(event.protocol == NfcProtocolIso14443_4a);
furi_assert(event.event_data);

MfPlusPoller* instance = context;
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/bin_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ SubGhzProtocolStatus
flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);

if(!subghz_protocol_encoder_bin_raw_get_upload(instance)) {
break;
res = SubGhzProtocolStatusErrorEncoderGetUpload;
break;
}
instance->encoder.is_running = true;

Expand Down
Loading

0 comments on commit 9919e88

Please sign in to comment.