[FL-2859,2838] fbt: improvements for FAPs (#1813)
* fbt: assets builder for apps WIP * fbt: automatically building private fap assets * docs: details on how to use image assets * fbt: renamed fap_assets -> fap_icons * fbt: support for fap_extbuild field * docs: info on fap_extbuild * fbt: added --proxy-env parame ter * fbt: made firmware_cdb & updater_cdb targets always available * fbt: renamed fap_icons -> fap_icon_assets * fbt: deprecated firmware_* target names for faps; new alias is "fap_APPID" * fbt: changed intermediate file locations for external apps * fbt: support for fap_private_libs; docs: updates * restored mbedtls as global lib * scripts: lint.py: skip "lib" subfolder * fbt: Sanity checks for building advanced faps as part of fw * docs: info on fap_private_libs; fbt: optimized *.fam indexing * fbt: cleanup; samples: added sample_icons app * fbt: moved example app to applications/examples * linter fix * docs: readme fixes * added applications/examples/application.fam stub * docs: more info on private libs Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
5
applications/examples/application.fam
Normal file
5
applications/examples/application.fam
Normal file
@@ -0,0 +1,5 @@
|
||||
App(
|
||||
appid="sample_apps",
|
||||
name="Sample apps bundle",
|
||||
apptype=FlipperAppType.METAPACKAGE,
|
||||
)
|
10
applications/examples/example_images/application.fam
Normal file
10
applications/examples/example_images/application.fam
Normal file
@@ -0,0 +1,10 @@
|
||||
App(
|
||||
appid="example_images",
|
||||
name="Example: Images",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="example_images_main",
|
||||
requires=["gui"],
|
||||
stack_size=1 * 1024,
|
||||
fap_category="Examples",
|
||||
fap_icon_assets="images",
|
||||
)
|
79
applications/examples/example_images/example_images.c
Normal file
79
applications/examples/example_images/example_images.c
Normal file
@@ -0,0 +1,79 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
#include <gui/gui.h>
|
||||
#include <input/input.h>
|
||||
|
||||
#include "example_images_icons.h"
|
||||
|
||||
typedef struct {
|
||||
uint8_t x, y;
|
||||
} ImagePosition;
|
||||
|
||||
static ImagePosition image_position = {.x = 0, .y = 0};
|
||||
|
||||
// Screen is 128x64 px
|
||||
static void app_draw_callback(Canvas* canvas, void* ctx) {
|
||||
UNUSED(ctx);
|
||||
|
||||
canvas_clear(canvas);
|
||||
canvas_draw_icon(canvas, image_position.x % 128, image_position.y % 64, &I_dolphin_71x25);
|
||||
}
|
||||
|
||||
static void app_input_callback(InputEvent* input_event, void* ctx) {
|
||||
furi_assert(ctx);
|
||||
|
||||
FuriMessageQueue* event_queue = ctx;
|
||||
furi_message_queue_put(event_queue, input_event, FuriWaitForever);
|
||||
}
|
||||
|
||||
int32_t example_images_main(void* p) {
|
||||
UNUSED(p);
|
||||
FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
|
||||
|
||||
// Configure view port
|
||||
ViewPort* view_port = view_port_alloc();
|
||||
view_port_draw_callback_set(view_port, app_draw_callback, view_port);
|
||||
view_port_input_callback_set(view_port, app_input_callback, event_queue);
|
||||
|
||||
// Register view port in GUI
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
InputEvent event;
|
||||
|
||||
bool running = true;
|
||||
while(running) {
|
||||
if(furi_message_queue_get(event_queue, &event, 100) == FuriStatusOk) {
|
||||
if((event.type == InputTypePress) || (event.type == InputTypeRepeat)) {
|
||||
switch(event.key) {
|
||||
case InputKeyLeft:
|
||||
image_position.x -= 2;
|
||||
break;
|
||||
case InputKeyRight:
|
||||
image_position.x += 2;
|
||||
break;
|
||||
case InputKeyUp:
|
||||
image_position.y -= 2;
|
||||
break;
|
||||
case InputKeyDown:
|
||||
image_position.y += 2;
|
||||
break;
|
||||
default:
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
view_port_update(view_port);
|
||||
}
|
||||
|
||||
view_port_enabled_set(view_port, false);
|
||||
gui_remove_view_port(gui, view_port);
|
||||
view_port_free(view_port);
|
||||
furi_message_queue_free(event_queue);
|
||||
|
||||
furi_record_close(RECORD_GUI);
|
||||
|
||||
return 0;
|
||||
}
|
BIN
applications/examples/example_images/images/dolphin_71x25.png
Normal file
BIN
applications/examples/example_images/images/dolphin_71x25.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@@ -10,8 +10,11 @@ App(
|
||||
stack_size=4 * 1024,
|
||||
order=30,
|
||||
fap_icon="../../../assets/icons/Archive/125_10px.png",
|
||||
fap_libs=[
|
||||
"mbedtls",
|
||||
],
|
||||
fap_category="Tools",
|
||||
fap_libs=["mbedtls"],
|
||||
fap_private_libs=[
|
||||
Lib(
|
||||
name="loclass",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
@@ -7,8 +7,8 @@
|
||||
#include <mbedtls/des.h>
|
||||
|
||||
#include "rfal_picopass.h"
|
||||
#include "loclass/optimized_ikeys.h"
|
||||
#include "loclass/optimized_cipher.h"
|
||||
#include <optimized_ikeys.h>
|
||||
#include <optimized_cipher.h>
|
||||
|
||||
#define PICOPASS_DEV_NAME_MAX_LEN 22
|
||||
#define PICOPASS_READER_DATA_MAX_SIZE 64
|
||||
|
Reference in New Issue
Block a user