Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
Sil333033 committed Mar 7, 2024
2 parents ab9d462 + 4104dd3 commit 6420e5b
Show file tree
Hide file tree
Showing 100 changed files with 2,116 additions and 262 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"

5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,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
4 changes: 2 additions & 2 deletions applications/drivers/subghz/cc1101_ext/cc1101_ext.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file furi_hal_subghz.h
* SubGhz HAL API
* @file cc1101_ext.h
* @brief External CC1101 transceiver access API.
*/

#pragma once
Expand Down
6 changes: 5 additions & 1 deletion applications/examples/example_apps_assets/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Apps Assets folder Example
# Apps Assets folder Example {#example_app_assets}

This example shows how to use the Apps Assets folder to store data that is not part of the application itself, but is required for its operation, and that data is provided with the application.

## Source code

Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_apps_assets).

## What is the Apps Assets Folder?

The **Apps Assets** folder is a folder where external applications unpack their assets.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @file example_apps_assets.c
* @brief Application assets example.
*/
#include <furi.h>
#include <storage/storage.h>
#include <toolbox/stream/stream.h>
Expand Down
6 changes: 5 additions & 1 deletion applications/examples/example_apps_data/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Apps Data folder Example
# Apps Data folder Example {#example_app_data}

This example demonstrates how to utilize the Apps Data folder to store data that is not part of the app itself, such as user data, configuration files, and so forth.

## Source code

Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_apps_data).

## What is the Apps Data Folder?

The **Apps Data** folder is a folder used to store data for external apps that are not part of the main firmware.
Expand Down
4 changes: 4 additions & 0 deletions applications/examples/example_apps_data/example_apps_data.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @file example_apps_data.c
* @brief Application data example.
*/
#include <furi.h>
#include <storage/storage.h>

Expand Down
4 changes: 4 additions & 0 deletions applications/examples/example_ble_beacon/ble_beacon_app.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @file ble_beacon_app.h
* @brief BLE beacon example.
*/
#pragma once

#include "extra_beacon.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @file example_custom_font.c
* @brief Custom font example.
*/
#include <furi.h>
#include <furi_hal.h>

Expand Down
19 changes: 15 additions & 4 deletions applications/examples/example_images/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# Application icons
# Application icons {#example_app_images}

## Source code

Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_images).

## General principle

To use icons, do the following:
* add a line to the application manifest: `fap_icon_assets="folder"`, where `folder` points to the folder where your icons are located
* add `#include "application_id_icons.h"` to the application code, where `application_id` is the appid from the manifest
* every icon in the folder will be available as a `I_icon_name` variable, where `icon_name` is the name of the icon file without the extension

* Add a line to the application manifest: `fap_icon_assets="folder"`, where `folder` points to the folder where your icons are located
* Add `#include "application_id_icons.h"` to the application code, where `application_id` is the appid from the manifest
* Every icon in the folder will be available as a `I_icon_name` variable, where `icon_name` is the name of the icon file without the extension

## Example

We have an application with the following manifest:

```
App(
appid="example_images",
Expand All @@ -17,6 +27,7 @@ App(
So the icons are in the `images` folder and will be available in the generated `example_images_icons.h` file.

The example code is located in `example_images_main.c` and contains the following line:

```
#include "example_images_icons.h"
```
Expand Down
4 changes: 4 additions & 0 deletions applications/examples/example_images/example_images.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @file example_images.c
* @brief Custom images example.
*/
#include <furi.h>
#include <furi_hal.h>

Expand Down
6 changes: 4 additions & 2 deletions applications/examples/example_plugins/example_plugins.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* An example of a plugin host application.
/**
* @file example_plugins.c
* @brief Plugin host application example.
*
* Loads a single plugin and calls its methods.
*/

Expand Down
6 changes: 4 additions & 2 deletions applications/examples/example_plugins/example_plugins_multi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* An example of an advanced plugin host application.
/**
* @file example_plugins_multi.c
* @brief Advanced plugin host application example.
*
* It uses PluginManager to load all plugins from a directory
*/

Expand Down
7 changes: 6 additions & 1 deletion applications/examples/example_plugins/plugin1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* A simple plugin implementing example_plugins application's plugin interface */
/**
* @file plugin1.c
* @brief Plugin example 1.
*
* A simple plugin implementing example_plugins application's plugin interface
*/

#include "plugin_interface.h"

Expand Down
7 changes: 6 additions & 1 deletion applications/examples/example_plugins/plugin2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* Second plugin implementing example_plugins application's plugin interface */
/**
* @file plugin2.c
* @brief Plugin example 2.
*
* Second plugin implementing example_plugins application's plugin interface
*/

#include "plugin_interface.h"

Expand Down
8 changes: 6 additions & 2 deletions applications/examples/example_plugins/plugin_interface.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/**
* @file plugin_interface.h
* @brief Example plugin interface.
*
* Common interface between a plugin and host application
*/
#pragma once

/* Common interface between a plugin and host application */

#define PLUGIN_APP_ID "example_plugins"
#define PLUGIN_API_VERSION 1

Expand Down
9 changes: 6 additions & 3 deletions applications/examples/example_plugins_advanced/app_api.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#pragma once

/*
/**
* @file app_api.h
* @brief Application API example.
*
* This file contains an API that is internally implemented by the application
* It is also exposed to plugins to allow them to use the application's API.
*/
#pragma once

#include <stdint.h>

#ifdef __cplusplus
Expand Down
5 changes: 4 additions & 1 deletion applications/examples/example_plugins_advanced/plugin1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/*
/**
* @file plugin1.c
* @brief Plugin example 1.
*
* This plugin uses both firmware's API interface and private application headers.
* It can be loaded by a plugin manager that uses CompoundApiInterface,
* which combines both interfaces.
Expand Down
5 changes: 4 additions & 1 deletion applications/examples/example_plugins_advanced/plugin2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/*
/**
* @file plugin2.c
* @brief Plugin example 2.
*
* This plugin uses both firmware's API interface and private application headers.
* It can be loaded by a plugin manager that uses CompoundApiInterface,
* which combines both interfaces.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/**
* @file plugin_interface.h
* @brief Example plugin interface.
*
* Common interface between a plugin and host application
*/
#pragma once

/* Common interface between a plugin and host application */

#define PLUGIN_APP_ID "example_plugins_advanced"
#define PLUGIN_API_VERSION 1

Expand Down
10 changes: 9 additions & 1 deletion applications/examples/example_thermo/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# 1-Wire Thermometer
# 1-Wire Thermometer {#example_thermo}

This example application demonstrates the use of the 1-Wire library with a DS18B20 thermometer.
It also covers basic GUI, input handling, threads and localisation.

## Source code

Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_thermo).

## Electrical connections

Before launching the application, connect the sensor to Flipper's external GPIO according to the table below:
| DS18B20 | Flipper |
| :-----: | :-----: |
Expand All @@ -15,12 +21,14 @@ Before launching the application, connect the sensor to Flipper's external GPIO
*NOTE 2*: For any other pin than 17, connect an external 4.7k pull-up resistor to pin 9.

## Launching the application

In order to launch this demo, follow the steps below:
1. Make sure your Flipper has an SD card installed.
2. Connect your Flipper to the computer via a USB cable.
3. Run `./fbt launch APPSRC=example_thermo` in your terminal emulator of choice.

## Changing the data pin

It is possible to use other GPIO pin as a 1-Wire data pin. In order to change it, set the `THERMO_GPIO_PIN` macro to any of the options listed below:

```c
Expand Down
5 changes: 4 additions & 1 deletion applications/examples/example_thermo/example_thermo.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/*
/**
* @file example_thermo.c
* @brief 1-Wire thermometer example.
*
* This file contains an example application that reads and displays
* the temperature from a DS18B20 1-wire thermometer.
*
Expand Down
14 changes: 8 additions & 6 deletions applications/main/nfc/plugins/supported_cards/troika.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include "nfc_supported_card_plugin.h"
#include <flipper_application.h>
#include <core/check.h>

#include <flipper_application/flipper_application.h>

#include <nfc/nfc_device.h>
#include <bit_lib/bit_lib.h>
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
#include "../../api/mosgortrans/mosgortrans_util.h"

#include <bit_lib.h>
#include <datetime.h>
#include "furi_hal_rtc.h"

#define TAG "Troika"

Expand Down Expand Up @@ -88,7 +90,7 @@ static bool troika_get_card_config(TroikaCardConfig* config, MfClassicType type)
config->data_sector = 11;
config->keys = troika_1k_keys;
} else if(type == MfClassicType4k) {
config->data_sector = 11;
config->data_sector = 8; // Further testing needed
config->keys = troika_4k_keys;
} else {
success = false;
Expand Down Expand Up @@ -244,4 +246,4 @@ static const FlipperAppPluginDescriptor troika_plugin_descriptor = {
/* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* troika_plugin_ep() {
return &troika_plugin_descriptor;
}
}
1 change: 0 additions & 1 deletion applications/services/gui/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ void canvas_draw_bitmap(
* @param x x coordinate
* @param y y coordinate
* @param icon Icon instance
* @param flip IconFlip
* @param rotation IconRotation
*/
void canvas_draw_icon_ex(
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/canvas_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ CanvasOrientation canvas_get_orientation(const Canvas* canvas);

/** Draw a u8g2 bitmap
*
* @param canvas Canvas instance
* @param u8g2 u8g2 instance
* @param x x coordinate
* @param y y coordinate
* @param width width
Expand Down
3 changes: 1 addition & 2 deletions applications/services/gui/elements.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ void elements_bubble(Canvas* canvas, uint8_t x, uint8_t y, uint8_t width, uint8_
* @param canvas Canvas instance
* @param x left x coordinates
* @param y top y coordinate
* @param width bubble width
* @param height bubble height
* @param text text to display
* @param horizontal horizontal aligning
* @param vertical aligning
*/
Expand Down
1 change: 0 additions & 1 deletion applications/services/gui/modules/dialog_ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ void dialog_ex_set_text(
* @param x x position
* @param y y position
* @param icon The icon
* @param name icon to be shown
*/
void dialog_ex_set_icon(DialogEx* dialog_ex, uint8_t x, uint8_t y, const Icon* icon);

Expand Down
Loading

0 comments on commit 6420e5b

Please sign in to comment.