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 13, 2024
2 parents 10c73f4 + 022fccf commit 353d888
Show file tree
Hide file tree
Showing 329 changed files with 8,660 additions and 3,061 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Generate documentation with Doxygen'

on:
push:
branches:
- dev

env:
TARGETS: f7
DEFAULT_TARGET: f7

jobs:
doxygen:
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;

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

- name: 'Get commit details'
id: names
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
TYPE="pull"
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
TYPE="tag"
else
TYPE="other"
fi
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
- name: 'Generate documentation'
uses: mattnotmitt/[email protected]
with:
working-directory: 'documentation/'
doxyfile-path: './doxygen/Doxyfile-awesome.cfg'

- name: 'Upload documentation'
uses: jakejarvis/[email protected]
env:
AWS_S3_BUCKET: "${{ secrets.FW_DOCS_AWS_BUCKET }}"
AWS_ACCESS_KEY_ID: "${{ secrets.FW_DOCS_AWS_ACCESS_KEY }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.FW_DOCS_AWS_SECRET_KEY }}"
AWS_REGION: "${{ secrets.FW_DOCS_AWS_REGION }}"
SOURCE_DIR: "./documentation/doxygen/build/html"
DEST_DIR: "${{steps.names.outputs.branch_name}}"
with:
args: "--delete"

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;
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@
url = https://github.com/STMicroelectronics/stm32wbxx_hal_driver
[submodule "lib/stm32wb_copro"]
path = lib/stm32wb_copro
url = https://github.com/flipperdevices/stm32wb_copro.git
url = https://github.com/flipperdevices/stm32wb_copro.git
[submodule "documentation/doxygen/doxygen-awesome-css"]
path = documentation/doxygen/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
2 changes: 1 addition & 1 deletion .vscode/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Visual Studio Code workspace for Flipper Zero
# Visual Studio Code workspace for Flipper Zero {#vscode}

## Setup

Expand Down
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
6 changes: 4 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
- [Flipper Zero Firmware Update](https://update.flipperzero.one). Improvements for your dolphin: latest firmware releases, upgrade tools for PC and mobile devices.
- [RGB Github Repo](https://github.com/Z3BRO/Flipper-Zero-RGB). All the information you could need about the Flipper Zero RGB mods.
- [User Documentation](https://docs.flipperzero.one). Learn more about your dolphin: specs, usage guides, and anything you want to ask.
- [Developer Documentation](https://developer.flipper.net/flipperzero/doxygen). Dive into the Flipper Zero Firmware source code: build system, firmware structure, and more.

# Contributing

Our main goal is to build a healthy and sustainable community around Flipper, so we're open to any new ideas and contributions. We also have some rules and taboos here, so please read this page and our [Code of Conduct](/CODE_OF_CONDUCT.md) carefully.

## I need help

The best place to search for answers is our [User Documentation](https://docs.flipperzero.one). If you can't find the answer there, check our [Discord Server](https://flipp.dev/discord) or our [Forum](https://forum.flipperzero.one/).
The best place to search for answers is our [User Documentation](https://docs.flipperzero.one). If you can't find the answer there, check our [Discord Server](https://flipp.dev/discord) or our [Forum](https://forum.flipperzero.one/). If you want to contribute to the firmware development, or modify it for your own needs, you can also check our [Developer Documentation](https://developer.flipper.net/flipperzero/doxygen).

## I want to report an issue

Expand Down Expand Up @@ -96,7 +97,8 @@ Make sure your Flipper is on, and your firmware is functioning. Connect your Fli
- [Hardware combos and Un-bricking](/documentation/KeyCombo.md) - recovering your Flipper from the most nasty situations
- [Flipper File Formats](/documentation/file_formats) - everything about how Flipper stores your data and how you can work with it
- [Universal Remotes](/documentation/UniversalRemotes.md) - contributing your infrared remote to the universal remote database
- And much more in the [documentation](/documentation) folder
- [Firmware Roadmap](/documentation/RoadMap.md)
- And much more in the [Developer Documentation](https://developer.flipper.net/flipperzero/doxygen)

# Project structure

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
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
Loading

0 comments on commit 353d888

Please sign in to comment.