Skip to content

Commit

Permalink
Merge branch 'flipperdevices:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Z3BRO authored Mar 25, 2024
2 parents 353d888 + bb439a9 commit d9eac62
Show file tree
Hide file tree
Showing 764 changed files with 7,597 additions and 4,842 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
- name: 'Find previous comment'
if: ${{ !github.event.pull_request.head.repo.fork && matrix.target == env.DEFAULT_TARGET && github.event.pull_request }}
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -138,7 +138,7 @@ jobs:

- name: 'Create or update comment'
if: ${{ !github.event.pull_request.head.repo.fork && matrix.target == env.DEFAULT_TARGET && github.event.pull_request }}
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -147,6 +147,7 @@ jobs:
- [📦 Update package](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz)
- [📥 DFU file](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-full-${{steps.names.outputs.suffix}}.dfu)
- [☁️ Web/App updater](https://lab.flipper.net/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=${{steps.names.outputs.branch_name}}&version=${{steps.names.outputs.commit_sha}})
- [📊 Size report](https://fw-reports.flipp.dev/?branch=${{steps.names.outputs.branch_name}})
edit-mode: replace

- name: 'SDK submission to staging catalog'
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,33 @@ on:
push:
branches:
- dev
pull_request:

env:
TARGETS: f7
DEFAULT_TARGET: f7

jobs:
check-secret:
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
outputs:
s3-valid-config: ${{ steps.check.outputs.s3-valid-config }}

steps:
- name: 'Check if S3 key exists'
id: check
run: |
if [[ -z "${{ secrets.FW_DOCS_AWS_ACCESS_KEY }}" || -z "${{ secrets.FW_DOCS_AWS_SECRET_KEY }}" || -z "${{ secrets.FW_DOCS_AWS_BUCKET }}" ]]; then
echo "s3-valid-config=false" >> $GITHUB_OUTPUT;
else
echo "s3-valid-config=true" >> $GITHUB_OUTPUT;
fi
doxygen:
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
needs: check-secret
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
Expand All @@ -37,12 +55,17 @@ jobs:
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
- name: 'Generate documentation'
uses: mattnotmitt/[email protected]
uses: mattnotmitt/doxygen-action@edge
env:
DOXY_SRC_ROOT: "${{ github.workspace }}"
DOXY_CONFIG_DIR: "${{ github.workspace }}/documentation/doxygen"
DOXY_OUTPUT_DIR: "${{ github.workspace }}/documentation/doxygen/build"
with:
working-directory: 'documentation/'
doxyfile-path: './doxygen/Doxyfile-awesome.cfg'

- name: 'Upload documentation'
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/dev' && needs.check-secret.outputs.s3-valid-config == 'true' }}
uses: jakejarvis/[email protected]
env:
AWS_S3_BUCKET: "${{ secrets.FW_DOCS_AWS_BUCKET }}"
Expand All @@ -53,4 +76,3 @@ jobs:
DEST_DIR: "${{steps.names.outputs.branch_name}}"
with:
args: "--delete"

12 changes: 8 additions & 4 deletions .github/workflows/pvs_studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
WARNINGS=0
./fbt COMPACT=1 PVSNOBROWSER=1 firmware_pvs || WARNINGS=1
echo "warnings=${WARNINGS}" >> $GITHUB_OUTPUT
if [[ $WARNINGS -ne 0 ]]; then
echo "report-url=https://pvs.flipp.dev/${{steps.names.outputs.branch_name}}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/index.html" >> $GITHUB_OUTPUT
fi
- name: 'Upload report'
if: ${{ !github.event.pull_request.head.repo.fork && (steps.pvs-warn.outputs.warnings != 0) }}
Expand All @@ -62,7 +65,7 @@ jobs:

- name: 'Find Previous Comment'
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request && (steps.pvs-warn.outputs.warnings != 0) }}
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -71,18 +74,19 @@ jobs:

- name: 'Create or update comment'
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request && (steps.pvs-warn.outputs.warnings != 0) }}
uses: peter-evans/create-or-update-comment@v1
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
**PVS-Studio report for commit `${{steps.names.outputs.commit_sha}}`:**
- [Report](https://pvs.flipp.dev/${{steps.names.outputs.branch_name}}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/index.html)
- [Report](${{ steps.pvs-warn.outputs.report-url }})
edit-mode: replace

- name: 'Raise exception'
if: ${{ steps.pvs-warn.outputs.warnings != 0 }}
run: |
echo "Please fix all PVS warnings before merge"
echo "Report: ${{ steps.pvs-warn.outputs.report-url }}"
echo "[PVS report](${{ steps.pvs-warn.outputs.report-url }})" >> $GITHUB_STEP_SUMMARY
exit 1
9 changes: 3 additions & 6 deletions .pvsconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# MLib macros we can't do much about.
//-V:M_LET:1048,1044
//-V:M_EACH:1048,1044
//-V:ARRAY_DEF:760,747,568,776,729,712,654
//-V:LIST_DEF:760,747,568,712,729,654,776
//-V:ARRAY_DEF:760,747,568,776,729,712,654,1103
//-V:LIST_DEF:760,747,568,712,729,654,776,1103
//-V:BPTREE_DEF2:779,1086,557,773,512
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685,1103
//-V:ALGO_DEF:1048,747,1044
//-V:TUPLE_DEF2:524,590,1001,760

Expand Down Expand Up @@ -42,8 +42,5 @@
# Model-related warnings
//-V:with_view_model:1044,1048

# Functions that always return the same error code
//-V:picopass_device_decrypt:1048

# Examples
//V_EXCLUDE_PATH applications/examples/
20 changes: 17 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# construction of certain targets behind command-line options.

import os
from fbt.util import path_as_posix
from fbt.util import open_browser_action

DefaultEnvironment(tools=[])

Expand Down Expand Up @@ -42,6 +42,7 @@ distenv = coreenv.Clone(
"openocd",
"blackmagic",
"jflash",
"doxygen",
],
ENV=os.environ,
UPDATE_BUNDLE_DIR="dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}",
Expand Down Expand Up @@ -229,7 +230,6 @@ 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 @@ -239,7 +239,6 @@ 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 Down Expand Up @@ -419,3 +418,18 @@ distenv.PhonyTarget(
"env",
"@echo $( ${FBT_SCRIPT_DIR.abspath}/toolchain/fbtenv.sh $)",
)

doxy_build = distenv.DoxyBuild(
"documentation/doxygen/build/html/index.html",
"documentation/doxygen/Doxyfile-awesome.cfg",
doxy_env_variables={
"DOXY_SRC_ROOT": Dir(".").abspath,
"DOXY_BUILD_DIR": Dir("documentation/doxygen/build").abspath,
"DOXY_CONFIG_DIR": "documentation/doxygen",
},
)
distenv.Alias("doxygen", doxy_build)
distenv.AlwaysBuild(doxy_build)

# Open generated documentation in browser
distenv.PhonyTarget("doxy", open_browser_action, source=doxy_build)
20 changes: 10 additions & 10 deletions applications/debug/accessor/accessor_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ class AccessorApp {
public:
void run(void);

AccessorApp();
~AccessorApp();
AccessorApp(void);
~AccessorApp(void);

enum class Scene : uint8_t {
Exit,
Start,
};

AccessorAppViewManager* get_view_manager();
AccessorAppViewManager* get_view_manager(void);
void switch_to_next_scene(Scene index);
void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
bool switch_to_previous_scene(uint8_t count = 1);
Scene get_previous_scene();
Scene get_previous_scene(void);

void notify_green_blink();
void notify_success();
void notify_green_blink(void);
void notify_success(void);

char* get_text_store();
uint8_t get_text_store_size();
char* get_text_store(void);
uint8_t get_text_store_size(void);
void set_text_store(const char* text...);

WIEGAND* get_wiegand();
OneWireHost* get_one_wire();
WIEGAND* get_wiegand(void);
OneWireHost* get_one_wire(void);

private:
std::list<Scene> previous_scenes_list = {Scene::Exit};
Expand Down
8 changes: 4 additions & 4 deletions applications/debug/accessor/accessor_view_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ class AccessorAppViewManager {

FuriMessageQueue* event_queue;

AccessorAppViewManager();
~AccessorAppViewManager();
AccessorAppViewManager(void);
~AccessorAppViewManager(void);

void switch_to(ViewType type);

void receive_event(AccessorEvent* event);
void send_event(AccessorEvent* event);

Submenu* get_submenu();
Popup* get_popup();
Submenu* get_submenu(void);
Popup* get_popup(void);

private:
ViewDispatcher* view_dispatcher;
Expand Down
20 changes: 10 additions & 10 deletions applications/debug/accessor/helpers/wiegand.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

class WIEGAND {
public:
WIEGAND();
void begin();
void end();
bool available();
unsigned long getCode();
unsigned long getCodeHigh();
int getWiegandType();
WIEGAND(void);
void begin(void);
void end(void);
bool available(void);
unsigned long getCode(void);
unsigned long getCodeHigh(void);
int getWiegandType(void);

static void ReadD0();
static void ReadD1();
static void ReadD0(void);
static void ReadD1(void);

private:
static bool DoWiegandConversion();
static bool DoWiegandConversion(void);
static unsigned long
GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength);

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/battery_test_app/battery_test_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void battery_test_battery_info_update_model(void* context) {
notification_message(app->notifications, &sequence_display_backlight_on);
}

BatteryTestApp* battery_test_alloc() {
BatteryTestApp* battery_test_alloc(void) {
BatteryTestApp* app = malloc(sizeof(BatteryTestApp));

// Records
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/battery_test_app/views/battery_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static void battery_info_draw_callback(Canvas* canvas, void* context) {
draw_stat(canvas, 104, 42, &I_Health_16x16, health);
}

BatteryInfo* battery_info_alloc() {
BatteryInfo* battery_info_alloc(void) {
BatteryInfo* battery_info = malloc(sizeof(BatteryInfo));
battery_info->view = view_alloc();
view_set_context(battery_info->view, battery_info);
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/battery_test_app/views/battery_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
uint8_t health;
} BatteryInfoModel;

BatteryInfo* battery_info_alloc();
BatteryInfo* battery_info_alloc(void);

void battery_info_free(BatteryInfo* battery_info);

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/bt_debug_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ uint32_t bt_debug_start_view(void* context) {
return BtDebugAppViewSubmenu;
}

BtDebugApp* bt_debug_app_alloc() {
BtDebugApp* bt_debug_app_alloc(void) {
BtDebugApp* app = malloc(sizeof(BtDebugApp));

// Gui
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_carrier_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void bt_test_carrier_timer_callback(void* context) {
}
}

BtCarrierTest* bt_carrier_test_alloc() {
BtCarrierTest* bt_carrier_test_alloc(void) {
BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest));
bt_carrier_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test);
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_carrier_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

typedef struct BtCarrierTest BtCarrierTest;

BtCarrierTest* bt_carrier_test_alloc();
BtCarrierTest* bt_carrier_test_alloc(void);

void bt_carrier_test_free(BtCarrierTest* bt_carrier_test);

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_packet_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static void bt_test_packet_timer_callback(void* context) {
}
}

BtPacketTest* bt_packet_test_alloc() {
BtPacketTest* bt_packet_test_alloc(void) {
BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest));
bt_packet_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_packet_test->bt_test, bt_packet_test);
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_packet_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

typedef struct BtPacketTest BtPacketTest;

BtPacketTest* bt_packet_test_alloc();
BtPacketTest* bt_packet_test_alloc(void);

void bt_packet_test_free(BtPacketTest* bt_packet_test);

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void bt_test_process_back(BtTest* bt_test) {
}
}

BtTest* bt_test_alloc() {
BtTest* bt_test_alloc(void) {
BtTest* bt_test = malloc(sizeof(BtTest));
bt_test->view = view_alloc();
view_set_context(bt_test->view, bt_test);
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/bt_debug_app/views/bt_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef void (*BtTestBackCallback)(void* context);
typedef struct BtTestParam BtTestParam;
typedef void (*BtTestParamChangeCallback)(BtTestParam* param);

BtTest* bt_test_alloc();
BtTest* bt_test_alloc(void);

void bt_test_free(BtTest* bt_test);

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/ccid_test/ccid_test_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ uint32_t ccid_test_exit(void* context) {
return VIEW_NONE;
}

CcidTestApp* ccid_test_app_alloc() {
CcidTestApp* ccid_test_app_alloc(void) {
CcidTestApp* app = malloc(sizeof(CcidTestApp));

// Gui
Expand Down
Loading

0 comments on commit d9eac62

Please sign in to comment.