V43 Release Candidate Changes (#183)
@@ -1,9 +1,9 @@
|
||||
## ⬇️ Download
|
||||
>### [📦 Zipped Archive (.zip)](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/download/{release_tag}/{release_tag}.zip) [recommended]
|
||||
>### [🖥️ Web Updater (chrome)](https://lab.flipper.net/?url={webupdater_url}&channel=XFW-Updater&version={release_tag}) [recommended]
|
||||
|
||||
>### [🐬 qFlipper Package (.tgz)](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/download/{release_tag}/{release_tag}.tgz)
|
||||
|
||||
>### [🖥️ Web Updater (chrome)](https://lab.flipper.net/?url={webupdater_url}&channel=XFW-Updater&version={release_tag}) [not recommended]
|
||||
>### [📦 Zipped Archive (.zip)](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/download/{release_tag}/{release_tag}.zip)
|
||||
|
||||
**Remember to delete your `apps` folders before updating!**\
|
||||
**Check the [install guide](https://github.com/ClaraCrazy/Flipper-Xtreme#install) if you're not sure, or [join our Discord](https://discord.gg/flipper-xtreme) if you have questions or encounter issues!**
|
||||
|
||||
@@ -32,22 +32,11 @@ jobs:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
|
||||
- name: "Update version number"
|
||||
- name: "Read version number"
|
||||
run: |
|
||||
VERSION="$(python -c "print('%04d' % int('${{ github.event.pull_request.title }}'.removeprefix('V').removesuffix(' Release Candidate Changes')), end='')")"
|
||||
DATE="$(python -c "from datetime import date;print(date.today().strftime('%d%m%Y'), end='')")"
|
||||
RELEASE_NAME="XFW-${VERSION}"
|
||||
RELEASE_TAG="${RELEASE_NAME}_${DATE}"
|
||||
RELEASE_TAG="$(grep -o "DIST_SUFFIX = .*" fbt_options.py | cut -d'"' -f2)"
|
||||
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
|
||||
|
||||
sed "s/VERSION = \"XFW-[[:digit:]]\{4\}\"/VERSION = \"${RELEASE_NAME}\"/g" ./scripts/version.py > ./scripts/version.py.new
|
||||
rm ./scripts/version.py
|
||||
mv ./scripts/version.py.new ./scripts/version.py
|
||||
|
||||
sed "s/DIST_SUFFIX = \"XFW-[[:digit:]]\{4\}_[[:digit:]]\{8\}\"/DIST_SUFFIX = \"${RELEASE_TAG}\"/g" ./fbt_options.py > ./fbt_options.py.new
|
||||
rm ./fbt_options.py
|
||||
mv ./fbt_options.py.new ./fbt_options.py
|
||||
|
||||
- name: 'Build the firmware'
|
||||
run: |
|
||||
set -e
|
||||
@@ -58,14 +47,12 @@ jobs:
|
||||
|
||||
- name: "Make tgz, zip and webupdater"
|
||||
run: |
|
||||
cd ./dist/${DEFAULT_TARGET}-*
|
||||
mv flipper-z-${DEFAULT_TARGET}-update-*.tgz ${RELEASE_TAG}.tgz
|
||||
cd ./${DEFAULT_TARGET}-update-*
|
||||
7z a ../${RELEASE_TAG}.zip .
|
||||
cd ..
|
||||
mv ${RELEASE_TAG}.tgz ..
|
||||
mv ${RELEASE_TAG}.zip ..
|
||||
cd ..
|
||||
cd dist/${DEFAULT_TARGET}-*
|
||||
mv ${DEFAULT_TARGET}-update-* ${RELEASE_TAG}
|
||||
tar --format=ustar -czvf ../${RELEASE_TAG}.tgz ${RELEASE_TAG}
|
||||
cd ${RELEASE_TAG}
|
||||
7z a ../../${RELEASE_TAG}.zip .
|
||||
cd ../..
|
||||
python -m pip install pyncclient
|
||||
WEBUPDATER_URL="$(python -c "import nextcloud_client as n;c = n.Client('https://cloud.cynthialabs.net/');c.login('${{ secrets.NC_USER }}', '${{ secrets.NC_PASS }}');c.put_file('XFW-Updater/${RELEASE_TAG}.tgz', '${RELEASE_TAG}.tgz');print(c.share_file_with_link('XFW-Updater/${RELEASE_TAG}.tgz').get_link().rstrip('/') + '/download/${RELEASE_TAG}.tgz', end='')")"
|
||||
echo "WEBUPDATER_URL=${WEBUPDATER_URL}" >> $GITHUB_ENV
|
||||
@@ -74,13 +61,6 @@ jobs:
|
||||
run: |
|
||||
python -c "import json, os;f = '.github/workflow_data/release.md';c = json.load(open(os.environ['GITHUB_EVENT_PATH']))['pull_request']['body'];f_ = open(f);n = f_.read().format(release_tag='${RELEASE_TAG}', webupdater_url='${WEBUPDATER_URL}', changelog=c);f_.close();f_ = open(f, 'w');f_.write(n);f_.close()"
|
||||
|
||||
- name: "Commit new version number"
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
default_author: github_actions
|
||||
message: Update version number
|
||||
add: './fbt_options.py ./scripts/version.py'
|
||||
|
||||
- name: "Merge pull request"
|
||||
uses: "pascalgn/automerge-action@v0.15.6"
|
||||
env:
|
||||
@@ -98,4 +78,4 @@ jobs:
|
||||
dist/${{ env.RELEASE_TAG }}.zip
|
||||
name: "${{ env.RELEASE_TAG }}"
|
||||
tag_name: "${{ env.RELEASE_TAG }}"
|
||||
target_commitish: main
|
||||
target_commitish: ${{ github.event.pull_request.base.ref }}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
*~
|
||||
*.swp
|
||||
*.swo
|
||||
*.gdb_history
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
[submodule "lib/cxxheaderparser"]
|
||||
path = lib/cxxheaderparser
|
||||
url = https://github.com/robotpy/cxxheaderparser.git
|
||||
[submodule "applications/plugins/subbrute"]
|
||||
path = applications/plugins/subbrute
|
||||
url = https://github.com/derskythe/flipperzero-subbrute.git
|
||||
[submodule "applications/plugins/dap_link/lib/free-dap"]
|
||||
path = applications/plugins/dap_link/lib/free-dap
|
||||
[submodule "applications/external/dap_link/lib/free-dap"]
|
||||
path = applications/external/dap_link/lib/free-dap
|
||||
url = https://github.com/ataradov/free-dap.git
|
||||
[submodule "lib/heatshrink"]
|
||||
path = lib/heatshrink
|
||||
url = https://github.com/flipperdevices/heatshrink.git
|
||||
|
||||
@@ -1 +1 @@
|
||||
--ignore-ccache -C gccarm --rules-config .pvsconfig -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/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/STM32CubeWB -e lib/u8g2 -e lib/nanopb -e */arm-none-eabi/* -e applications/plugins/dap_link/lib/free-dap
|
||||
--ignore-ccache -C gccarm --rules-config .pvsconfig -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/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/STM32CubeWB -e lib/u8g2 -e lib/nanopb -e */arm-none-eabi/* -e applications/external/dap_link/lib/free-dap
|
||||
|
||||
@@ -23,6 +23,8 @@ The goal of this Firmware is to regularly bring out amazing updates based on wha
|
||||
- <h4>Stable: Many hours have been spent rewriting core parts of the Flippers firmware as well as some of its apps to ensure stability. A task that was long needed on all Firmware, so we tackled it right away.</h4>
|
||||
|
||||
- <h4>Customizable: Dont like the Animations, want to turn on/off the Home screen icons (battery, SD card etc), change the flippers name or anything like that? You absolutely can. No need to mess with code or deal with weird manifest files. Its all done with an App.</h4>
|
||||
<br><br>
|
||||
Note, the below mentioned changes are only a few things we did. For a full list click [here](https://github.com/ClaraCrazy/Flipper-Xtreme/wiki/Customization)
|
||||
|
||||
-----
|
||||
<br>
|
||||
@@ -157,20 +159,37 @@ Note: This repo is always updated with OFW & Unleashed. No need to mention all t
|
||||
----
|
||||
<br>
|
||||
<h2 align="center">Install:</h2>
|
||||
<br>
|
||||
|
||||
**This is the recommended install procedure. Please follow these steps EXACTLY and CAREFULLY to ensure you install correctly.**
|
||||
**This process will NOT delete any saved files and simply ensures the install goes smoothly.**
|
||||
<br><br>
|
||||
There are 3 methods to install Xtreme, we recommend you use the **Web Updater**, but choose whichever one you prefer:
|
||||
|
||||
- Download the latest release (.zip) from [The releases tab](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/latest)
|
||||
- Extract the archive. This is now your new Firmware folder
|
||||
- Open [qFlipper](https://flipperzero.one/update), head to `SD/Update` and simply move the firmware folder there
|
||||
- On the Flipper, hit the `Arrow Down` button, this will get you to the file menu. In there simply search for your updates folder
|
||||
- Inside that folder, select the Firmware you just moved onto it, and run the file thats simply called `Update`
|
||||
<br>
|
||||
|
||||
- Enjoy!
|
||||
> <details><summary><code>Web Updater (Chrome)</code></summary><ul>
|
||||
> <li>Open the <a href="https://github.com/ClaraCrazy/Flipper-Xtreme/releases/latest">latest release page</a> and click on the <code>Web Updater</code> link</li>
|
||||
> <li>Make sure qFlipper is closed</li>
|
||||
> <li>Click <code>Connect</code> and select your Flipper from the list</li>
|
||||
> <li>Click <code>Install</code> and wait for the update to complete</li>
|
||||
> </ul></details>
|
||||
|
||||
**If you have issues or crashes with that process, you can try to use `Settings > Storage > Factory Reset` then retry the install.**
|
||||
> <details><summary><code>qFlipper Package (.tgz)</code></summary><ul>
|
||||
> <li>Download the qFlipper package (.tgz) from the <a href="https://github.com/ClaraCrazy/Flipper-Xtreme/releases/latest">latest release page</a></li>
|
||||
> <li>Open <a href="https://flipperzero.one/update">qFlipper</a> and connect your Flipper</li>
|
||||
> <li>Click <code>Install from file</code></li>
|
||||
> <li>Select the .tgz you downloaded and wait for the update to complete</li>
|
||||
> </ul></details>
|
||||
|
||||
> <details><summary><code>Zipped Archive (.zip)</code></summary><ul>
|
||||
> <li>Download the zipped archive (.zip) from the <a href="https://github.com/ClaraCrazy/Flipper-Xtreme/releases/latest">latest release page</a></li>
|
||||
> <li>Extract the archive. This is now your new Firmware folder</li>
|
||||
> <li>Open <a href="https://flipperzero.one/update">qFlipper</a>, head to <code>SD/Update</code> and simply move the firmware folder there</li>
|
||||
> <li>On the Flipper, hit the <code>Arrow Down</code> button, this will get you to the file menu. In there simply search for your updates folder</li>
|
||||
> <li>Inside that folder, select the Firmware you just moved onto it, and run the file thats simply called <code>Update</code></li>
|
||||
> </ul></details>
|
||||
|
||||
<br>
|
||||
|
||||
**If you have issues or crashes with the install process, you can try to use `Settings > Storage > Factory Reset` then retry the install.**
|
||||
**Doing that will NOT remove your saved files, it will only forget some settings and paired devices.**
|
||||
|
||||
----
|
||||
@@ -203,7 +222,7 @@ $ ./fbt resources icons dolphin_ext
|
||||
----
|
||||
<h2 align="center">Contributors</h2>
|
||||
|
||||
[](https://github.com/ClaraCrazy/Flipper-Xtreme/graphs/contributors)
|
||||
[](https://github.com/ClaraCrazy/Flipper-Xtreme/graphs/contributors)
|
||||
|
||||
|
||||
----
|
||||
|
||||
@@ -139,34 +139,33 @@ if GetOption("fullenv") or any(
|
||||
basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
|
||||
distenv.Default(basic_dist)
|
||||
|
||||
dist_dir = distenv.GetProjectDirName()
|
||||
dist_dir_name = distenv.GetProjectDirName()
|
||||
dist_dir = distenv.Dir(f"#/dist/{dist_dir_name}")
|
||||
external_apps_artifacts = firmware_env["FW_EXTAPPS"]
|
||||
external_app_list = external_apps_artifacts.application_map.values()
|
||||
|
||||
fap_dist = [
|
||||
distenv.Install(
|
||||
distenv.Dir(f"#/dist/{dist_dir}/apps/debug_elf"),
|
||||
list(
|
||||
app_artifact.debug
|
||||
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
|
||||
),
|
||||
dist_dir.Dir("debug_elf"),
|
||||
list(app_artifact.debug for app_artifact in external_app_list),
|
||||
),
|
||||
*(
|
||||
distenv.Install(
|
||||
f"#/dist/{dist_dir}/apps/{app_artifact.app.fap_category}",
|
||||
app_artifact.compact[0],
|
||||
dist_dir.File(dist_entry[1]).dir,
|
||||
app_artifact.compact,
|
||||
)
|
||||
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
|
||||
for app_artifact in external_app_list
|
||||
for dist_entry in app_artifact.dist_entries
|
||||
),
|
||||
]
|
||||
Depends(
|
||||
fap_dist,
|
||||
list(
|
||||
app_artifact.validator
|
||||
for app_artifact in firmware_env["FW_EXTAPPS"].applications.values()
|
||||
),
|
||||
list(app_artifact.validator for app_artifact in external_app_list),
|
||||
)
|
||||
Alias("fap_dist", fap_dist)
|
||||
# distenv.Default(fap_dist)
|
||||
|
||||
distenv.Depends(firmware_env["FW_RESOURCES"], firmware_env["FW_EXTAPPS"].resources_dist)
|
||||
distenv.Depends(firmware_env["FW_RESOURCES"], external_apps_artifacts.resources_dist)
|
||||
|
||||
# Copy all faps to device
|
||||
|
||||
|
||||
@@ -36,15 +36,20 @@ Applications for main Flipper menu.
|
||||
- `u2f` - U2F Application
|
||||
|
||||
|
||||
## plugins
|
||||
## External
|
||||
|
||||
Extra apps for Plugins & App Loader menus.
|
||||
External applications deployed to SD Card
|
||||
|
||||
- `bt_hid_app` - BT Remote controller
|
||||
- `clock` - Clock application
|
||||
- `dap_link` - DAP Link OnChip debugger
|
||||
- `hid_app` - USB/BT Remote controller
|
||||
- `music_player` - Music player app (demo)
|
||||
- `picopass` - Picopass tool
|
||||
- `nfc_magic` - NFC MFC Magic card application
|
||||
- `picopass` - Picopass reader / writer
|
||||
- `signal_generator` - Signal generator app: PWM and clock generator
|
||||
- `snake_game` - Snake game application
|
||||
|
||||
- `spi_mem_manager` - SPI Memory reader / flasher
|
||||
- `weather_station` - SubGHz weather station
|
||||
|
||||
## services
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
App(
|
||||
appid="UART_Echo",
|
||||
name="[GPIO] UART Echo",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="uart_echo_app",
|
||||
cdefines=["APP_UART_ECHO"],
|
||||
requires=["gui"],
|
||||
|
||||
@@ -362,8 +362,8 @@ static size_t storage_test_apps_count = COUNT_OF(storage_test_apps);
|
||||
static int32_t storage_test_app(void* arg) {
|
||||
UNUSED(arg);
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
storage_common_remove(storage, "/app/test");
|
||||
int32_t ret = storage_file_create(storage, "/app/test", "test");
|
||||
storage_common_remove(storage, "/data/test");
|
||||
int32_t ret = storage_file_create(storage, "/data/test", "test");
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
return ret;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ MU_TEST(test_storage_data_path) {
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
File* file = storage_file_alloc(storage);
|
||||
mu_check(storage_dir_open(file, "/app"));
|
||||
mu_check(storage_dir_open(file, "/data"));
|
||||
mu_check(storage_dir_close(file));
|
||||
storage_file_free(file);
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ App(
|
||||
requires=["gui"],
|
||||
stack_size=1 * 1024,
|
||||
order=60,
|
||||
fap_icon="../../plugins/mousejacker/mouse_10px.png",
|
||||
fap_icon="../../external/mousejacker/mouse_10px.png",
|
||||
fap_category="Debug",
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# Placeholder
|
||||
App(
|
||||
appid="example_apps",
|
||||
name="Example apps bundle",
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# Apps Assets folder Example
|
||||
|
||||
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.
|
||||
|
||||
## What is the Apps Assets Folder?
|
||||
|
||||
The **Apps Assets** folder is a folder where external applications unpack their assets.
|
||||
|
||||
The path to the current application folder is related to the `appid` of the app. The `appid` is used to identify the app in the app store and is stored in the `application.fam` file.
|
||||
The Apps Assets folder is located only on the external storage, the SD card.
|
||||
|
||||
For example, if the `appid` of the app is `snake_game`, the path to the Apps Assets folder will be `/ext/apps_assets/snake_game`. But using raw paths is not recommended, because the path to the Apps Assets folder can change in the future. Use the `/assets` alias instead.
|
||||
|
||||
## How to get the path to the Apps Assets folder?
|
||||
|
||||
You can use `/assets` alias to get the path to the current application data folder. For example, if you want to open a file `database.txt` in the Apps Assets folder, you can use the next path: `/data/database.txt`. But this way is not recommended, because even the `/assets` alias can change in the future.
|
||||
|
||||
We recommend to use the `APP_ASSETS_PATH` macro to get the path to the Apps Assets folder. For example, if you want to open a file `database.txt` in the Apps Assets folder, you can use the next path: `APP_ASSETS_PATH("database.txt")`.
|
||||
|
||||
## What is the difference between the Apps Assets folder and the Apps Data folder?
|
||||
|
||||
The Apps Assets folder is used to store the data <u>provided</u> with the application. For example, if you want to create a game, you can store game levels (contant data) in the Apps Assets folder.
|
||||
|
||||
The Apps Data folder is used to store data <u>generated</u> by the application. For example, if you want to create a game, you can save the progress of the game (user-generated data) in the Apps Data folder.
|
||||
|
||||
## How to provide the data with the app?
|
||||
|
||||
To provide data with an application, you need to create a folder inside your application folder (eg "files") and place the data in it. After that, you need to add `fap_file_assets="files"` to your application.fam file.
|
||||
|
||||
For example, if you want to provide game levels with the application, you need to create a "levels" folder inside the "files" folder and put the game levels in it. After that, you need to add `fap_file_assets="files"` to your application.fam file. The final application folder structure will look like this:
|
||||
|
||||
```
|
||||
snake_game
|
||||
├── application.fam
|
||||
├── snake_game.c
|
||||
└── files
|
||||
└── levels
|
||||
├── level1.txt
|
||||
├── level2.txt
|
||||
└── level3.txt
|
||||
```
|
||||
|
||||
When app is launched, the `files` folder will be unpacked to the Apps Assets folder. The final structure of the Apps Assets folder will look like this:
|
||||
|
||||
```
|
||||
/assets
|
||||
├── .assets.signature
|
||||
└── levels
|
||||
├── level1.txt
|
||||
├── level2.txt
|
||||
└── level3.txt
|
||||
```
|
||||
|
||||
## When will the data be unpacked?
|
||||
|
||||
The data is unpacked when the application starts, if the application is launched for the first time, or if the data within the application is updated.
|
||||
|
||||
When an application is compiled, the contents of the "files" folder are hashed and stored within the application itself. When the application starts, this hash is compared to the hash stored in the `.assets.signature` file. If the hashes differ or the `.assets.signature` file does not exist, the application folder is deleted and the new data is unpacked.
|
||||
@@ -0,0 +1,10 @@
|
||||
App(
|
||||
appid="example_apps_assets",
|
||||
name="Example: Apps Assets",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="example_apps_assets_main",
|
||||
requires=["gui"],
|
||||
stack_size=4 * 1024,
|
||||
fap_category="Examples",
|
||||
fap_file_assets="files",
|
||||
)
|
||||
@@ -0,0 +1,48 @@
|
||||
#include <furi.h>
|
||||
#include <storage/storage.h>
|
||||
#include <toolbox/stream/stream.h>
|
||||
#include <toolbox/stream/file_stream.h>
|
||||
|
||||
// Define log tag
|
||||
#define TAG "example_apps_assets"
|
||||
|
||||
static void example_apps_data_print_file_content(Storage* storage, const char* path) {
|
||||
Stream* stream = file_stream_alloc(storage);
|
||||
FuriString* line = furi_string_alloc();
|
||||
|
||||
FURI_LOG_I(TAG, "----------------------------------------");
|
||||
FURI_LOG_I(TAG, "File \"%s\" content:", path);
|
||||
if(file_stream_open(stream, path, FSAM_READ, FSOM_OPEN_EXISTING)) {
|
||||
while(stream_read_line(stream, line)) {
|
||||
furi_string_replace_all(line, "\r", "");
|
||||
furi_string_replace_all(line, "\n", "");
|
||||
FURI_LOG_I(TAG, "%s", furi_string_get_cstr(line));
|
||||
}
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Failed to open file");
|
||||
}
|
||||
FURI_LOG_I(TAG, "----------------------------------------");
|
||||
|
||||
furi_string_free(line);
|
||||
file_stream_close(stream);
|
||||
stream_free(stream);
|
||||
}
|
||||
|
||||
// Application entry point
|
||||
int32_t example_apps_assets_main(void* p) {
|
||||
// Mark argument as unused
|
||||
UNUSED(p);
|
||||
|
||||
// Open storage
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("test_asset.txt"));
|
||||
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("poems/a jelly-fish.txt"));
|
||||
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("poems/theme in yellow.txt"));
|
||||
example_apps_data_print_file_content(storage, APP_ASSETS_PATH("poems/my shadow.txt"));
|
||||
|
||||
// Close storage
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
A Jelly-Fish by Marianne Moore
|
||||
|
||||
Visible, invisible,
|
||||
A fluctuating charm,
|
||||
An amber-colored amethyst
|
||||
Inhabits it; your arm
|
||||
Approaches, and
|
||||
It opens and
|
||||
It closes;
|
||||
You have meant
|
||||
To catch it,
|
||||
And it shrivels;
|
||||
You abandon
|
||||
Your intent—
|
||||
It opens, and it
|
||||
Closes and you
|
||||
Reach for it—
|
||||
The blue
|
||||
Surrounding it
|
||||
Grows cloudy, and
|
||||
It floats away
|
||||
From you.
|
||||
|
||||
source: "https://poets.org/anthology/poems-your-poetry-project-public-domain"
|
||||
@@ -0,0 +1,23 @@
|
||||
My Shadow by Robert Louis Stevenson
|
||||
|
||||
I have a little shadow that goes in and out with me,
|
||||
And what can be the use of him is more than I can see.
|
||||
He is very, very like me from the heels up to the head;
|
||||
And I see him jump before me, when I jump into my bed.
|
||||
|
||||
The funniest thing about him is the way he likes to grow—
|
||||
Not at all like proper children, which is always very slow;
|
||||
For he sometimes shoots up taller like an India-rubber ball,
|
||||
And he sometimes gets so little that there’s none of him at all.
|
||||
|
||||
He hasn’t got a notion of how children ought to play,
|
||||
And can only make a fool of me in every sort of way.
|
||||
He stays so close beside me, he’s a coward you can see;
|
||||
I’d think shame to stick to nursie as that shadow sticks to me!
|
||||
|
||||
One morning, very early, before the sun was up,
|
||||
I rose and found the shining dew on every buttercup;
|
||||
But my lazy little shadow, like an arrant sleepy-head,
|
||||
Had stayed at home behind me and was fast asleep in bed.
|
||||
|
||||
source: "https://poets.org/anthology/poems-your-poetry-project-public-domain"
|
||||
@@ -0,0 +1,19 @@
|
||||
Theme in Yellow by Carl Sandburg
|
||||
|
||||
I spot the hills
|
||||
With yellow balls in autumn.
|
||||
I light the prairie cornfields
|
||||
Orange and tawny gold clusters
|
||||
And I am called pumpkins.
|
||||
On the last of October
|
||||
When dusk is fallen
|
||||
Children join hands
|
||||
And circle round me
|
||||
Singing ghost songs
|
||||
And love to the harvest moon;
|
||||
I am a jack-o'-lantern
|
||||
With terrible teeth
|
||||
And the children know
|
||||
I am fooling.
|
||||
|
||||
source: "https://poets.org/anthology/poems-your-poetry-project-public-domain"
|
||||
@@ -0,0 +1 @@
|
||||
## This is test file content
|
||||
@@ -9,10 +9,16 @@ The **Apps Data** folder is a folder used to store data for external apps that a
|
||||
The path to the current application folder is related to the `appid` of the app. The `appid` is used to identify the app in the app store and is stored in the `application.fam` file.
|
||||
The Apps Data folder is located only on the external storage, the SD card.
|
||||
|
||||
For example, if the `appid` of the app is `snake_game`, the path to the Apps Data folder will be `/ext/apps_data/snake_game`. But using raw paths is not recommended, because the path to the Apps Data folder can change in the future. Use the `/app` alias instead.
|
||||
For example, if the `appid` of the app is `snake_game`, the path to the Apps Data folder will be `/ext/apps_data/snake_game`. But using raw paths is not recommended, because the path to the Apps Data folder can change in the future. Use the `/data` alias instead.
|
||||
|
||||
## How to get the path to the Apps Data folder?
|
||||
|
||||
You can use `/app` alias to get the path to the current application data folder. For example, if you want to open a file `config.txt` in the Apps Data folder, you can use the next path: `/app/config.txt`. But this way is not recommended, because even the `/app` alias can change in the future.
|
||||
You can use `/data` alias to get the path to the current application data folder. For example, if you want to open a file `config.txt` in the Apps Data folder, you can use the next path: `/data/config.txt`. But this way is not recommended, because even the `/data` alias can change in the future.
|
||||
|
||||
We recommend to use the `APP_DATA_PATH` macro to get the path to the Apps Data folder. For example, if you want to open a file `config.txt` in the Apps Data folder, you can use the next path: `APP_DATA_PATH("config.txt")`.
|
||||
We recommend to use the `APP_DATA_PATH` macro to get the path to the Apps Data folder. For example, if you want to open a file `config.txt` in the Apps Data folder, you can use the next path: `APP_DATA_PATH("config.txt")`.
|
||||
|
||||
## What is the difference between the Apps Assets folder and the Apps Data folder?
|
||||
|
||||
The Apps Assets folder is used to store the data <u>provided</u> with the application. For example, if you want to create a game, you can store game levels (contant data) in the Apps Assets folder.
|
||||
|
||||
The Apps Data folder is used to store data <u>generated</u> by the application. For example, if you want to create a game, you can save the progress of the game (user-generated data) in the Apps Data folder.
|
||||
@@ -0,0 +1,31 @@
|
||||
App(
|
||||
appid="example_plugins",
|
||||
name="Example: App w/plugin",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="example_plugins_app",
|
||||
stack_size=2 * 1024,
|
||||
fap_category="Examples",
|
||||
)
|
||||
|
||||
App(
|
||||
appid="example_plugins_multi",
|
||||
name="Example: App w/plugins",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="example_plugins_multi_app",
|
||||
stack_size=2 * 1024,
|
||||
fap_category="Examples",
|
||||
)
|
||||
|
||||
App(
|
||||
appid="example_plugin1",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="example_plugin1_ep",
|
||||
requires=["example_plugins", "example_plugins_multi"],
|
||||
)
|
||||
|
||||
App(
|
||||
appid="example_plugin2",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="example_plugin2_ep",
|
||||
requires=["example_plugins_multi"],
|
||||
)
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* An example of a plugin host application.
|
||||
* Loads a single plugin and calls its methods.
|
||||
*/
|
||||
|
||||
#include "plugin_interface.h"
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <loader/firmware_api/firmware_api.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#define TAG "example_plugins"
|
||||
|
||||
int32_t example_plugins_app(void* p) {
|
||||
UNUSED(p);
|
||||
|
||||
FURI_LOG_I(TAG, "Starting");
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
FlipperApplication* app = flipper_application_alloc(storage, firmware_api_interface);
|
||||
|
||||
do {
|
||||
FlipperApplicationPreloadStatus preload_res =
|
||||
flipper_application_preload(app, APP_DATA_PATH("plugins/example_plugin1.fal"));
|
||||
|
||||
if(preload_res != FlipperApplicationPreloadStatusSuccess) {
|
||||
FURI_LOG_E(TAG, "Failed to preload plugin");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_application_is_plugin(app)) {
|
||||
FURI_LOG_E(TAG, "Plugin file is not a library");
|
||||
break;
|
||||
}
|
||||
|
||||
FlipperApplicationLoadStatus load_status = flipper_application_map_to_memory(app);
|
||||
if(load_status != FlipperApplicationLoadStatusSuccess) {
|
||||
FURI_LOG_E(TAG, "Failed to load plugin file");
|
||||
break;
|
||||
}
|
||||
|
||||
const FlipperAppPluginDescriptor* app_descriptor =
|
||||
flipper_application_plugin_get_descriptor(app);
|
||||
|
||||
FURI_LOG_I(
|
||||
TAG,
|
||||
"Loaded plugin for appid '%s', API %lu",
|
||||
app_descriptor->appid,
|
||||
app_descriptor->ep_api_version);
|
||||
|
||||
furi_check(app_descriptor->ep_api_version == PLUGIN_API_VERSION);
|
||||
furi_check(strcmp(app_descriptor->appid, PLUGIN_APP_ID) == 0);
|
||||
|
||||
const ExamplePlugin* plugin = app_descriptor->entry_point;
|
||||
|
||||
FURI_LOG_I(TAG, "Plugin name: %s", plugin->name);
|
||||
FURI_LOG_I(TAG, "Plugin method1: %d", plugin->method1());
|
||||
FURI_LOG_I(TAG, "Plugin method2(7,8): %d", plugin->method2(7, 8));
|
||||
FURI_LOG_I(TAG, "Plugin method2(1337,228): %d", plugin->method2(1337, 228));
|
||||
} while(false);
|
||||
flipper_application_free(app);
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
FURI_LOG_I(TAG, "Goodbye!");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* An example of an advanced plugin host application.
|
||||
* It uses PluginManager to load all plugins from a directory
|
||||
*/
|
||||
|
||||
#include "plugin_interface.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <flipper_application/plugins/plugin_manager.h>
|
||||
#include <loader/firmware_api/firmware_api.h>
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#define TAG "example_plugins"
|
||||
|
||||
int32_t example_plugins_multi_app(void* p) {
|
||||
UNUSED(p);
|
||||
|
||||
FURI_LOG_I(TAG, "Starting");
|
||||
|
||||
PluginManager* manager =
|
||||
plugin_manager_alloc(PLUGIN_APP_ID, PLUGIN_API_VERSION, firmware_api_interface);
|
||||
|
||||
if(plugin_manager_load_all(manager, APP_DATA_PATH("plugins")) != PluginManagerErrorNone) {
|
||||
FURI_LOG_E(TAG, "Failed to load all libs");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t plugin_count = plugin_manager_get_count(manager);
|
||||
FURI_LOG_I(TAG, "Loaded %lu plugin(s)", plugin_count);
|
||||
|
||||
for(uint32_t i = 0; i < plugin_count; i++) {
|
||||
const ExamplePlugin* plugin = plugin_manager_get_ep(manager, i);
|
||||
FURI_LOG_I(TAG, "plugin name: %s", plugin->name);
|
||||
FURI_LOG_I(TAG, "plugin method1: %d", plugin->method1());
|
||||
FURI_LOG_I(TAG, "plugin method2(7,8): %d", plugin->method2(7, 8));
|
||||
}
|
||||
|
||||
plugin_manager_free(manager);
|
||||
FURI_LOG_I(TAG, "Goodbye!");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/* A simple plugin implementing example_plugins application's plugin interface */
|
||||
|
||||
#include "plugin_interface.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
static int example_plugin1_method1() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
static int example_plugin1_method2(int arg1, int arg2) {
|
||||
return arg1 + arg2;
|
||||
}
|
||||
|
||||
/* Actual implementation of app<>plugin interface */
|
||||
static const ExamplePlugin example_plugin1 = {
|
||||
.name = "Demo App Plugin 1",
|
||||
.method1 = &example_plugin1_method1,
|
||||
.method2 = &example_plugin1_method2,
|
||||
};
|
||||
|
||||
/* Plugin descriptor to comply with basic plugin specification */
|
||||
static const FlipperAppPluginDescriptor example_plugin1_descriptor = {
|
||||
.appid = PLUGIN_APP_ID,
|
||||
.ep_api_version = PLUGIN_API_VERSION,
|
||||
.entry_point = &example_plugin1,
|
||||
};
|
||||
|
||||
/* Plugin entry point - must return a pointer to const descriptor */
|
||||
const FlipperAppPluginDescriptor* example_plugin1_ep() {
|
||||
return &example_plugin1_descriptor;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/* Second plugin implementing example_plugins application's plugin interface */
|
||||
|
||||
#include "plugin_interface.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
static int example_plugin2_method1() {
|
||||
return 1337;
|
||||
}
|
||||
|
||||
static int example_plugin2_method2(int arg1, int arg2) {
|
||||
return arg1 - arg2;
|
||||
}
|
||||
|
||||
/* Actual implementation of app<>plugin interface */
|
||||
static const ExamplePlugin example_plugin2 = {
|
||||
.name = "Demo App Plugin 2",
|
||||
.method1 = &example_plugin2_method1,
|
||||
.method2 = &example_plugin2_method2,
|
||||
};
|
||||
|
||||
/* Plugin descriptor to comply with basic plugin specification */
|
||||
static const FlipperAppPluginDescriptor example_plugin2_descriptor = {
|
||||
.appid = PLUGIN_APP_ID,
|
||||
.ep_api_version = PLUGIN_API_VERSION,
|
||||
.entry_point = &example_plugin2,
|
||||
};
|
||||
|
||||
/* Plugin entry point - must return a pointer to const descriptor */
|
||||
const FlipperAppPluginDescriptor* example_plugin2_ep() {
|
||||
return &example_plugin2_descriptor;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
/* Common interface between a plugin and host applicaion */
|
||||
|
||||
#define PLUGIN_APP_ID "example_plugins"
|
||||
#define PLUGIN_API_VERSION 1
|
||||
|
||||
typedef struct {
|
||||
const char* name;
|
||||
int (*method1)();
|
||||
int (*method2)(int, int);
|
||||
} ExamplePlugin;
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "app_api.h"
|
||||
|
||||
/* Actual implementation of app's API and its private state */
|
||||
|
||||
static uint32_t accumulator = 0;
|
||||
|
||||
void app_api_accumulator_set(uint32_t value) {
|
||||
accumulator = value;
|
||||
}
|
||||
|
||||
uint32_t app_api_accumulator_get() {
|
||||
return accumulator;
|
||||
}
|
||||
|
||||
void app_api_accumulator_add(uint32_t value) {
|
||||
accumulator += value;
|
||||
}
|
||||
|
||||
void app_api_accumulator_sub(uint32_t value) {
|
||||
accumulator -= value;
|
||||
}
|
||||
|
||||
void app_api_accumulator_mul(uint32_t value) {
|
||||
accumulator *= value;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void app_api_accumulator_set(uint32_t value);
|
||||
|
||||
uint32_t app_api_accumulator_get();
|
||||
|
||||
void app_api_accumulator_add(uint32_t value);
|
||||
|
||||
void app_api_accumulator_sub(uint32_t value);
|
||||
|
||||
void app_api_accumulator_mul(uint32_t value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <flipper_application/api_hashtable/api_hashtable.h>
|
||||
|
||||
/*
|
||||
* Resolver interface with private application's symbols.
|
||||
* Implementation is contained in app_api_table.c
|
||||
*/
|
||||
extern const ElfApiInterface* const application_api_interface;
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <flipper_application/api_hashtable/api_hashtable.h>
|
||||
#include <flipper_application/api_hashtable/compilesort.hpp>
|
||||
|
||||
/*
|
||||
* This file contains an implementation of a symbol table
|
||||
* with private app's symbols. It is used by composite API resolver
|
||||
* to load plugins that use internal application's APIs.
|
||||
*/
|
||||
#include "app_api_table_i.h"
|
||||
|
||||
static_assert(!has_hash_collisions(app_api_table), "Detected API method hash collision!");
|
||||
|
||||
constexpr HashtableApiInterface applicaton_hashtable_api_interface{
|
||||
{
|
||||
.api_version_major = 0,
|
||||
.api_version_minor = 0,
|
||||
/* generic resolver using pre-sorted array */
|
||||
.resolver_callback = &elf_resolve_from_hashtable,
|
||||
},
|
||||
/* pointers to application's API table boundaries */
|
||||
.table_cbegin = app_api_table.cbegin(),
|
||||
.table_cend = app_api_table.cend(),
|
||||
};
|
||||
|
||||
/* Casting to generic resolver to use in Composite API resolver */
|
||||
extern "C" const ElfApiInterface* const application_api_interface =
|
||||
&applicaton_hashtable_api_interface;
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "app_api.h"
|
||||
|
||||
/*
|
||||
* A list of app's private functions and objects to expose for plugins.
|
||||
* It is used to generate a table of symbols for import resolver to use.
|
||||
* TBD: automatically generate this table from app's header files
|
||||
*/
|
||||
static constexpr auto app_api_table = sort(create_array_t<sym_entry>(
|
||||
API_METHOD(app_api_accumulator_set, void, (uint32_t)),
|
||||
API_METHOD(app_api_accumulator_get, uint32_t, ()),
|
||||
API_METHOD(app_api_accumulator_add, void, (uint32_t)),
|
||||
API_METHOD(app_api_accumulator_sub, void, (uint32_t)),
|
||||
API_METHOD(app_api_accumulator_mul, void, (uint32_t))));
|
||||
@@ -0,0 +1,24 @@
|
||||
App(
|
||||
appid="example_advanced_plugins",
|
||||
name="Example: advanced plugins",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="example_advanced_plugins_app",
|
||||
stack_size=2 * 1024,
|
||||
fap_category="Examples",
|
||||
)
|
||||
|
||||
App(
|
||||
appid="advanced_plugin1",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="advanced_plugin1_ep",
|
||||
requires=["example_advanced_plugins"],
|
||||
sources=["plugin1.c"],
|
||||
)
|
||||
|
||||
App(
|
||||
appid="advanced_plugin2",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="advanced_plugin2_ep",
|
||||
requires=["example_advanced_plugins"],
|
||||
sources=["plugin2.c"],
|
||||
)
|
||||
@@ -0,0 +1,48 @@
|
||||
#include "app_api.h"
|
||||
#include "plugin_interface.h"
|
||||
#include "app_api_interface.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <flipper_application/plugins/plugin_manager.h>
|
||||
#include <flipper_application/plugins/composite_resolver.h>
|
||||
|
||||
#include <loader/firmware_api/firmware_api.h>
|
||||
|
||||
#define TAG "example_advanced_plugins"
|
||||
|
||||
int32_t example_advanced_plugins_app(void* p) {
|
||||
UNUSED(p);
|
||||
|
||||
FURI_LOG_I(TAG, "Starting");
|
||||
|
||||
CompositeApiResolver* resolver = composite_api_resolver_alloc();
|
||||
composite_api_resolver_add(resolver, firmware_api_interface);
|
||||
composite_api_resolver_add(resolver, application_api_interface);
|
||||
|
||||
PluginManager* manager = plugin_manager_alloc(
|
||||
PLUGIN_APP_ID, PLUGIN_API_VERSION, composite_api_resolver_get(resolver));
|
||||
|
||||
do {
|
||||
if(plugin_manager_load_all(manager, APP_DATA_PATH("plugins")) != PluginManagerErrorNone) {
|
||||
FURI_LOG_E(TAG, "Failed to load all libs");
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t plugin_count = plugin_manager_get_count(manager);
|
||||
FURI_LOG_I(TAG, "Loaded libs: %lu", plugin_count);
|
||||
|
||||
for(uint32_t i = 0; i < plugin_count; i++) {
|
||||
const AdvancedPlugin* plugin = plugin_manager_get_ep(manager, i);
|
||||
FURI_LOG_I(TAG, "plugin name: %s. Calling methods", plugin->name);
|
||||
plugin->method1(228);
|
||||
plugin->method2();
|
||||
FURI_LOG_I(TAG, "Accumulator: %lu", app_api_accumulator_get());
|
||||
}
|
||||
} while(0);
|
||||
|
||||
plugin_manager_free(manager);
|
||||
composite_api_resolver_free(resolver);
|
||||
FURI_LOG_I(TAG, "Goodbye!");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "app_api.h"
|
||||
#include "plugin_interface.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <furi.h>
|
||||
|
||||
static void advanced_plugin1_method1(int arg1) {
|
||||
/* This function is implemented inside host application */
|
||||
app_api_accumulator_add(arg1);
|
||||
}
|
||||
|
||||
static void advanced_plugin1_method2() {
|
||||
/* Accumulator value is stored inside host application */
|
||||
FURI_LOG_I("TEST", "Plugin 1, accumulator: %lu", app_api_accumulator_get());
|
||||
}
|
||||
|
||||
/* Actual implementation of app<>plugin interface */
|
||||
static const AdvancedPlugin advanced_plugin1 = {
|
||||
.name = "Advanced Plugin 1",
|
||||
.method1 = &advanced_plugin1_method1,
|
||||
.method2 = &advanced_plugin1_method2,
|
||||
};
|
||||
|
||||
/* Plugin descriptor to comply with basic plugin specification */
|
||||
static const FlipperAppPluginDescriptor advanced_plugin1_descriptor = {
|
||||
.appid = PLUGIN_APP_ID,
|
||||
.ep_api_version = PLUGIN_API_VERSION,
|
||||
.entry_point = &advanced_plugin1,
|
||||
};
|
||||
|
||||
/* Plugin entry point - must return a pointer to const descriptor */
|
||||
const FlipperAppPluginDescriptor* advanced_plugin1_ep() {
|
||||
return &advanced_plugin1_descriptor;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "app_api.h"
|
||||
#include "plugin_interface.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <furi.h>
|
||||
|
||||
static void advanced_plugin2_method1(int arg1) {
|
||||
/* This function is implemented inside host application */
|
||||
app_api_accumulator_mul(arg1);
|
||||
}
|
||||
|
||||
static void advanced_plugin2_method2() {
|
||||
/* Accumulator value is stored inside host application */
|
||||
FURI_LOG_I("TEST", "Plugin 2, accumulator: %lu", app_api_accumulator_get());
|
||||
}
|
||||
|
||||
/* Actual implementation of app<>plugin interface */
|
||||
static const AdvancedPlugin advanced_plugin2 = {
|
||||
.name = "Advanced Plugin 2",
|
||||
.method1 = &advanced_plugin2_method1,
|
||||
.method2 = &advanced_plugin2_method2,
|
||||
};
|
||||
|
||||
/* Plugin descriptor to comply with basic plugin specification */
|
||||
static const FlipperAppPluginDescriptor advanced_plugin2_descriptor = {
|
||||
.appid = PLUGIN_APP_ID,
|
||||
.ep_api_version = PLUGIN_API_VERSION,
|
||||
.entry_point = &advanced_plugin2,
|
||||
};
|
||||
|
||||
/* Plugin entry point - must return a pointer to const descriptor */
|
||||
const FlipperAppPluginDescriptor* advanced_plugin2_ep() {
|
||||
return &advanced_plugin2_descriptor;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
/* Common interface between a plugin and host applicaion */
|
||||
|
||||
#define PLUGIN_APP_ID "example_plugins_advanced"
|
||||
#define PLUGIN_API_VERSION 1
|
||||
|
||||
typedef struct {
|
||||
const char* name;
|
||||
void (*method1)(int);
|
||||
void (*method2)();
|
||||
} AdvancedPlugin;
|
||||
@@ -19,9 +19,12 @@
|
||||
#include <one_wire/maxim_crc.h>
|
||||
#include <one_wire/one_wire_host.h>
|
||||
|
||||
#include <furi_hal_power.h>
|
||||
|
||||
#define UPDATE_PERIOD_MS 1000UL
|
||||
#define TEXT_STORE_SIZE 64U
|
||||
|
||||
#define DS18B20_CMD_SKIP_ROM 0xccU
|
||||
#define DS18B20_CMD_CONVERT 0x44U
|
||||
#define DS18B20_CMD_READ_SCRATCHPAD 0xbeU
|
||||
|
||||
@@ -92,7 +95,7 @@ static void example_thermo_request_temperature(ExampleThermoContext* context) {
|
||||
/* After the reset, a ROM operation must follow.
|
||||
If there is only one device connected, the "Skip ROM" command is most appropriate
|
||||
(it can also be used to address all of the connected devices in some cases).*/
|
||||
onewire_host_skip(onewire);
|
||||
onewire_host_write(onewire, DS18B20_CMD_SKIP_ROM);
|
||||
/* After the ROM operation, a device-specific command is issued.
|
||||
In this case, it's a request to start measuring the temperature. */
|
||||
onewire_host_write(onewire, DS18B20_CMD_CONVERT);
|
||||
@@ -133,7 +136,7 @@ static void example_thermo_read_temperature(ExampleThermoContext* context) {
|
||||
/* After the reset, a ROM operation must follow.
|
||||
If there is only one device connected, the "Skip ROM" command is most appropriate
|
||||
(it can also be used to address all of the connected devices in some cases).*/
|
||||
onewire_host_skip(onewire);
|
||||
onewire_host_write(onewire, DS18B20_CMD_SKIP_ROM);
|
||||
|
||||
/* After the ROM operation, a device-specific command is issued.
|
||||
This time, it will be the "Read Scratchpad" command which will
|
||||
@@ -267,6 +270,9 @@ static void example_thermo_input_callback(InputEvent* event, void* ctx) {
|
||||
|
||||
/* Starts the reader thread and handles the input */
|
||||
static void example_thermo_run(ExampleThermoContext* context) {
|
||||
/* Enable power on external pins */
|
||||
furi_hal_power_enable_otg();
|
||||
|
||||
/* Configure the hardware in host mode */
|
||||
onewire_host_start(context->onewire);
|
||||
|
||||
@@ -299,6 +305,9 @@ static void example_thermo_run(ExampleThermoContext* context) {
|
||||
|
||||
/* Reset the hardware */
|
||||
onewire_host_stop(context->onewire);
|
||||
|
||||
/* Disable power on external pins */
|
||||
furi_hal_power_disable_otg();
|
||||
}
|
||||
|
||||
/******************** Initialisation & startup *****************************/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "air_mouse.h"
|
||||
|
||||
#include <furi.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#include "tracking/imu/imu.h"
|
||||
|
||||
@@ -146,7 +145,6 @@ int32_t air_mouse_app(void* p) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
DOLPHIN_DEED(DolphinDeedPluginStart);
|
||||
view_dispatcher_run(app->view_dispatcher);
|
||||
|
||||
imu_end();
|
||||
@@ -4,6 +4,6 @@ App(
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="air_mouse_app",
|
||||
stack_size=10 * 1024,
|
||||
fap_icon="mouse_10px.png",
|
||||
fap_category="GPIO",
|
||||
fap_icon="mouse_10px.png",
|
||||
)
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -8,7 +8,7 @@
|
||||
|
||||
#define CALIBRATION_DATA_VER (1)
|
||||
#define CALIBRATION_DATA_FILE_NAME ".calibration.data"
|
||||
#define CALIBRATION_DATA_PATH INT_PATH(CALIBRATION_DATA_FILE_NAME)
|
||||
#define CALIBRATION_DATA_PATH EXT_PATH(CALIBRATION_DATA_FILE_NAME)
|
||||
#define CALIBRATION_DATA_MAGIC (0x23)
|
||||
|
||||
#define CALIBRATION_DATA_SAVE(x) \
|
||||
@@ -0,0 +1,6 @@
|
||||
# Placeholder
|
||||
App(
|
||||
appid="external_apps",
|
||||
name="External apps bundle",
|
||||
apptype=FlipperAppType.METAPACKAGE,
|
||||
)
|
||||
@@ -3,7 +3,6 @@ App(
|
||||
name="Arkanoid",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="arkanoid_game_app",
|
||||
cdefines=["APP_ARKANOID_GAME"],
|
||||
requires=["gui"],
|
||||
stack_size=1 * 1024,
|
||||
order=20,
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 145 B |
@@ -8,8 +8,8 @@ App(
|
||||
stack_size=8 * 1024,
|
||||
order=50,
|
||||
fap_icon="appicon.png",
|
||||
fap_category="Games",
|
||||
fap_icon_assets="assets", # Image assets to compile for this application
|
||||
fap_category="Games",
|
||||
fap_description="An implementation of the classic arcade game Asteroids",
|
||||
fap_author="antirez, SimplyMinimal",
|
||||
fap_weburl="https://github.com/SimplyMinimal/FlipperZero-Asteroids",
|
||||
|
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
|
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |