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 Mar 5, 2024
2 parents fcaf401 + 5e47048 commit a8f8749
Show file tree
Hide file tree
Showing 457 changed files with 28,861 additions and 3,451 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
/applications/services/power_settings_app/ @skotopes @DrZlo13 @hedger @gsurkov @gornekich

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

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

Expand All @@ -58,7 +59,7 @@
/lib/lfrfid/ @skotopes @DrZlo13 @hedger @gsurkov @nminaylov
/lib/libusb_stm32/ @skotopes @DrZlo13 @hedger @gsurkov @nminaylov
/lib/mbedtls/ @skotopes @DrZlo13 @hedger @gsurkov @nminaylov
/lib/micro-ecc/ @skotopes @DrZlo13 @hedger @gsurkov @nminaylov
/lib/mjs/ @skotopes @DrZlo13 @hedger @gsurkov @nminaylov
/lib/nanopb/ @skotopes @DrZlo13 @hedger @gsurkov @nminaylov
/lib/nfc/ @skotopes @DrZlo13 @hedger @gsurkov @gornekich @Astrrra
/lib/one_wire/ @skotopes @DrZlo13 @hedger @gsurkov
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/reindex.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
name: 'Reindex'
name: 'Post-release hooks'

on:
release:
types: [prereleased,released]
types: [prereleased, released]

jobs:
reindex:
name: 'Reindex updates'
name: 'Post-release hooks'
runs-on: [self-hosted, FlipperZeroShell]
steps:
- name: Trigger reindex
- name: 'Checkout code'
uses: actions/checkout@v4

- name: 'Trigger reindex'
run: |
curl --fail -L -H "Token: ${{ secrets.INDEXER_TOKEN }}" \
"${{ secrets.INDEXER_URL }}"/firmware/reindex
"${{ secrets.INDEXER_URL }}"/firmware/reindex;
- name: 'Send release notification'
if: ${{ github.event.action == 'released' }}
run: |
echo '${{ secrets.FIREBASE_TOKEN }}' > firebase-token.json;
python3 -m pip install firebase-admin==6.4.0;
python3 scripts/send_firebase_notification.py \
"--version=${{ github.event.release.name }}" \
"--token=firebase-token.json";
- name: 'Remove firebase token'
if: always()
run: |
rm -rf firebase-token.json;
2 changes: 1 addition & 1 deletion .pvsoptions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--ignore-ccache -C gccarm --rules-config .pvsconfig -e lib/cmsis_core -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/microtar -e lib/mlib -e lib/stm32wb_cmsis -e lib/stm32wb_copro -e lib/stm32wb_hal -e lib/u8g2 -e lib/nanopb -e */arm-none-eabi/*
--ignore-ccache -C gccarm --rules-config .pvsconfig -e lib/cmsis_core -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/microtar -e lib/mlib -e lib/stm32wb_cmsis -e lib/stm32wb_copro -e lib/stm32wb_hal -e lib/u8g2 -e lib/nanopb -e lib/mjs -e */arm-none-eabi/*
15 changes: 6 additions & 9 deletions .vscode/example/cpptools/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,24 @@
"compilerPath": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gcc.exe",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"configurationProvider": "ms-vscode.cpptools",
"cStandard": "gnu17",
"cppStandard": "c++17"
"cStandard": "gnu23",
"cppStandard": "c++20"
},
{
"name": "Linux",
"compilerPath": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gcc",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"configurationProvider": "ms-vscode.cpptools",
"cStandard": "gnu17",
"cppStandard": "c++17"
"cStandard": "gnu23",
"cppStandard": "c++20"
},
{
"name": "Mac",
"compilerPath": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gcc",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"configurationProvider": "ms-vscode.cpptools",
"cStandard": "gnu17",
"cppStandard": "c++17"
"cStandard": "gnu23",
"cppStandard": "c++20"
}
],
"version": 4
Expand Down
16 changes: 5 additions & 11 deletions .vscode/example/settings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
{
"C_Cpp.default.cStandard": "gnu17",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "gnu23",
"C_Cpp.default.cppStandard": "c++20",
"python.formatting.provider": "black",
"workbench.tree.indent": 12,
"cortex-debug.enableTelemetry": false,
"cortex-debug.variableUseNaturalFormat": true,
"cortex-debug.showRTOS": true,
"cortex-debug.armToolchainPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin",
"cortex-debug.armToolchainPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin",
"cortex-debug.armToolchainPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin",
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/openocd/bin/openocd.exe",
"cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
"cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
"cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gdb-py.bat",
"cortex-debug.gdbPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
"cortex-debug.gdbPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gdb-py",
"cortex-debug.armToolchainPath": "${workspaceFolder}/toolchain/current/bin",
"cortex-debug.openocdPath": "${workspaceFolder}/toolchain/current/bin/openocd",
"cortex-debug.gdbPath": "${workspaceFolder}/toolchain/current/bin/arm-none-eabi-gdb-py3",
"editor.formatOnSave": true,
"files.associations": {
"*.scons": "python",
Expand Down
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
5 changes: 4 additions & 1 deletion applications/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ Small applications providing configuration for basic firmware and its services.

## system

Utility apps not visible in other menus.
Utility apps not visible in other menus, plus few external apps pre-packaged with the firmware.

- `hid_app` - BLE & USB HID remote
- `js_app` - JS engine runner
- `snake_game` - Snake game
- `storage_move_to_sd` - Data migration tool for internal storage
- `updater` - Update service & application
2 changes: 1 addition & 1 deletion applications/debug/accessor/accessor_view_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "accessor_view_manager.h"
#include "accessor_event.h"
#include <callback-connector.h>
#include "callback_connector.h"

AccessorAppViewManager::AccessorAppViewManager() {
event_queue = furi_message_queue_alloc(10, sizeof(AccessorEvent));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#ifndef CALLBACKCONNECTOR_H
#define CALLBACKCONNECTOR_H

#ifdef __cplusplus
#include <functional>
namespace cbc {
namespace Details {

template <std::size_t Tag, typename T, typename Ret, typename... Args> class FuncMemberWrapper {
template <std::size_t Tag, typename T, typename Ret, typename... Args>
class FuncMemberWrapper {
public:
FuncMemberWrapper() = delete;
using member_fun_t = Ret (T::*)(Args...);
Expand Down Expand Up @@ -43,7 +46,8 @@ template <std::size_t Tag, typename T, typename Ret, typename... Args>
typename FuncMemberWrapper<Tag, T, Ret, Args...>::const_member_fun_t
FuncMemberWrapper<Tag, T, Ret, Args...>::const_member{};

template <typename Functor, typename Ret, typename... Args> struct FunctorWrapper {
template <typename Functor, typename Ret, typename... Args>
struct FunctorWrapper {
public:
static std::function<Ret(Args...)> functor;
static auto instatiate(Functor fn) {
Expand Down Expand Up @@ -75,7 +79,8 @@ auto const_instantiate(T* t, Ret (T::*ptr)(Args...) const) {
return FuncMemberWrapper<tag, T, Ret, Args...>::instantiate(t, ptr);
}

template <std::size_t tag, typename T, typename Func> auto const_instantiate(T* t, Func ptr) {
template <std::size_t tag, typename T, typename Func>
auto const_instantiate(T* t, Func ptr) {
return const_instantiate(t, ptr);
}

Expand All @@ -91,9 +96,11 @@ auto obtain_connector(T* t, Ret (T::*ptr)(Args...) const) {
return Details::FuncMemberWrapper<tag, T, Ret, Args...>::instantiate(t, ptr);
}

template <typename Functor> auto obtain_connector(Functor functor) {
template <typename Functor>
auto obtain_connector(Functor functor) {
return Details::deducer(std::move(functor), &Functor::operator());
}
} //end of cbc scope

#endif // __cplusplus
#endif // CALLBACKCONNECTOR_H
13 changes: 5 additions & 8 deletions applications/debug/accessor/helpers/wiegand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#include <furi.h>
#include <furi_hal.h>

volatile unsigned long WIEGAND::_cardTempHigh = 0;
volatile unsigned long WIEGAND::_cardTemp = 0;
volatile unsigned long WIEGAND::_lastWiegand = 0;
unsigned long WIEGAND::_cardTempHigh = 0;
unsigned long WIEGAND::_cardTemp = 0;
unsigned long WIEGAND::_lastWiegand = 0;
unsigned long WIEGAND::_code = 0;
unsigned long WIEGAND::_codeHigh = 0;
volatile int WIEGAND::_bitCount = 0;
int WIEGAND::_bitCount = 0;
int WIEGAND::_wiegandType = 0;

constexpr uint32_t clocks_in_ms = 64 * 1000;
Expand Down Expand Up @@ -98,10 +98,7 @@ void WIEGAND::ReadD1() {
_lastWiegand = DWT->CYCCNT; // Keep track of last wiegand bit received
}

unsigned long WIEGAND::GetCardId(
volatile unsigned long* codehigh,
volatile unsigned long* codelow,
char bitlength) {
unsigned long WIEGAND::GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength) {
if(bitlength == 26) // EM tag
return (*codelow & 0x1FFFFFE) >> 1;

Expand Down
14 changes: 6 additions & 8 deletions applications/debug/accessor/helpers/wiegand.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ class WIEGAND {

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

static volatile unsigned long _cardTempHigh;
static volatile unsigned long _cardTemp;
static volatile unsigned long _lastWiegand;
static volatile int _bitCount;
static unsigned long _cardTempHigh;
static unsigned long _cardTemp;
static unsigned long _lastWiegand;
static int _bitCount;
static int _wiegandType;
static unsigned long _code;
static unsigned long _codeHigh;
Expand Down
2 changes: 1 addition & 1 deletion applications/debug/accessor/scene/accessor_scene_start.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "../accessor_app.h"
#include "../accessor_view_manager.h"
#include "../accessor_event.h"
#include <callback-connector.h>
#include "callback_connector.h"
#include "accessor_scene_start.h"

void AccessorSceneStart::on_enter(AccessorApp* app) {
Expand Down
3 changes: 2 additions & 1 deletion applications/debug/battery_test_app/battery_test_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ void battery_test_dialog_callback(DialogExResult result, void* context) {
}
}

uint32_t battery_test_exit_confirm_view() {
uint32_t battery_test_exit_confirm_view(void* context) {
UNUSED(context);
return BatteryTestAppViewExitDialog;
}

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/locale_test/locale_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void locale_test_view_draw_callback(Canvas* canvas, void* _model) {
}
canvas_draw_str(canvas, 0, 10, furi_string_get_cstr(tmp_string));

FuriHalRtcDateTime datetime;
DateTime datetime;
furi_hal_rtc_get_datetime(&datetime);

locale_format_time(tmp_string, &datetime, locale_get_time_format(), false);
Expand Down
Loading

0 comments on commit a8f8749

Please sign in to comment.