Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into release-candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Jun 9, 2023
2 parents dc3d565 + 4900e8b commit 1ac1f0b
Show file tree
Hide file tree
Showing 193 changed files with 6,244 additions and 1,109 deletions.
77 changes: 37 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
TARGETS: f7
TARGETS: f7 f18
DEFAULT_TARGET: f7
FBT_TOOLCHAIN_PATH: /runner/_work

Expand Down Expand Up @@ -52,10 +52,8 @@ jobs:
- name: 'Make artifacts directory'
run: |
rm -rf artifacts
rm -rf map_analyser_files
mkdir artifacts
mkdir map_analyser_files
rm -rf artifacts map_analyser_files
mkdir artifacts map_analyser_files
- name: 'Bundle scripts'
if: ${{ !github.event.pull_request.head.repo.fork }}
Expand All @@ -66,28 +64,21 @@ jobs:
run: |
set -e
for TARGET in ${TARGETS}; do
TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
./fbt TARGET_HW=$TARGET copro_dist updater_package \
${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
done
- name: 'Move upload files'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
set -e
for TARGET in ${TARGETS}; do
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
./fbt TARGET_HW=$TARGET_HW copro_dist updater_package \
${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
mv dist/${TARGET}-*/* artifacts/
tar czpf "artifacts/flipper-z-${TARGET}-resources-${SUFFIX}.tgz" \
-C assets resources
./fbt TARGET_HW=$TARGET_HW fap_dist
tar czpf "artifacts/flipper-z-${TARGET}-debugapps-${SUFFIX}.tgz" \
-C dist/${TARGET}-*/apps/Debug .
done
- name: "Check for uncommitted changes"
run: |
git diff --exit-code
- name: 'Bundle resources'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
tar czpf "artifacts/flipper-z-any-resources-${SUFFIX}.tgz" -C assets resources
- name: 'Bundle core2 firmware'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
Expand All @@ -96,29 +87,35 @@ jobs:
- name: 'Copy map analyser files'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf
cp build/${DEFAULT_TARGET}-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
cp build/${DEFAULT_TARGET}-firmware-*/firmware.elf map_analyser_files/firmware.elf
cp ${{ github.event_path }} map_analyser_files/event.json
- name: 'Upload map analyser files to storage'
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: prewk/s3-cp-action@v2
with:
aws_s3_endpoint: "${{ secrets.MAP_REPORT_AWS_ENDPOINT }}"
aws_access_key_id: "${{ secrets.MAP_REPORT_AWS_ACCESS_KEY }}"
aws_secret_access_key: "${{ secrets.MAP_REPORT_AWS_SECRET_KEY }}"
source: "./map_analyser_files/"
dest: "s3://${{ secrets.MAP_REPORT_AWS_BUCKET }}/${{steps.names.outputs.random_hash}}"
flags: "--recursive --acl public-read"

- name: 'Trigger map file reporter'
- name: 'Analyse map file'
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: peter-evans/repository-dispatch@v2
with:
repository: flipperdevices/flipper-map-reporter
token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
event-type: map-file-analyse
client-payload: '{"random_hash": "${{steps.names.outputs.random_hash}}", "event_type": "${{steps.names.outputs.event_type}}"}'
run: |
source scripts/toolchain/fbtenv.sh
get_size()
{
SECTION="$1";
arm-none-eabi-size \
-A map_analyser_files/firmware.elf \
| grep "^$SECTION" | awk '{print $2}'
}
export BSS_SIZE="$(get_size ".bss")"
export TEXT_SIZE="$(get_size ".text")"
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==1.1.6 cxxfilt==0.3.0
python3 scripts/map_parser.py map_analyser_files/firmware.elf.map map_analyser_files/firmware.elf.map.all
python3 scripts/map_mariadb_insert.py \
${{ secrets.AMAP_MARIADB_USER }} \
${{ secrets.AMAP_MARIADB_PASSWORD }} \
${{ secrets.AMAP_MARIADB_HOST }} \
${{ secrets.AMAP_MARIADB_PORT }} \
${{ secrets.AMAP_MARIADB_DATABASE }} \
map_analyser_files/firmware.elf.map.all
- name: 'Upload artifacts to update server'
if: ${{ !github.event.pull_request.head.repo.fork }}
Expand Down
6 changes: 4 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ distenv.Depends(firmware_env["FW_RESOURCES"], external_apps_artifacts.resources_

fap_deploy = distenv.PhonyTarget(
"fap_deploy",
"${PYTHON3} ${ROOT_DIR}/scripts/storage.py send ${SOURCE} /ext/apps",
"${PYTHON3} ${FBT_SCRIPT_DIR}/storage.py -p ${FLIP_PORT} send ${SOURCE} /ext/apps",
source=Dir("#/assets/resources/apps"),
)

Expand Down Expand Up @@ -323,7 +323,9 @@ distenv.PhonyTarget(
)

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


# Find blackmagic probe
Expand Down
4 changes: 2 additions & 2 deletions applications/external/hid_app/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ int32_t hid_usb_app(void* p) {

bt_hid_connection_status_changed_callback(BtStatusConnected, app);

DOLPHIN_DEED(DolphinDeedPluginStart);
dolphin_deed(DolphinDeedPluginStart);

view_dispatcher_run(app->view_dispatcher);

Expand Down Expand Up @@ -417,7 +417,7 @@ int32_t hid_ble_app(void* p) {
furi_hal_bt_start_advertising();
bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app);

DOLPHIN_DEED(DolphinDeedPluginStart);
dolphin_deed(DolphinDeedPluginStart);

view_dispatcher_run(app->view_dispatcher);

Expand Down
2 changes: 1 addition & 1 deletion applications/external/mfkey32/mfkey32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ void mfkey32(ProgramState* program_state) {
}
if(keyarray_size > 0) {
// TODO: Should we use DolphinDeedNfcMfcAdd?
DOLPHIN_DEED(DolphinDeedNfcMfcAdd);
dolphin_deed(DolphinDeedNfcMfcAdd);
}
napi_mf_classic_nonce_array_free(nonce_arr);
napi_mf_classic_dict_free(user_dict);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void picopass_scene_device_info_on_enter(void* context) {
FuriString* wiegand_str = furi_string_alloc();
FuriString* sio_str = furi_string_alloc();

DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);

// Setup view
PicopassBlock* AA1 = picopass->dev->dev_data.AA1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void picopass_read_card_worker_callback(PicopassWorkerEvent event, void* context

void picopass_scene_read_card_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);

// Setup view
Popup* popup = picopass->popup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void picopass_scene_read_card_success_on_enter(void* context) {
FuriString* wiegand_str = furi_string_alloc();
FuriString* sio_str = furi_string_alloc();

DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);

// Send notification
notification_message(picopass->notifications, &sequence_success);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void picopass_scene_read_factory_success_on_enter(void* context) {
FuriString* title = furi_string_alloc_set("Factory Default");
FuriString* subtitle = furi_string_alloc_set("");

DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);

// Send notification
notification_message(picopass->notifications, &sequence_success);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void picopass_scene_save_success_popup_callback(void* context) {

void picopass_scene_save_success_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);

// Setup view
Popup* popup = picopass->popup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void picopass_write_card_worker_callback(PicopassWorkerEvent event, void* contex

void picopass_scene_write_card_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);

// Setup view
Popup* popup = picopass->popup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void picopass_scene_write_card_success_on_enter(void* context) {
Widget* widget = picopass->widget;
FuriString* str = furi_string_alloc_set("Write Success!");

DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);

// Send notification
notification_message(picopass->notifications, &sequence_success);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void picopass_write_key_worker_callback(PicopassWorkerEvent event, void* context

void picopass_scene_write_key_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);

// Setup view
Popup* popup = picopass->popup;
Expand Down
2 changes: 1 addition & 1 deletion applications/external/snake_game/snake_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ int32_t snake_game_app(void* p) {

notification_message_block(notification, &sequence_display_backlight_enforce_on);

DOLPHIN_DEED(DolphinDeedPluginGameStart);
dolphin_deed(DolphinDeedPluginGameStart);

SnakeEvent event;
for(bool processing = true; processing;) {
Expand Down
Loading

0 comments on commit 1ac1f0b

Please sign in to comment.