Update apps

This commit is contained in:
Willy-JL
2023-07-14 02:43:32 +02:00
parent 1243b192be
commit a33a461074
65 changed files with 696 additions and 169 deletions

View File

@@ -4,6 +4,7 @@
#include <input/input.h> #include <input/input.h>
#include <notification/notification.h> #include <notification/notification.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
#include <dolphin/dolphin.h>
static int matrix[6][7] = {0}; static int matrix[6][7] = {0};
static int cursorx = 3; static int cursorx = 3;

View File

@@ -1,6 +1,7 @@
#include <gui/gui.h> #include <gui/gui.h>
#include <stdlib.h> #include <stdlib.h>
#include <dolphin/dolphin.h>
#include <dialogs/dialogs.h> #include <dialogs/dialogs.h>
#include <gui/canvas_i.h> #include <gui/canvas_i.h>
@@ -629,4 +630,4 @@ free_and_exit:
furi_message_queue_free(event_queue); furi_message_queue_free(event_queue);
return return_code; return return_code;
} }

View File

@@ -9,7 +9,7 @@ App(
], ],
stack_size=8 * 1024, stack_size=8 * 1024,
fap_icon="bfico.png", fap_icon="bfico.png",
fap_category="Misc", fap_category="Tools",
fap_icon_assets="icons", fap_icon_assets="icons",
fap_author="@nymda", fap_author="@nymda",
fap_weburl="https://github.com/nymda/FlipperZeroBrainfuck", fap_weburl="https://github.com/nymda/FlipperZeroBrainfuck",

View File

@@ -38,7 +38,6 @@ typedef unsigned char byte;
#include <toolbox/stream/file_stream.h> #include <toolbox/stream/file_stream.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
#include <notification/notification_app.h>
#define BF_INST_BUFFER_SIZE 2048 #define BF_INST_BUFFER_SIZE 2048
#define BF_OUTPUT_SIZE 512 #define BF_OUTPUT_SIZE 512

View File

@@ -20,6 +20,12 @@ typedef struct {
int right; int right;
} bMapping; } bMapping;
#ifdef FW_ORIGIN_Official
#define FONT_NAME FontSecondary
#else
#define FONT_NAME FontBatteryPercent
#endif
static bool bf_dev_process_up(BFDevEnv* devEnv); static bool bf_dev_process_up(BFDevEnv* devEnv);
static bool bf_dev_process_down(BFDevEnv* devEnv); static bool bf_dev_process_down(BFDevEnv* devEnv);
static bool bf_dev_process_left(BFDevEnv* devEnv); static bool bf_dev_process_left(BFDevEnv* devEnv);
@@ -63,7 +69,7 @@ static void bf_dev_draw_button(Canvas* canvas, int x, int y, bool selected, cons
if(selected) { if(selected) {
canvas_draw_rbox(canvas, x, y, BT_X, BT_Y, 3); canvas_draw_rbox(canvas, x, y, BT_X, BT_Y, 3);
canvas_invert_color(canvas); canvas_invert_color(canvas);
canvas_set_font(canvas, FontBatteryPercent); canvas_set_font(canvas, FONT_NAME);
canvas_draw_str_aligned( canvas_draw_str_aligned(
canvas, x + (BT_X / 2), y + (BT_Y / 2) - 1, AlignCenter, AlignCenter, lbl); canvas, x + (BT_X / 2), y + (BT_Y / 2) - 1, AlignCenter, AlignCenter, lbl);
canvas_invert_color(canvas); canvas_invert_color(canvas);
@@ -73,7 +79,7 @@ static void bf_dev_draw_button(Canvas* canvas, int x, int y, bool selected, cons
canvas_draw_rbox(canvas, x + 2, y - 1, BT_X - 2, BT_Y - 1, 3); canvas_draw_rbox(canvas, x + 2, y - 1, BT_X - 2, BT_Y - 1, 3);
canvas_invert_color(canvas); canvas_invert_color(canvas);
canvas_draw_rframe(canvas, x, y, BT_X, BT_Y, 3); canvas_draw_rframe(canvas, x, y, BT_X, BT_Y, 3);
canvas_set_font(canvas, FontBatteryPercent); canvas_set_font(canvas, FONT_NAME);
canvas_draw_str_aligned( canvas_draw_str_aligned(
canvas, x + (BT_X / 2), y + (BT_Y / 2) - 1, AlignCenter, AlignCenter, lbl); canvas, x + (BT_X / 2), y + (BT_Y / 2) - 1, AlignCenter, AlignCenter, lbl);
} }
@@ -131,7 +137,7 @@ static void bf_dev_draw_callback(Canvas* canvas, void* _model) {
//textbox //textbox
//grossly overcomplicated. not fixing it. //grossly overcomplicated. not fixing it.
canvas_draw_rframe(canvas, 1, 1, 126, 33, 2); canvas_draw_rframe(canvas, 1, 1, 126, 33, 2);
canvas_set_font(canvas, FontBatteryPercent); canvas_set_font(canvas, FONT_NAME);
int dbOffset = 0; int dbOffset = 0;
if(appDev->dataSize > 72) { if(appDev->dataSize > 72) {

View File

@@ -9,7 +9,7 @@ App(
], ],
stack_size=2 * 1024, stack_size=2 * 1024,
fap_icon="caesar_cipher_icon.png", fap_icon="caesar_cipher_icon.png",
fap_category="Misc", fap_category="Tools",
order=20, order=20,
fap_author="@panki27", fap_author="@panki27",
fap_weburl="https://github.com/panki27/caesar-cipher", fap_weburl="https://github.com/panki27/caesar-cipher",

View File

@@ -8,7 +8,7 @@ App(
stack_size=1 * 1024, stack_size=1 * 1024,
order=45, order=45,
fap_icon="calcIcon.png", fap_icon="calcIcon.png",
fap_category="Misc", fap_category="Tools",
fap_author="@n-o-T-I-n-s-a-n-e", fap_author="@n-o-T-I-n-s-a-n-e",
fap_weburl="https://github.com/n-o-T-I-n-s-a-n-e", fap_weburl="https://github.com/n-o-T-I-n-s-a-n-e",
fap_version="1.0", fap_version="1.0",

View File

@@ -12,9 +12,9 @@ App(
stack_size=2 * 1024, stack_size=2 * 1024,
order=20, order=20,
fap_icon="cntdown_timer.png", fap_icon="cntdown_timer.png",
fap_category="Misc", fap_category="Tools",
fap_author="@0w0mewo", fap_author="@0w0mewo",
fap_weburl="https://github.com/0w0mewo/fpz_cntdown_timer", fap_weburl="https://github.com/0w0mewo/fpz_cntdown_timer",
fap_version="1.0", fap_version="1.1",
fap_description="Simple count down timer", fap_description="Simple count down timer",
) )

View File

@@ -129,6 +129,9 @@ static bool countdown_timer_view_on_input(InputEvent* event, void* ctx) {
handle_misc_cmd(hw, CountDownTimerToggleCounting); handle_misc_cmd(hw, CountDownTimerToggleCounting);
} }
break; break;
case InputKeyBack:
return false;
break;
default: default:
break; break;

View File

@@ -6,10 +6,10 @@ App(
requires=[ requires=[
"gui", "gui",
], ],
fap_category="Misc", fap_category="Tools",
fap_icon="counter_icon.png", fap_icon="counter_icon.png",
fap_author="@Krulknul", fap_author="@Krulknul",
fap_weburl="https://github.com/Krulknul/dolphin-counter", fap_weburl="https://github.com/Krulknul/dolphin-counter",
fap_version="1.0", fap_version="1.1",
fap_description="Simple counter", fap_description="Simple counter",
) )

View File

@@ -5,7 +5,7 @@ App(
entry_point="esp8266_deauth_app", entry_point="esp8266_deauth_app",
requires=["gui"], requires=["gui"],
stack_size=2 * 1024, stack_size=2 * 1024,
order=20, order=100,
fap_icon="wifi_10px.png", fap_icon="wifi_10px.png",
fap_category="WiFi", fap_category="WiFi",
fap_author="@SequoiaSan & @xMasterX", fap_author="@SequoiaSan & @xMasterX",

View File

@@ -15,7 +15,7 @@ App(
name="crypto", name="crypto",
), ),
], ],
fap_category="Misc", fap_category="Tools",
fap_description="Crypto toolkit for Flipper", fap_description="Crypto toolkit for Flipper",
fap_author="Struan Clark (xtruan)", fap_author="Struan Clark (xtruan)",
fap_weburl="https://github.com/xtruan/FlipBIP", fap_weburl="https://github.com/xtruan/FlipBIP",

View File

@@ -15,7 +15,7 @@
#include "views/flipbip_startscreen.h" #include "views/flipbip_startscreen.h"
#include "views/flipbip_scene_1.h" #include "views/flipbip_scene_1.h"
#define FLIPBIP_VERSION "v0.0.9" #define FLIPBIP_VERSION "v1.0.0"
#define COIN_BTC 0 #define COIN_BTC 0
#define COIN_DOGE 3 #define COIN_DOGE 3

View File

@@ -1,6 +1,5 @@
#include "flipbip_file.h" #include "flipbip_file.h"
#include <storage/storage.h> #include <storage/storage.h>
#include <applications.h>
#include <loader/loader.h> #include <loader/loader.h>
#include "../helpers/flipbip_string.h" #include "../helpers/flipbip_string.h"
// From: lib/crypto // From: lib/crypto

View File

@@ -21,43 +21,25 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
*/ */
// NOTE: #define FLIPPER_HAL_RANDOM
// random32() and random_buffer() have been replaced in this implementation
// with Flipper Zero specific code. The original code is commented out below.
#include "rand.h" #include "rand.h"
#ifdef FLIPPER_HAL_RANDOM
// NOTE:
// random32() and random_buffer() have been replaced in this implementation
// with Flipper Zero specific code. The original code is disabled by #define.
// Flipper Zero RNG code: // Flipper Zero RNG code:
#include <furi_hal_random.h> #include <furi_hal_random.h>
#ifndef RAND_PLATFORM_INDEPENDENT
// Original code:
// #pragma message("NOT SUITABLE FOR PRODUCTION USE! Replace random32() function with your own secure code.")
// The following code is not supposed to be used in a production environment.
// It's included only to make the library testable.
// The message above tries to prevent any accidental use outside of the test
// environment.
//
// You are supposed to replace the random8() and random32() function with your
// own secure code. There is also a possibility to replace the random_buffer()
// function as it is defined as a weak symbol.
static uint32_t seed = 0; static uint32_t seed = 0;
void random_reseed(const uint32_t value) { void random_reseed(const uint32_t value) {
seed = value; seed = value;
} }
// Original code:
// uint32_t random32(void) {
// // Linear congruential generator from Numerical Recipes
// // https://en.wikipedia.org/wiki/Linear_congruential_generator
// seed = 1664525 * seed + 1013904223;
// return seed;
// }
// Flipper Zero RNG code: // Flipper Zero RNG code:
uint32_t random32(void) { uint32_t random32(void) {
return furi_hal_random_get(); return furi_hal_random_get();
@@ -68,22 +50,42 @@ void random_buffer(uint8_t* buf, size_t len) {
furi_hal_random_fill_buf(buf, len); furi_hal_random_fill_buf(buf, len);
} }
#endif /* RAND_PLATFORM_INDEPENDENT */ #else /* PLATFORM INDEPENDENT */
#pragma message( \
"NOT SUITABLE FOR PRODUCTION USE! Replace random32() function with your own secure code.")
// The following code is not supposed to be used in a production environment.
// It's included only to make the library testable.
// The message above tries to prevent any accidental use outside of the test
// environment.
//
// You are supposed to replace the random8() and random32() function with your
// own secure code. There is also a possibility to replace the random_buffer()
// function as it is defined as a weak symbol.
// //
// The following code is platform independent // The following code is platform independent
// //
// Original code: uint32_t random32(void) {
// void __attribute__((weak)) random_buffer(uint8_t *buf, size_t len) { // Linear congruential generator from Numerical Recipes
// uint32_t r = 0; // https://en.wikipedia.org/wiki/Linear_congruential_generator
// for (size_t i = 0; i < len; i++) { seed = 1664525 * seed + 1013904223;
// if (i % 4 == 0) { return seed;
// r = random32(); }
// }
// buf[i] = (r >> ((i % 4) * 8)) & 0xFF; void __attribute__((weak)) random_buffer(uint8_t* buf, size_t len) {
// } uint32_t r = 0;
// } for(size_t i = 0; i < len; i++) {
if(i % 4 == 0) {
r = random32();
}
buf[i] = (r >> ((i % 4) * 8)) & 0xFF;
}
}
#endif /* FLIPPER_HAL_RANDOM */
uint32_t random_uniform(uint32_t n) { uint32_t random_uniform(uint32_t n) {
uint32_t x = 0, max = 0xFFFFFFFF - (0xFFFFFFFF % n); uint32_t x = 0, max = 0xFFFFFFFF - (0xFFFFFFFF % n);

View File

@@ -47,4 +47,4 @@ bool flipbip_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
void flipbip_scene_scene_1_on_exit(void* context) { void flipbip_scene_scene_1_on_exit(void* context) {
FlipBip* app = context; FlipBip* app = context;
UNUSED(app); UNUSED(app);
} }

View File

@@ -23,7 +23,9 @@
#define DERIV_ACCOUNT 0 #define DERIV_ACCOUNT 0
#define DERIV_CHANGE 0 #define DERIV_CHANGE 0
#define MAX_ADDR_LEN 42 + 1 // 42 = max length of address + null terminator #define MAX_TEXT_LEN 30 // 30 = max length of text
#define MAX_TEXT_BUF (MAX_TEXT_LEN + 1) // max length of text + null terminator
#define MAX_ADDR_BUF (42 + 1) // 42 = max length of address + null terminator
#define NUM_ADDRS 6 #define NUM_ADDRS 6
#define PAGE_LOADING 0 #define PAGE_LOADING 0
@@ -44,10 +46,10 @@
#define TEXT_RECEIVE_ADDRESS "receive address:" #define TEXT_RECEIVE_ADDRESS "receive address:"
#define TEXT_DEFAULT_DERIV "m/44'/X'/0'/0" #define TEXT_DEFAULT_DERIV "m/44'/X'/0'/0"
const char* TEXT_INFO = "-Scroll pages with up/down-" const char* TEXT_INFO = "-Scroll pages with up/down-"
"p1,2) Mnemonic/Seed " "p1,2) BIP39 Mnemonic/Seed"
"p3) xprv Root Key " "p3) BIP32 Root Key "
"p4,5) xprv/xpub Accnt Keys" "p4,5) Prv/Pub Account Keys"
"p6,7) xprv/xpub Extnd Keys" "p6,7) Prv/Pub BIP32 Keys "
"p8+) Receive Addresses "; "p8+) Receive Addresses ";
// #define TEXT_SAVE_QR "Save QR" // #define TEXT_SAVE_QR "Save QR"
@@ -98,6 +100,10 @@ static CONFIDENTIAL char* s_disp_text5 = NULL;
static CONFIDENTIAL char* s_disp_text6 = NULL; static CONFIDENTIAL char* s_disp_text6 = NULL;
// Derivation path text // Derivation path text
static const char* s_derivation_text = TEXT_DEFAULT_DERIV; static const char* s_derivation_text = TEXT_DEFAULT_DERIV;
// Warning text
static bool s_warn_insecure = false;
#define WARN_INSECURE_TEXT_1 "Recommendation:"
#define WARN_INSECURE_TEXT_2 "Set BIP39 Passphrase"
//static bool s_busy = false; //static bool s_busy = false;
void flipbip_scene_1_set_callback( void flipbip_scene_1_set_callback(
@@ -117,13 +123,15 @@ static void flipbip_scene_1_init_address(
uint32_t addr_index) { uint32_t addr_index) {
//s_busy = true; //s_busy = true;
// Buffer for address serialization // buffer for address serialization
const size_t buflen = 40; // subtract 2 for "0x", 1 for null terminator
char buf[40 + 1] = {0}; const size_t buflen = MAX_ADDR_BUF - (2 + 1);
// subtract 2 for "0x"
char buf[MAX_ADDR_BUF - 2] = {0};
// Use static node for address generation // Use static node for address generation
memcpy(s_addr_node, node, sizeof(HDNode)); memcpy(s_addr_node, node, sizeof(HDNode));
memzero(addr_text, MAX_ADDR_LEN); memzero(addr_text, MAX_ADDR_BUF);
hdnode_private_ckd(s_addr_node, addr_index); hdnode_private_ckd(s_addr_node, addr_index);
hdnode_fill_public_key(s_addr_node); hdnode_fill_public_key(s_addr_node);
@@ -158,8 +166,13 @@ static void flipbip_scene_1_init_address(
//s_busy = false; //s_busy = false;
} }
static void flipbip_scene_1_draw_generic(const char* text, size_t line_len) { static void
flipbip_scene_1_draw_generic(const char* text, const size_t line_len, const bool chunk) {
// Split the text into parts // Split the text into parts
size_t len = line_len;
if(len > MAX_TEXT_LEN) {
len = MAX_TEXT_LEN;
}
for(size_t si = 1; si <= 6; si++) { for(size_t si = 1; si <= 6; si++) {
char* ptr = NULL; char* ptr = NULL;
@@ -176,11 +189,18 @@ static void flipbip_scene_1_draw_generic(const char* text, size_t line_len) {
else if(si == 6) else if(si == 6)
ptr = s_disp_text6; ptr = s_disp_text6;
memzero(ptr, 30 + 1); memzero(ptr, MAX_TEXT_BUF);
if(line_len > 30) { strncpy(ptr, text + ((si - 1) * len), len);
strncpy(ptr, text + ((si - 1) * 30), 30); // add a space every 4 characters and shift the text
} else { if(len < 23 && chunk) {
strncpy(ptr, text + ((si - 1) * line_len), line_len); for(size_t i = 0; i < strlen(ptr); i++) {
if(i % 5 == 0) {
for(size_t j = strlen(ptr); j > i; j--) {
ptr[j] = ptr[j - 1];
}
ptr[i] = ' ';
}
}
} }
} }
} }
@@ -220,9 +240,9 @@ static void flipbip_scene_1_draw_mnemonic(const char* mnemonic) {
else if(mi == 6) else if(mi == 6)
ptr = s_disp_text6; ptr = s_disp_text6;
memzero(ptr, 30 + 1); memzero(ptr, MAX_TEXT_BUF);
if(strlen(mnemonic_part) > 30) { if(strlen(mnemonic_part) > MAX_TEXT_LEN) {
strncpy(ptr, mnemonic_part, 30); strncpy(ptr, mnemonic_part, MAX_TEXT_LEN);
} else { } else {
strncpy(ptr, mnemonic_part, strlen(mnemonic_part)); strncpy(ptr, mnemonic_part, strlen(mnemonic_part));
} }
@@ -241,7 +261,7 @@ static void flipbip_scene_1_draw_seed(FlipBipScene1Model* const model) {
// Convert the seed to a hex string // Convert the seed to a hex string
flipbip_btox(model->seed, 64, seed_working); flipbip_btox(model->seed, 64, seed_working);
flipbip_scene_1_draw_generic(seed_working, 22); flipbip_scene_1_draw_generic(seed_working, 22, false);
// Free the working seed memory // Free the working seed memory
memzero(seed_working, seed_working_len); memzero(seed_working, seed_working_len);
@@ -249,12 +269,12 @@ static void flipbip_scene_1_draw_seed(FlipBipScene1Model* const model) {
} }
static void flipbip_scene_1_clear_text() { static void flipbip_scene_1_clear_text() {
memzero((void*)s_disp_text1, 30 + 1); memzero((void*)s_disp_text1, MAX_TEXT_BUF);
memzero((void*)s_disp_text2, 30 + 1); memzero((void*)s_disp_text2, MAX_TEXT_BUF);
memzero((void*)s_disp_text3, 30 + 1); memzero((void*)s_disp_text3, MAX_TEXT_BUF);
memzero((void*)s_disp_text4, 30 + 1); memzero((void*)s_disp_text4, MAX_TEXT_BUF);
memzero((void*)s_disp_text5, 30 + 1); memzero((void*)s_disp_text5, MAX_TEXT_BUF);
memzero((void*)s_disp_text6, 30 + 1); memzero((void*)s_disp_text6, MAX_TEXT_BUF);
} }
void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) { void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
@@ -264,35 +284,40 @@ void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
flipbip_scene_1_clear_text(); flipbip_scene_1_clear_text();
if(model->page == PAGE_INFO) { if(model->page == PAGE_INFO) {
flipbip_scene_1_draw_generic(TEXT_INFO, 27); flipbip_scene_1_draw_generic(TEXT_INFO, 27, false);
} else if(model->page == PAGE_MNEMONIC) { } else if(model->page == PAGE_MNEMONIC) {
flipbip_scene_1_draw_mnemonic(model->mnemonic); flipbip_scene_1_draw_mnemonic(model->mnemonic);
} else if(model->page == PAGE_SEED) { } else if(model->page == PAGE_SEED) {
flipbip_scene_1_draw_seed(model); flipbip_scene_1_draw_seed(model);
} else if(model->page == PAGE_XPRV_ROOT) { } else if(model->page == PAGE_XPRV_ROOT) {
flipbip_scene_1_draw_generic(model->xprv_root, 20); flipbip_scene_1_draw_generic(model->xprv_root, 20, false);
} else if(model->page == PAGE_XPRV_ACCT) { } else if(model->page == PAGE_XPRV_ACCT) {
flipbip_scene_1_draw_generic(model->xprv_account, 20); flipbip_scene_1_draw_generic(model->xprv_account, 20, false);
} else if(model->page == PAGE_XPUB_ACCT) { } else if(model->page == PAGE_XPUB_ACCT) {
flipbip_scene_1_draw_generic(model->xpub_account, 20); flipbip_scene_1_draw_generic(model->xpub_account, 20, false);
} else if(model->page == PAGE_XPRV_EXTD) { } else if(model->page == PAGE_XPRV_EXTD) {
flipbip_scene_1_draw_generic(model->xprv_extended, 20); flipbip_scene_1_draw_generic(model->xprv_extended, 20, false);
} else if(model->page == PAGE_XPUB_EXTD) { } else if(model->page == PAGE_XPUB_EXTD) {
flipbip_scene_1_draw_generic(model->xpub_extended, 20); flipbip_scene_1_draw_generic(model->xpub_extended, 20, false);
} else if(model->page >= PAGE_ADDR_BEGIN && model->page <= PAGE_ADDR_END) { } else if(model->page >= PAGE_ADDR_BEGIN && model->page <= PAGE_ADDR_END) {
uint32_t line_len = 12; size_t line_len = 12;
if(model->coin == FlipBipCoinETH60) { if(model->coin == FlipBipCoinETH60) {
line_len = 14; line_len = 14;
} }
flipbip_scene_1_draw_generic( flipbip_scene_1_draw_generic(
model->recv_addresses[model->page - PAGE_ADDR_BEGIN], line_len); model->recv_addresses[model->page - PAGE_ADDR_BEGIN], line_len, true);
} }
if(model->page == PAGE_LOADING) { if(model->page == PAGE_LOADING) {
canvas_set_font(canvas, FontPrimary); canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 2, 10, TEXT_LOADING); canvas_draw_str(canvas, 2, 10, TEXT_LOADING);
canvas_draw_str(canvas, 7, 30, s_derivation_text); canvas_draw_str(canvas, 7, 30, s_derivation_text);
canvas_draw_icon(canvas, 86, 25, &I_Keychain_39x36); canvas_draw_icon(canvas, 86, 22, &I_Keychain_39x36);
if(s_warn_insecure) {
canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 2, 50, WARN_INSECURE_TEXT_1);
canvas_draw_str(canvas, 2, 60, WARN_INSECURE_TEXT_2);
}
} else if(model->page >= PAGE_ADDR_BEGIN && model->page <= PAGE_ADDR_END) { } else if(model->page >= PAGE_ADDR_BEGIN && model->page <= PAGE_ADDR_END) {
// draw address header // draw address header
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
@@ -461,8 +486,8 @@ static int flipbip_scene_1_model_init(
// Initialize addresses // Initialize addresses
for(uint8_t a = 0; a < NUM_ADDRS; a++) { for(uint8_t a = 0; a < NUM_ADDRS; a++) {
model->recv_addresses[a] = malloc(MAX_ADDR_LEN); model->recv_addresses[a] = malloc(MAX_ADDR_BUF);
memzero(model->recv_addresses[a], MAX_ADDR_LEN); memzero(model->recv_addresses[a], MAX_ADDR_BUF);
flipbip_scene_1_init_address(model->recv_addresses[a], node, coin, a); flipbip_scene_1_init_address(model->recv_addresses[a], node, coin, a);
// Save QR code file // Save QR code file
@@ -586,7 +611,7 @@ void flipbip_scene_1_exit(void* context) {
free((void*)model->xprv_extended); free((void*)model->xprv_extended);
free((void*)model->xpub_extended); free((void*)model->xpub_extended);
for(int a = 0; a < NUM_ADDRS; a++) { for(int a = 0; a < NUM_ADDRS; a++) {
memzero((void*)model->recv_addresses[a], MAX_ADDR_LEN); memzero((void*)model->recv_addresses[a], MAX_ADDR_BUF);
free((void*)model->recv_addresses[a]); free((void*)model->recv_addresses[a]);
} }
} }
@@ -614,6 +639,9 @@ void flipbip_scene_1_enter(void* context) {
const char* passphrase_text = ""; const char* passphrase_text = "";
if(app->passphrase == FlipBipPassphraseOn && strlen(app->passphrase_text) > 0) { if(app->passphrase == FlipBipPassphraseOn && strlen(app->passphrase_text) > 0) {
passphrase_text = app->passphrase_text; passphrase_text = app->passphrase_text;
s_warn_insecure = false;
} else {
s_warn_insecure = true;
} }
// BIP44 Coin setting // BIP44 Coin setting
@@ -685,12 +713,12 @@ FlipBipScene1* flipbip_scene_1_alloc() {
s_addr_node = (HDNode*)malloc(sizeof(HDNode)); s_addr_node = (HDNode*)malloc(sizeof(HDNode));
// allocate the display text // allocate the display text
s_disp_text1 = (char*)malloc(30 + 1); s_disp_text1 = (char*)malloc(MAX_TEXT_BUF);
s_disp_text2 = (char*)malloc(30 + 1); s_disp_text2 = (char*)malloc(MAX_TEXT_BUF);
s_disp_text3 = (char*)malloc(30 + 1); s_disp_text3 = (char*)malloc(MAX_TEXT_BUF);
s_disp_text4 = (char*)malloc(30 + 1); s_disp_text4 = (char*)malloc(MAX_TEXT_BUF);
s_disp_text5 = (char*)malloc(30 + 1); s_disp_text5 = (char*)malloc(MAX_TEXT_BUF);
s_disp_text6 = (char*)malloc(30 + 1); s_disp_text6 = (char*)malloc(MAX_TEXT_BUF);
return instance; return instance;
} }

View File

@@ -99,7 +99,10 @@ int32_t flizzer_tracker_app(void* p) {
UNUSED(p); UNUSED(p);
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
storage_simply_mkdir(storage, FLIZZER_TRACKER_INSTRUMENTS_FOLDER); bool st = storage_simply_mkdir(storage, APPSDATA_FOLDER);
st = storage_simply_mkdir(storage, FLIZZER_TRACKER_FOLDER);
st = storage_simply_mkdir(storage, FLIZZER_TRACKER_INSTRUMENTS_FOLDER);
UNUSED(st);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
FlizzerTrackerApp* tracker = init_tracker(44100, 50, true, 1024); FlizzerTrackerApp* tracker = init_tracker(44100, 50, true, 1024);
@@ -212,4 +215,4 @@ int32_t flizzer_tracker_app(void* p) {
deinit_tracker(tracker); deinit_tracker(tracker);
return 0; return 0;
} }

View File

@@ -22,8 +22,9 @@
#include "sound_engine/sound_engine_filter.h" #include "sound_engine/sound_engine_filter.h"
#include "tracker_engine/tracker_engine_defs.h" #include "tracker_engine/tracker_engine_defs.h"
#define FLIZZER_TRACKER_FOLDER STORAGE_APP_DATA_PATH_PREFIX #define APPSDATA_FOLDER "/ext/apps_data"
#define FLIZZER_TRACKER_INSTRUMENTS_FOLDER APP_DATA_PATH("instruments") #define FLIZZER_TRACKER_FOLDER "/ext/apps_data/flizzer_tracker"
#define FLIZZER_TRACKER_INSTRUMENTS_FOLDER "/ext/apps_data/flizzer_tracker/instruments"
#define FILE_NAME_LEN 64 #define FILE_NAME_LEN 64
typedef enum { typedef enum {
@@ -222,4 +223,4 @@ typedef struct {
} TrackerViewModel; } TrackerViewModel;
void draw_callback(Canvas* canvas, void* ctx); void draw_callback(Canvas* canvas, void* ctx);
bool input_callback(InputEvent* input_event, void* ctx); bool input_callback(InputEvent* input_event, void* ctx);

View File

@@ -310,4 +310,4 @@ void play() {
void stop() { void stop() {
sound_engine_stop(); sound_engine_stop();
tracker_engine_stop(); tracker_engine_stop();
} }

View File

@@ -262,6 +262,7 @@ void deinit_tracker(FlizzerTrackerApp* tracker) {
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SETTINGS); view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SETTINGS);
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_FILE_OVERWRITE); view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_FILE_OVERWRITE);
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SUBMENU_INSTRUMENT); view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SUBMENU_INSTRUMENT);
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_INSTRUMENT_FILE_OVERWRITE);
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SUBMENU_PATTERN_COPYPASTE); view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SUBMENU_PATTERN_COPYPASTE);
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SUBMENU_PATTERN); view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_SUBMENU_PATTERN);
view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_KEYBOARD); view_dispatcher_remove_view(tracker->view_dispatcher, VIEW_KEYBOARD);

View File

@@ -34,6 +34,8 @@ void sound_engine_init(
sound_engine->sine_lut[i] = (uint8_t)((sinf(i / 64.0 * PI) + 1.0) * 127.0); sound_engine->sine_lut[i] = (uint8_t)((sinf(i / 64.0 * PI) + 1.0) * 127.0);
} }
furi_hal_interrupt_set_isr(FuriHalInterruptIdDma1Ch1, NULL, NULL);
furi_hal_interrupt_set_isr_ex( furi_hal_interrupt_set_isr_ex(
FuriHalInterruptIdDma1Ch1, 15, sound_engine_dma_isr, sound_engine); FuriHalInterruptIdDma1Ch1, 15, sound_engine_dma_isr, sound_engine);
@@ -54,7 +56,7 @@ void sound_engine_deinit(SoundEngine* sound_engine) {
furi_hal_gpio_init(&gpio_ext_pa6, GpioModeAnalog, GpioPullNo, GpioSpeedLow); furi_hal_gpio_init(&gpio_ext_pa6, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
} }
furi_hal_interrupt_set_isr_ex(FuriHalInterruptIdDma1Ch1, 13, NULL, NULL); furi_hal_interrupt_set_isr(FuriHalInterruptIdDma1Ch1, NULL, NULL);
sound_engine_stop(); sound_engine_stop();
sound_engine_deinit_timer(); sound_engine_deinit_timer();
} }

View File

@@ -54,5 +54,6 @@ int32_t sound_engine_cycle_and_output_adsr(
} }
} }
return (int32_t)((int32_t)input * (int32_t)(adsr->envelope >> 10) / (int32_t)(MAX_ADSR >> 10) * (int32_t)adsr->volume / (int32_t)MAX_ADSR_VOLUME); return (int32_t)((int32_t)input * (int32_t)(adsr->envelope >> 10) / (int32_t)(MAX_ADSR >> 10) *
(int32_t)adsr->volume / (int32_t)MAX_ADSR_VOLUME);
} }

View File

@@ -7,7 +7,7 @@ App(
requires=[ requires=[
"gui", "gui",
], ],
stack_size=1 * 1024, stack_size=2 * 1024,
fap_icon="geiger.png", fap_icon="geiger.png",
fap_category="GPIO", fap_category="GPIO",
fap_author="@nmrr", fap_author="@nmrr",

View File

@@ -10,6 +10,10 @@
#include <furi_hal_random.h> #include <furi_hal_random.h>
#include <furi_hal_pwm.h> #include <furi_hal_pwm.h>
#include <furi_hal_power.h> #include <furi_hal_power.h>
#include <storage/storage.h>
#include <stream/buffered_file_stream.h>
#include <locale/locale.h>
#define SCREEN_SIZE_X 128 #define SCREEN_SIZE_X 128
#define SCREEN_SIZE_Y 64 #define SCREEN_SIZE_Y 64
@@ -147,6 +151,14 @@ int32_t flipper_geiger_app(void* p) {
furi_delay_ms(10); furi_delay_ms(10);
} }
Storage* storage = furi_record_open(RECORD_STORAGE);
Stream* file_stream = buffered_file_stream_alloc(storage);
FuriString* dataString = furi_string_alloc();
uint32_t epoch = 0;
uint8_t recordData = 0;
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
while(1) { while(1) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, FuriWaitForever); FuriStatus event_status = furi_message_queue_get(event_queue, &event, FuriWaitForever);
@@ -166,6 +178,36 @@ int32_t flipper_geiger_app(void* p) {
screenRefresh = 1; screenRefresh = 1;
furi_mutex_release(mutexVal.mutex); furi_mutex_release(mutexVal.mutex);
} else if(event.input.key == InputKeyUp && event.input.type == InputTypeLong) {
if(recordData == 0) {
notification_message(notification, &sequence_set_only_red_255);
FuriHalRtcDateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
char path[64];
snprintf(
path,
sizeof(path),
EXT_PATH("/geiger-%.4d-%.2d-%.2d--%.2d-%.2d-%.2d.csv"),
datetime.year,
datetime.month,
datetime.day,
datetime.hour,
datetime.minute,
datetime.second);
buffered_file_stream_open(
file_stream, path, FSAM_WRITE, FSOM_CREATE_ALWAYS);
furi_string_printf(dataString, "epoch,cps\n");
stream_write_string(file_stream, dataString);
epoch = 0;
recordData = 1;
} else {
buffered_file_stream_close(file_stream);
notification_message(notification, &sequence_reset_red);
recordData = 0;
}
} else if((event.input.key == InputKeyLeft && } else if((event.input.key == InputKeyLeft &&
event.input.type == InputTypeShort)) { event.input.type == InputTypeShort)) {
furi_mutex_acquire(mutexVal.mutex, FuriWaitForever); furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
@@ -192,6 +234,11 @@ int32_t flipper_geiger_app(void* p) {
} else if(event.type == ClockEventTypeTick) { } else if(event.type == ClockEventTypeTick) {
furi_mutex_acquire(mutexVal.mutex, FuriWaitForever); furi_mutex_acquire(mutexVal.mutex, FuriWaitForever);
if(recordData == 1) {
furi_string_printf(dataString, "%lu,%lu\n", epoch++, counter);
stream_write_string(file_stream, dataString);
}
for(int i = 0; i < SCREEN_SIZE_X / 2 - 1; i++) for(int i = 0; i < SCREEN_SIZE_X / 2 - 1; i++)
mutexVal.line[SCREEN_SIZE_X / 2 - 1 - i] = mutexVal.line[SCREEN_SIZE_X / 2 - 1 - i] =
mutexVal.line[SCREEN_SIZE_X / 2 - 2 - i]; mutexVal.line[SCREEN_SIZE_X / 2 - 2 - i];
@@ -222,6 +269,16 @@ int32_t flipper_geiger_app(void* p) {
if(screenRefresh == 1) view_port_update(view_port); if(screenRefresh == 1) view_port_update(view_port);
} }
if(recordData == 1) {
buffered_file_stream_close(file_stream);
notification_message(notification, &sequence_reset_red);
}
furi_string_free(dataString);
furi_record_close(RECORD_NOTIFICATION);
stream_free(file_stream);
furi_record_close(RECORD_STORAGE);
// Disable 5v power // Disable 5v power
if(furi_hal_power_is_otg_enabled()) { if(furi_hal_power_is_otg_enabled()) {
furi_hal_power_disable_otg(); furi_hal_power_disable_otg();
@@ -230,6 +287,7 @@ int32_t flipper_geiger_app(void* p) {
furi_hal_gpio_disable_int_callback(&gpio_ext_pa7); furi_hal_gpio_disable_int_callback(&gpio_ext_pa7);
furi_hal_gpio_remove_int_callback(&gpio_ext_pa7); furi_hal_gpio_remove_int_callback(&gpio_ext_pa7);
furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4); furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4);
furi_hal_gpio_init(&gpio_ext_pa7, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_message_queue_free(event_queue); furi_message_queue_free(event_queue);
furi_mutex_free(mutexVal.mutex); furi_mutex_free(mutexVal.mutex);

View File

@@ -1,5 +1,5 @@
App( App(
appid="ifttt", appid="esp8266_ifttt_virtual_button",
name="[ESP8266] IFTTT Button", name="[ESP8266] IFTTT Button",
apptype=FlipperAppType.EXTERNAL, apptype=FlipperAppType.EXTERNAL,
entry_point="ifttt_virtual_button_app", entry_point="ifttt_virtual_button_app",

View File

@@ -1,7 +1,8 @@
#include "ifttt_virtual_button.h" #include "ifttt_virtual_button.h"
#define IFTTT_CONFIG_FOLDER APP_DATA_PATH("config") #define IFTTT_FOLDER "/ext/apps_data/ifttt"
const char* CONFIG_FILE_PATH = APP_DATA_PATH("config/config.settings"); #define IFTTT_CONFIG_FOLDER "/ext/apps_data/ifttt/config"
const char* CONFIG_FILE_PATH = "/ext/apps_data/ifttt/config/config.settings";
#define FLIPPERZERO_SERIAL_BAUD 115200 #define FLIPPERZERO_SERIAL_BAUD 115200
typedef enum ESerialCommand { ESerialCommand_Config } ESerialCommand; typedef enum ESerialCommand { ESerialCommand_Config } ESerialCommand;
@@ -218,7 +219,10 @@ int32_t ifttt_virtual_button_app(void* p) {
UNUSED(p); UNUSED(p);
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
storage_simply_mkdir(storage, IFTTT_CONFIG_FOLDER); if(!storage_simply_mkdir(storage, IFTTT_FOLDER)) {
}
if(!storage_simply_mkdir(storage, IFTTT_CONFIG_FOLDER)) {
}
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
uint32_t first_scene = VirtualButtonAppSceneStart; uint32_t first_scene = VirtualButtonAppSceneStart;

View File

@@ -134,4 +134,4 @@ void send_view_set_data(SendView* send_view, bool connected) {
furi_assert(send_view); furi_assert(send_view);
with_view_model( with_view_model(
send_view->view, SendViewModel * model, { model->connected = connected; }, true); send_view->view, SendViewModel * model, { model->connected = connected; }, true);
} }

View File

@@ -8,7 +8,7 @@ App(
"gui", "gui",
"dialogs", "dialogs",
], ],
fap_category="Tools", fap_category="Infrared",
fap_icon="ir_10px.png", fap_icon="ir_10px.png",
fap_author="@Hong5489 & @friebel & @d4ve10", fap_author="@Hong5489 & @friebel & @d4ve10",
fap_weburl="https://github.com/Hong5489/ir_remote", fap_weburl="https://github.com/Hong5489/ir_remote",

View File

@@ -95,6 +95,7 @@ void mifare_fuzzer_free(MifareFuzzerApp* app) {
//FURI_LOG_D(TAG, "mifare_fuzzer_free() :: Views"); //FURI_LOG_D(TAG, "mifare_fuzzer_free() :: Views");
view_dispatcher_remove_view(app->view_dispatcher, MifareFuzzerViewSelectCard); view_dispatcher_remove_view(app->view_dispatcher, MifareFuzzerViewSelectCard);
view_dispatcher_remove_view(app->view_dispatcher, MifareFuzzerViewSelectAttack); view_dispatcher_remove_view(app->view_dispatcher, MifareFuzzerViewSelectAttack);
view_dispatcher_remove_view(app->view_dispatcher, MifareFuzzerViewEmulator);
// Submenus // Submenus
//FURI_LOG_D(TAG, "mifare_fuzzer_free() :: Submenus"); //FURI_LOG_D(TAG, "mifare_fuzzer_free() :: Submenus");

View File

@@ -365,4 +365,4 @@ int32_t clock_app(void* p) {
notification_message(notif, &led_reset); notification_message(notif, &led_reset);
return 0; return 0;
} }

View File

@@ -218,6 +218,21 @@ static void add_to_str_hex_bytes(char* out, uint8_t* arr, int bytes) {
} while(--bytes); } while(--bytes);
} }
// skip leading zeros
static void add_to_str_hex_variable(char* out, uint8_t* arr, int size) {
if(size <= 0) return;
out += strlen(out);
arr += size - 1;
while(*arr == 0 && size > 1) {
arr--;
size--;
}
do {
snprintf(out, 3, "%02X", *arr--);
out += 2;
} while(--size);
}
void Edit_insert_digit(char new) { void Edit_insert_digit(char new) {
if(*Edit_pos == '-') return; if(*Edit_pos == '-') return;
if(what_doing <= 1) { if(what_doing <= 1) {
@@ -506,7 +521,7 @@ bool nrf24_read_newpacket() {
else { else {
char hex[9]; char hex[9];
hex[0] = '\0'; hex[0] = '\0';
add_to_str_hex_bytes(hex, (uint8_t*)&var, size); add_to_str_hex_variable(hex, (uint8_t*)&var, size);
if((cmd_array && cmd_array_hex) || furi_string_end_with_str(str, "0x")) if((cmd_array && cmd_array_hex) || furi_string_end_with_str(str, "0x"))
furi_string_cat_str(str, hex); furi_string_cat_str(str, hex);
else { else {
@@ -883,7 +898,7 @@ static uint8_t load_settings_file() {
NRF_INITED = false; NRF_INITED = false;
while(stream_read_line(file_stream, str)) { while(stream_read_line(file_stream, str)) {
char* p = (char*)furi_string_get_cstr(str); char* p = (char*)furi_string_get_cstr(str);
if(*p <= ' ') continue; if(*p <= '!' || *p == ';') continue;
//char* delim_eq = strchr(p, '='); //char* delim_eq = strchr(p, '=');
char* delim_col = strchr(p, ':'); char* delim_col = strchr(p, ':');
if(delim_col == NULL) { // Constant found - no ':' if(delim_col == NULL) { // Constant found - no ':'
@@ -1288,12 +1303,12 @@ static void render_callback(Canvas* const canvas, void* ctx) {
int32_t n = get_payload_receive_field(pld, len); int32_t n = get_payload_receive_field(pld, len);
if(hex) { if(hex) {
strcat(screen_buf, "0x"); strcat(screen_buf, "0x");
add_to_str_hex_bytes(screen_buf, pld, len); add_to_str_hex_variable(screen_buf, pld, len);
} else { } else {
snprintf(screen_buf + strlen(screen_buf), 20, "%ld", n); snprintf(screen_buf + strlen(screen_buf), 20, "%ld", n);
if(n > 9) { if(n > 9) {
strcat(screen_buf, " ("); strcat(screen_buf, " (");
add_to_str_hex_bytes(screen_buf, pld, len); add_to_str_hex_variable(screen_buf, pld, len);
strcat(screen_buf, ")"); strcat(screen_buf, ")");
} }
} }

View File

@@ -6,7 +6,7 @@ App(
requires=[ requires=[
"gui", "gui",
], ],
fap_category="Misc", fap_category="Tools",
fap_icon="icons/passgen_icon.png", fap_icon="icons/passgen_icon.png",
fap_icon_assets="icons", fap_icon_assets="icons",
) )

View File

@@ -6,14 +6,14 @@
#include <stdlib.h> #include <stdlib.h>
#include <passgen_icons.h> #include <passgen_icons.h>
#include <assets_icons.h> #include <assets_icons.h>
#include <core/string.h>
#define PASSGEN_MAX_LENGTH 16 #define PASSGEN_MAX_LENGTH 16
#define PASSGEN_CHARACTERS_LENGTH (26 * 4)
#define PASSGEN_DIGITS "0123456789" #define PASSGEN_DIGITS "0123456789"
#define PASSGEN_LETTERS_LOW "abcdefghijklmnopqrstuvwxyz" #define PASSGEN_LETTERS_LOW "abcdefghijklmnopqrstuvwxyz"
#define PASSGEN_LETTERS_UP "ABCDEFGHIJKLMNOPQRSTUVWXYZ" #define PASSGEN_LETTERS_UP "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define PASSGEN_SPECIAL "!#$%^&*.-_" #define PASSGEN_SPECIAL "!#$%%^&*.-_"
typedef enum PassGen_Alphabet { typedef enum PassGen_Alphabet {
Digits = 1, Digits = 1,
@@ -46,7 +46,8 @@ typedef struct {
FuriMutex** mutex; FuriMutex** mutex;
NotificationApp* notify; NotificationApp* notify;
char password[PASSGEN_MAX_LENGTH + 1]; char password[PASSGEN_MAX_LENGTH + 1];
char alphabet[PASSGEN_CHARACTERS_LENGTH + 1]; // char alphabet[PASSGEN_CHARACTERS_LENGTH + 1];
FuriString* alphabet;
int length; int length;
int level; int level;
} PassGen; } PassGen;
@@ -58,6 +59,7 @@ void state_free(PassGen* app) {
furi_message_queue_free(app->input_queue); furi_message_queue_free(app->input_queue);
furi_mutex_free(app->mutex); furi_mutex_free(app->mutex);
furi_record_close(RECORD_NOTIFICATION); furi_record_close(RECORD_NOTIFICATION);
furi_string_free(app->alphabet);
free(app); free(app);
} }
@@ -99,17 +101,17 @@ static void render_callback(Canvas* canvas, void* ctx) {
void build_alphabet(PassGen* app) { void build_alphabet(PassGen* app) {
PassGen_Alphabet mode = AlphabetLevels[app->level]; PassGen_Alphabet mode = AlphabetLevels[app->level];
app->alphabet[0] = '\0'; if((mode & Digits) != 0) furi_string_cat(app->alphabet, PASSGEN_DIGITS);
if((mode & Digits) != 0) strcat(app->alphabet, PASSGEN_DIGITS); if((mode & Lowercase) != 0) furi_string_cat(app->alphabet, PASSGEN_LETTERS_LOW);
if((mode & Lowercase) != 0) strcat(app->alphabet, PASSGEN_LETTERS_LOW); if((mode & Uppercase) != 0) furi_string_cat(app->alphabet, PASSGEN_LETTERS_UP);
if((mode & Uppercase) != 0) strcat(app->alphabet, PASSGEN_LETTERS_UP); if((mode & Special) != 0) furi_string_cat(app->alphabet, PASSGEN_SPECIAL);
if((mode & Special) != 0) strcat(app->alphabet, PASSGEN_SPECIAL);
} }
PassGen* state_init() { PassGen* state_init() {
PassGen* app = malloc(sizeof(PassGen)); PassGen* app = malloc(sizeof(PassGen));
app->length = 8; app->length = 8;
app->level = 2; app->level = 2;
app->alphabet = furi_string_alloc();
build_alphabet(app); build_alphabet(app);
app->input_queue = furi_message_queue_alloc(8, sizeof(InputEvent)); app->input_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
app->view_port = view_port_alloc(); app->view_port = view_port_alloc();
@@ -125,10 +127,10 @@ PassGen* state_init() {
} }
void generate(PassGen* app) { void generate(PassGen* app) {
int hi = strlen(app->alphabet); int hi = furi_string_size(app->alphabet);
for(int i = 0; i < app->length; i++) { for(int i = 0; i < app->length; i++) {
int x = rand() % hi; int x = rand() % hi;
app->password[i] = app->alphabet[x]; app->password[i] = furi_string_get_char(app->alphabet, x);
} }
app->password[app->length] = '\0'; app->password[app->length] = '\0';
} }

View File

@@ -5,11 +5,11 @@ App(
entry_point="flipp_pomodoro_app", entry_point="flipp_pomodoro_app",
requires=["gui", "notification", "dolphin"], requires=["gui", "notification", "dolphin"],
stack_size=1 * 1024, stack_size=1 * 1024,
fap_category="Misc", fap_category="Tools",
fap_icon_assets="images", fap_icon_assets="images",
fap_icon="flipp_pomodoro_10.png", fap_icon="flipp_pomodoro_10.png",
fap_author="@Th3Un1q3", fap_author="@Th3Un1q3",
fap_weburl="https://github.com/Th3Un1q3/flipp_pomodoro", fap_weburl="https://github.com/Th3Un1q3/flipp_pomodoro",
fap_version="1.0", fap_version="1.1",
fap_description="Boost Your Productivity with the Pomodoro Timer", fap_description="Boost Your Productivity with the Pomodoro Timer",
) )

View File

@@ -1,5 +1,7 @@
#include "flipp_pomodoro_app_i.h" #include "flipp_pomodoro_app_i.h"
#define TAG "FlippPomodoro"
enum { enum {
CustomEventConsumed = true, CustomEventConsumed = true,
CustomEventNotConsumed = false, CustomEventNotConsumed = false,
@@ -29,6 +31,14 @@ static bool flipp_pomodoro_app_custom_event_callback(void* ctx, uint32_t event)
app->view_dispatcher, FlippPomodoroAppCustomEventStateUpdated); app->view_dispatcher, FlippPomodoroAppCustomEventStateUpdated);
return CustomEventConsumed; return CustomEventConsumed;
case FlippPomodoroAppCustomEventStageComplete: case FlippPomodoroAppCustomEventStageComplete:
if(flipp_pomodoro__get_stage(app->state) == FlippPomodoroStageFocus) {
// REGISTER a deed on work stage complete to get an acheivement
// dolphin_deed(DolphinDeedPluginGameWin);
FURI_LOG_I(TAG, "Focus stage reward added");
flipp_pomodoro_statistics__increase_focus_stages_completed(app->statistics);
};
flipp_pomodoro__toggle_stage(app->state); flipp_pomodoro__toggle_stage(app->state);
notification_message( notification_message(
app->notification_app, app->notification_app,
@@ -51,6 +61,8 @@ FlippPomodoroApp* flipp_pomodoro_app_alloc() {
app->notification_app = furi_record_open(RECORD_NOTIFICATION); app->notification_app = furi_record_open(RECORD_NOTIFICATION);
app->view_dispatcher = view_dispatcher_alloc(); app->view_dispatcher = view_dispatcher_alloc();
app->statistics = flipp_pomodoro_statistics__new();
view_dispatcher_enable_queue(app->view_dispatcher); view_dispatcher_enable_queue(app->view_dispatcher);
view_dispatcher_set_event_callback_context(app->view_dispatcher, app); view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
view_dispatcher_set_custom_event_callback( view_dispatcher_set_custom_event_callback(
@@ -62,22 +74,31 @@ FlippPomodoroApp* flipp_pomodoro_app_alloc() {
app->view_dispatcher, flipp_pomodoro_app_back_event_callback); app->view_dispatcher, flipp_pomodoro_app_back_event_callback);
app->timer_view = flipp_pomodoro_view_timer_alloc(); app->timer_view = flipp_pomodoro_view_timer_alloc();
app->info_view = flipp_pomodoro_info_view_alloc();
view_dispatcher_add_view( view_dispatcher_add_view(
app->view_dispatcher, app->view_dispatcher,
FlippPomodoroAppViewTimer, FlippPomodoroAppViewTimer,
flipp_pomodoro_view_timer_get_view(app->timer_view)); flipp_pomodoro_view_timer_get_view(app->timer_view));
scene_manager_next_scene(app->scene_manager, FlippPomodoroSceneTimer); view_dispatcher_add_view(
app->view_dispatcher,
FlippPomodoroAppViewInfo,
flipp_pomodoro_info_view_get_view(app->info_view));
scene_manager_next_scene(app->scene_manager, FlippPomodoroSceneTimer);
FURI_LOG_I(TAG, "Alloc complete");
return app; return app;
} }
void flipp_pomodoro_app_free(FlippPomodoroApp* app) { void flipp_pomodoro_app_free(FlippPomodoroApp* app) {
view_dispatcher_remove_view(app->view_dispatcher, FlippPomodoroAppViewTimer); view_dispatcher_remove_view(app->view_dispatcher, FlippPomodoroAppViewTimer);
view_dispatcher_remove_view(app->view_dispatcher, FlippPomodoroAppViewInfo);
view_dispatcher_free(app->view_dispatcher); view_dispatcher_free(app->view_dispatcher);
scene_manager_free(app->scene_manager); scene_manager_free(app->scene_manager);
flipp_pomodoro_view_timer_free(app->timer_view); flipp_pomodoro_view_timer_free(app->timer_view);
flipp_pomodoro_info_view_free(app->info_view);
flipp_pomodoro_statistics__destroy(app->statistics);
flipp_pomodoro__destroy(app->state); flipp_pomodoro__destroy(app->state);
free(app); free(app);
furi_record_close(RECORD_GUI); furi_record_close(RECORD_GUI);
@@ -86,8 +107,12 @@ void flipp_pomodoro_app_free(FlippPomodoroApp* app) {
int32_t flipp_pomodoro_app(void* p) { int32_t flipp_pomodoro_app(void* p) {
UNUSED(p); UNUSED(p);
FURI_LOG_I(TAG, "Initial");
FlippPomodoroApp* app = flipp_pomodoro_app_alloc(); FlippPomodoroApp* app = flipp_pomodoro_app_alloc();
FURI_LOG_I(TAG, "Run deed added");
// dolphin_deed(DolphinDeedPluginGameStart);
view_dispatcher_run(app->view_dispatcher); view_dispatcher_run(app->view_dispatcher);
flipp_pomodoro_app_free(app); flipp_pomodoro_app_free(app);

View File

@@ -7,8 +7,10 @@
#include <gui/scene_manager.h> #include <gui/scene_manager.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
#include "views/flipp_pomodoro_timer_view.h" #include "views/flipp_pomodoro_timer_view.h"
#include "views/flipp_pomodoro_info_view.h"
#include "modules/flipp_pomodoro.h" #include "modules/flipp_pomodoro.h"
#include "modules/flipp_pomodoro_statistics.h"
typedef enum { typedef enum {
// Reserve first 100 events for button types and indexes, starting from 0 // Reserve first 100 events for button types and indexes, starting from 0
@@ -16,6 +18,7 @@ typedef enum {
FlippPomodoroAppCustomEventStageComplete, // By Expiration FlippPomodoroAppCustomEventStageComplete, // By Expiration
FlippPomodoroAppCustomEventTimerTick, FlippPomodoroAppCustomEventTimerTick,
FlippPomodoroAppCustomEventStateUpdated, FlippPomodoroAppCustomEventStateUpdated,
FlippPomodoroAppCustomEventResumeTimer,
} FlippPomodoroAppCustomEvent; } FlippPomodoroAppCustomEvent;
typedef struct { typedef struct {
@@ -24,9 +27,12 @@ typedef struct {
Gui* gui; Gui* gui;
NotificationApp* notification_app; NotificationApp* notification_app;
FlippPomodoroTimerView* timer_view; FlippPomodoroTimerView* timer_view;
FlippPomodoroInfoView* info_view;
FlippPomodoroState* state; FlippPomodoroState* state;
FlippPomodoroStatistics* statistics;
} FlippPomodoroApp; } FlippPomodoroApp;
typedef enum { typedef enum {
FlippPomodoroAppViewTimer, FlippPomodoroAppViewTimer,
FlippPomodoroAppViewInfo,
} FlippPomodoroAppView; } FlippPomodoroAppView;

View File

@@ -1,6 +1,6 @@
#pragma once #pragma once
#define FURI_DEBUG 1 // #define FURI_DEBUG 1
/** /**
* Index of dependencies for the main app * Index of dependencies for the main app
@@ -15,6 +15,7 @@
#include <gui/view_dispatcher.h> #include <gui/view_dispatcher.h>
#include <gui/scene_manager.h> #include <gui/scene_manager.h>
#include <gui/elements.h> #include <gui/elements.h>
#include <dolphin/dolphin.h>
#include <input/input.h> #include <input/input.h>
// App resource imports // App resource imports

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -12,7 +12,6 @@ typedef enum {
/// @brief State of the pomodoro timer /// @brief State of the pomodoro timer
typedef struct { typedef struct {
PomodoroStage stage;
uint8_t current_stage_index; uint8_t current_stage_index;
uint32_t started_at_timestamp; uint32_t started_at_timestamp;
} FlippPomodoroState; } FlippPomodoroState;

View File

@@ -0,0 +1,26 @@
#include "flipp_pomodoro_statistics.h"
FlippPomodoroStatistics* flipp_pomodoro_statistics__new() {
FlippPomodoroStatistics* statistics = malloc(sizeof(FlippPomodoroStatistics));
statistics->focus_stages_completed = 0;
return statistics;
}
// Return the number of completed focus stages
uint8_t
flipp_pomodoro_statistics__get_focus_stages_completed(FlippPomodoroStatistics* statistics) {
return statistics->focus_stages_completed;
}
// Increase the number of completed focus stages by one
void flipp_pomodoro_statistics__increase_focus_stages_completed(
FlippPomodoroStatistics* statistics) {
statistics->focus_stages_completed++;
}
void flipp_pomodoro_statistics__destroy(FlippPomodoroStatistics* statistics) {
furi_assert(statistics);
free(statistics);
};

View File

@@ -0,0 +1,45 @@
#pragma once
#include <furi_hal.h>
/** @brief FlippPomodoroStatistics structure
*
* This structure is used to keep track of completed focus stages.
*/
typedef struct {
uint8_t focus_stages_completed;
} FlippPomodoroStatistics;
/** @brief Allocate and initialize a new FlippPomodoroStatistics
*
* This function allocates a new FlippPomodoroStatistics structure, initializes its members
* and returns a pointer to it.
*
* @return A pointer to a new FlippPomodoroStatistics structure
*/
FlippPomodoroStatistics* flipp_pomodoro_statistics__new();
/** @brief Get the number of completed focus stages
*
* This function retrieves the number of completed focus stages in a FlippPomodoroStatistics structure.
*
* @param statistics A pointer to a FlippPomodoroStatistics structure
* @return The number of completed focus stages
*/
uint8_t flipp_pomodoro_statistics__get_focus_stages_completed(FlippPomodoroStatistics* statistics);
/** @brief Increase the number of completed focus stages
*
* This function increases the count of the completed focus stages by one in a FlippPomodoroStatistics structure.
*
* @param statistics A pointer to a FlippPomodoroStatistics structure
*/
void flipp_pomodoro_statistics__increase_focus_stages_completed(
FlippPomodoroStatistics* statistics);
/** @brief Free a FlippPomodoroStatistics structure
*
* This function frees the memory used by a FlippPomodoroStatistics structure.
*
* @param statistics A pointer to a FlippPomodoroStatistics structure
*/
void flipp_pomodoro_statistics__destroy(FlippPomodoroStatistics* state);

View File

@@ -1 +1,2 @@
ADD_SCENE(flipp_pomodoro, info, Info)
ADD_SCENE(flipp_pomodoro, timer, Timer) ADD_SCENE(flipp_pomodoro, timer, Timer)

View File

@@ -1,3 +1,4 @@
#pragma once
#include <gui/scene_manager.h> #include <gui/scene_manager.h>
// Generate scene id and total number // Generate scene id and total number

View File

@@ -0,0 +1,59 @@
#include <furi.h>
#include <gui/view_dispatcher.h>
#include <gui/scene_manager.h>
#include "flipp_pomodoro_scene.h"
#include "../flipp_pomodoro_app.h"
#include "../views/flipp_pomodoro_info_view.h"
enum { SceneEventConusmed = true, SceneEventNotConusmed = false };
void flipp_pomodoro_scene_info_on_back_to_timer(void* ctx) {
furi_assert(ctx);
FlippPomodoroApp* app = ctx;
view_dispatcher_send_custom_event(
app->view_dispatcher, FlippPomodoroAppCustomEventResumeTimer);
};
void flipp_pomodoro_scene_info_on_enter(void* ctx) {
furi_assert(ctx);
FlippPomodoroApp* app = ctx;
view_dispatcher_switch_to_view(app->view_dispatcher, FlippPomodoroAppViewInfo);
flipp_pomodoro_info_view_set_pomodoros_completed(
flipp_pomodoro_info_view_get_view(app->info_view),
flipp_pomodoro_statistics__get_focus_stages_completed(app->statistics));
flipp_pomodoro_info_view_set_mode(
flipp_pomodoro_info_view_get_view(app->info_view), FlippPomodoroInfoViewModeStats);
flipp_pomodoro_info_view_set_resume_timer_cb(
app->info_view, flipp_pomodoro_scene_info_on_back_to_timer, app);
};
void flipp_pomodoro_scene_info_handle_custom_event(
FlippPomodoroApp* app,
FlippPomodoroAppCustomEvent custom_event) {
if(custom_event == FlippPomodoroAppCustomEventResumeTimer) {
scene_manager_next_scene(app->scene_manager, FlippPomodoroSceneTimer);
}
};
bool flipp_pomodoro_scene_info_on_event(void* ctx, SceneManagerEvent event) {
furi_assert(ctx);
FlippPomodoroApp* app = ctx;
switch(event.type) {
case SceneManagerEventTypeBack:
view_dispatcher_stop(app->view_dispatcher);
return SceneEventConusmed;
case SceneManagerEventTypeCustom:
flipp_pomodoro_scene_info_handle_custom_event(app, event.event);
return SceneEventConusmed;
default:
break;
};
return SceneEventNotConusmed;
};
void flipp_pomodoro_scene_info_on_exit(void* ctx) {
UNUSED(ctx);
};

View File

@@ -1,13 +1,13 @@
#include <furi.h> #include <furi.h>
#include <gui/scene_manager.h> #include <gui/scene_manager.h>
#include <gui/view_dispatcher.h> #include <gui/view_dispatcher.h>
#include <gui/scene_manager.h>
#include "flipp_pomodoro_scene.h"
#include "../flipp_pomodoro_app.h" #include "../flipp_pomodoro_app.h"
#include "../views/flipp_pomodoro_timer_view.h" #include "../views/flipp_pomodoro_timer_view.h"
enum { SceneEventConusmed = true, SceneEventNotConusmed = false }; enum { SceneEventConusmed = true, SceneEventNotConusmed = false };
uint8_t ExitSignal = 0;
void flipp_pomodoro_scene_timer_sync_view_state(void* ctx) { void flipp_pomodoro_scene_timer_sync_view_state(void* ctx) {
furi_assert(ctx); furi_assert(ctx);
@@ -30,6 +30,11 @@ void flipp_pomodoro_scene_timer_on_enter(void* ctx) {
FlippPomodoroApp* app = ctx; FlippPomodoroApp* app = ctx;
if(flipp_pomodoro__is_stage_expired(app->state)) {
flipp_pomodoro__destroy(app->state);
app->state = flipp_pomodoro__new();
}
view_dispatcher_switch_to_view(app->view_dispatcher, FlippPomodoroAppViewTimer); view_dispatcher_switch_to_view(app->view_dispatcher, FlippPomodoroAppViewTimer);
flipp_pomodoro_scene_timer_sync_view_state(app); flipp_pomodoro_scene_timer_sync_view_state(app);
flipp_pomodoro_view_timer_set_on_right_cb( flipp_pomodoro_view_timer_set_on_right_cb(
@@ -59,7 +64,8 @@ bool flipp_pomodoro_scene_timer_on_event(void* ctx, SceneManagerEvent event) {
flipp_pomodoro_scene_timer_handle_custom_event(app, event.event); flipp_pomodoro_scene_timer_handle_custom_event(app, event.event);
return SceneEventConusmed; return SceneEventConusmed;
case SceneManagerEventTypeBack: case SceneManagerEventTypeBack:
return ExitSignal; scene_manager_next_scene(app->scene_manager, FlippPomodoroSceneInfo);
return SceneEventConusmed;
default: default:
break; break;
} }

View File

@@ -0,0 +1,152 @@
#include <furi.h>
#include <gui/gui.h>
#include <gui/elements.h>
#include <gui/view.h>
#include "flipp_pomodoro_info_view.h"
// Auto-compiled icons
#include "flipp_pomodoro_icons.h"
enum {
ViewInputConsumed = true,
ViewInputNotConusmed = false,
};
struct FlippPomodoroInfoView {
View* view;
FlippPomodoroInfoViewUserActionCb resume_timer_cb;
void* user_action_cb_ctx;
};
typedef struct {
uint8_t pomodoros_completed;
FlippPomodoroInfoViewMode mode;
} FlippPomodoroInfoViewModel;
static void
flipp_pomodoro_info_view_draw_statistics(Canvas* canvas, FlippPomodoroInfoViewModel* model) {
FuriString* stats_string = furi_string_alloc();
furi_string_printf(
stats_string,
"So Long,\nand Thanks for All the Focus...\nand for completing\n%i pomodoro(s)",
model->pomodoros_completed);
const char* stats_string_formatted = furi_string_get_cstr(stats_string);
elements_text_box(
canvas,
0,
0,
canvas_width(canvas),
canvas_height(canvas) - 10,
AlignCenter,
AlignCenter,
stats_string_formatted,
true);
furi_string_free(stats_string);
elements_button_left(canvas, "Guide");
}
static void
flipp_pomodoro_info_view_draw_about(Canvas* canvas, FlippPomodoroInfoViewModel* model) {
UNUSED(model);
canvas_draw_icon(canvas, 0, 0, &I_flipp_pomodoro_learn_50x128);
elements_button_left(canvas, "Stats");
}
static void flipp_pomodoro_info_view_draw_callback(Canvas* canvas, void* _model) {
if(!_model) {
return;
};
FlippPomodoroInfoViewModel* model = _model;
canvas_clear(canvas);
if(model->mode == FlippPomodoroInfoViewModeStats) {
flipp_pomodoro_info_view_draw_statistics(canvas, model);
} else {
flipp_pomodoro_info_view_draw_about(canvas, model);
}
elements_button_right(canvas, "Resume");
}
void flipp_pomodoro_info_view_set_mode(View* view, FlippPomodoroInfoViewMode desired_mode) {
with_view_model(
view, FlippPomodoroInfoViewModel * model, { model->mode = desired_mode; }, false);
}
void flipp_pomodoro_info_view_toggle_mode(FlippPomodoroInfoView* info_view) {
with_view_model(
flipp_pomodoro_info_view_get_view(info_view),
FlippPomodoroInfoViewModel * model,
{
flipp_pomodoro_info_view_set_mode(
flipp_pomodoro_info_view_get_view(info_view),
(model->mode == FlippPomodoroInfoViewModeStats) ? FlippPomodoroInfoViewModeAbout :
FlippPomodoroInfoViewModeStats);
},
true);
}
bool flipp_pomodoro_info_view_input_callback(InputEvent* event, void* ctx) {
FlippPomodoroInfoView* info_view = ctx;
if(event->type == InputTypePress) {
if(event->key == InputKeyRight && info_view->resume_timer_cb != NULL) {
info_view->resume_timer_cb(info_view->user_action_cb_ctx);
return ViewInputConsumed;
} else if(event->key == InputKeyLeft) {
flipp_pomodoro_info_view_toggle_mode(info_view);
return ViewInputConsumed;
}
}
return ViewInputNotConusmed;
}
FlippPomodoroInfoView* flipp_pomodoro_info_view_alloc() {
FlippPomodoroInfoView* info_view = malloc(sizeof(FlippPomodoroInfoView));
info_view->view = view_alloc();
view_allocate_model(
flipp_pomodoro_info_view_get_view(info_view),
ViewModelTypeLockFree,
sizeof(FlippPomodoroInfoViewModel));
view_set_context(flipp_pomodoro_info_view_get_view(info_view), info_view);
view_set_draw_callback(
flipp_pomodoro_info_view_get_view(info_view), flipp_pomodoro_info_view_draw_callback);
view_set_input_callback(
flipp_pomodoro_info_view_get_view(info_view), flipp_pomodoro_info_view_input_callback);
return info_view;
}
View* flipp_pomodoro_info_view_get_view(FlippPomodoroInfoView* info_view) {
return info_view->view;
}
void flipp_pomodoro_info_view_free(FlippPomodoroInfoView* info_view) {
furi_assert(info_view);
view_free(info_view->view);
free(info_view);
}
void flipp_pomodoro_info_view_set_pomodoros_completed(View* view, uint8_t pomodoros_completed) {
with_view_model(
view,
FlippPomodoroInfoViewModel * model,
{ model->pomodoros_completed = pomodoros_completed; },
false);
}
void flipp_pomodoro_info_view_set_resume_timer_cb(
FlippPomodoroInfoView* info_view,
FlippPomodoroInfoViewUserActionCb user_action_cb,
void* user_action_cb_ctx) {
info_view->resume_timer_cb = user_action_cb;
info_view->user_action_cb_ctx = user_action_cb_ctx;
}

View File

@@ -0,0 +1,71 @@
#pragma once
#include <gui/view.h>
/** @brief Mode types for FlippPomodoroInfoView
*
* These are the modes that can be used in the FlippPomodoroInfoView
*/
typedef enum {
FlippPomodoroInfoViewModeStats,
FlippPomodoroInfoViewModeAbout,
} FlippPomodoroInfoViewMode;
/** @brief Forward declaration of the FlippPomodoroInfoView struct */
typedef struct FlippPomodoroInfoView FlippPomodoroInfoView;
/** @brief User action callback function type
*
* Callback functions of this type are called when a user action is performed.
*/
typedef void (*FlippPomodoroInfoViewUserActionCb)(void* ctx);
/** @brief Allocate a new FlippPomodoroInfoView
*
* Allocates a new FlippPomodoroInfoView and returns a pointer to it.
* @return A pointer to a new FlippPomodoroInfoView
*/
FlippPomodoroInfoView* flipp_pomodoro_info_view_alloc();
/** @brief Get the view from a FlippPomodoroInfoView
*
* Returns a pointer to the view associated with a FlippPomodoroInfoView.
* @param info_view A pointer to a FlippPomodoroInfoView
* @return A pointer to the view of the FlippPomodoroInfoView
*/
View* flipp_pomodoro_info_view_get_view(FlippPomodoroInfoView* info_view);
/** @brief Free a FlippPomodoroInfoView
*
* Frees the memory used by a FlippPomodoroInfoView.
* @param info_view A pointer to a FlippPomodoroInfoView
*/
void flipp_pomodoro_info_view_free(FlippPomodoroInfoView* info_view);
/** @brief Set the number of completed pomodoros in the view
*
* Sets the number of completed pomodoros that should be displayed in the view.
* @param info_view A pointer to the view
* @param pomodoros_completed The number of completed pomodoros
*/
void flipp_pomodoro_info_view_set_pomodoros_completed(View* info_view, uint8_t pomodoros_completed);
/** @brief Set the callback function to be called when the timer should be resumed
*
* Sets the callback function that will be called when the timer should be resumed.
* @param info_view A pointer to the FlippPomodoroInfoView
* @param user_action_cb The callback function
* @param user_action_cb_ctx The context to be passed to the callback function
*/
void flipp_pomodoro_info_view_set_resume_timer_cb(
FlippPomodoroInfoView* info_view,
FlippPomodoroInfoViewUserActionCb user_action_cb,
void* user_action_cb_ctx);
/** @brief Set the mode of the view
*
* Sets the mode that should be used in the view.
* @param view A pointer to the view
* @param desired_mode The desired mode
*/
void flipp_pomodoro_info_view_set_mode(View* view, FlippPomodoroInfoViewMode desired_mode);

View File

@@ -156,7 +156,10 @@ FlippPomodoroTimerView* flipp_pomodoro_view_timer_alloc() {
FlippPomodoroTimerView* timer = malloc(sizeof(FlippPomodoroTimerView)); FlippPomodoroTimerView* timer = malloc(sizeof(FlippPomodoroTimerView));
timer->view = view_alloc(); timer->view = view_alloc();
view_allocate_model(timer->view, ViewModelTypeLockFree, sizeof(FlippPomodoroTimerViewModel)); view_allocate_model(
flipp_pomodoro_view_timer_get_view(timer),
ViewModelTypeLockFree,
sizeof(FlippPomodoroTimerViewModel));
view_set_context(flipp_pomodoro_view_timer_get_view(timer), timer); view_set_context(flipp_pomodoro_view_timer_get_view(timer), timer);
view_set_draw_callback(timer->view, flipp_pomodoro_view_timer_draw_callback); view_set_draw_callback(timer->view, flipp_pomodoro_view_timer_draw_callback);
view_set_input_callback(timer->view, flipp_pomodoro_view_timer_input_callback); view_set_input_callback(timer->view, flipp_pomodoro_view_timer_input_callback);

View File

@@ -12,6 +12,6 @@ App(
fap_category="Games", fap_category="Games",
fap_author="@nmrr & @SimplyMinimal", fap_author="@nmrr & @SimplyMinimal",
fap_weburl="https://github.com/nmrr/flipperzero-pong", fap_weburl="https://github.com/nmrr/flipperzero-pong",
fap_version="1.0", fap_version="1.1",
fap_description="Simple pong game", fap_description="Simple pong game",
) )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -13,7 +13,7 @@ App(
"gui", "gui",
"dialogs", "dialogs",
], ],
fap_category="Misc", fap_category="Tools",
fap_icon="icons/qrcode_10px.png", fap_icon="icons/qrcode_10px.png",
fap_icon_assets="icons", fap_icon_assets="icons",
) )

View File

@@ -15,7 +15,7 @@ App(
apptype=FlipperAppType.EXTERNAL, apptype=FlipperAppType.EXTERNAL,
entry_point="rubiks_cube_scrambler_main", entry_point="rubiks_cube_scrambler_main",
stack_size=1 * 1024, stack_size=1 * 1024,
fap_category="Misc", fap_category="Games",
fap_icon="cube.png", fap_icon="cube.png",
fap_author="@RaZeSloth", fap_author="@RaZeSloth",
fap_weburl="https://github.com/RaZeSloth/flipperzero-rubiks-cube-scrambler", fap_weburl="https://github.com/RaZeSloth/flipperzero-rubiks-cube-scrambler",

View File

@@ -11,6 +11,6 @@ App(
fap_category="Games", fap_category="Games",
fap_author="@jasniec", fap_author="@jasniec",
fap_weburl="https://github.com/jasniec/flipper-scorched-tanks-game", fap_weburl="https://github.com/jasniec/flipper-scorched-tanks-game",
fap_version="1.0", fap_version="1.1",
fap_description="A flipper zero game inspired by scorched earth.", fap_description="A Flipper Zero game inspired by scorched earth",
) )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 614 B

After

Width:  |  Height:  |  Size: 536 B

View File

@@ -2,6 +2,7 @@
#include <gui/gui.h> #include <gui/gui.h>
#include <input/input.h> #include <input/input.h>
#include <stdlib.h> #include <stdlib.h>
#include <dolphin/dolphin.h>
#include <notification/notification.h> #include <notification/notification.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
@@ -524,4 +525,4 @@ int32_t snake_20_app(void* p) {
free(snake_state); free(snake_state);
return 0; return 0;
} }

View File

@@ -1,4 +1,5 @@
#include <stdlib.h> #include <stdlib.h>
#include <dolphin/dolphin.h>
#include <furi.h> #include <furi.h>
#include <gui/canvas_i.h> #include <gui/canvas_i.h>
#include "defines.h" #include "defines.h"
@@ -571,4 +572,4 @@ free_and_exit:
free(game_state); free(game_state);
furi_message_queue_free(event_queue); furi_message_queue_free(event_queue);
return return_code; return return_code;
} }

View File

@@ -5400,15 +5400,14 @@ void STM32SAM::sam(
} }
} }
if(i < 256) {
input[i] = phonetic ? '\x9b' : '[';
}
if(!phonetic) { if(!phonetic) {
strncat(input, "[", 256);
if(!TextToPhonemes((unsigned char*)input)) { if(!TextToPhonemes((unsigned char*)input)) {
// PrintUsage();
return; return;
} }
} else {
strncat(input, "\x9b", 256);
} }
SetInput(input); SetInput(input);

View File

@@ -1,5 +1,5 @@
App( App(
appid="timelapse", appid="gpio_timelapse",
name="[GPIO] Timelapse", name="[GPIO] Timelapse",
apptype=FlipperAppType.EXTERNAL, apptype=FlipperAppType.EXTERNAL,
entry_point="zeitraffer_app", entry_point="zeitraffer_app",

View File

@@ -5,10 +5,11 @@
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
#include <flipper_format/flipper_format.h> #include <flipper_format/flipper_format.h>
#include "gpio_item.h" #include "gpio_item.h"
#include "timelapse_icons.h" #include "gpio_timelapse_icons.h"
#include <assets_icons.h> #include <assets_icons.h>
#define CONFIG_FILE_PATH APP_DATA_PATH("timelapse.conf") #define CONFIG_FILE_DIRECTORY_PATH "/ext/apps_data/timelapse"
#define CONFIG_FILE_PATH CONFIG_FILE_DIRECTORY_PATH "/timelapse.conf"
// Часть кода покрадена из https://github.com/zmactep/flipperzero-hello-world // Часть кода покрадена из https://github.com/zmactep/flipperzero-hello-world
@@ -153,6 +154,10 @@ int32_t zeitraffer_app(void* p) {
FlipperFormat* load = flipper_format_file_alloc(storage); FlipperFormat* load = flipper_format_file_alloc(storage);
do { do {
if(!storage_simply_mkdir(storage, CONFIG_FILE_DIRECTORY_PATH)) {
notification_message(notifications, &sequence_error);
break;
}
if(!flipper_format_file_open_existing(load, CONFIG_FILE_PATH)) { if(!flipper_format_file_open_existing(load, CONFIG_FILE_PATH)) {
notification_message(notifications, &sequence_error); notification_message(notifications, &sequence_error);
break; break;

View File

@@ -1,7 +1,6 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include <input/input.h> #include <input/input.h>
#include <m-string.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -9,6 +9,7 @@ App(
stack_size=2 * 1024, stack_size=2 * 1024,
order=100, order=100,
fap_description="Universal temperature sensors reader", fap_description="Universal temperature sensors reader",
fap_version="1.4",
fap_author="@quen0n & (fixes by @xMasterX)", fap_author="@quen0n & (fixes by @xMasterX)",
fap_weburl="https://github.com/quen0n/unitemp-flipperzero", fap_weburl="https://github.com/quen0n/unitemp-flipperzero",
fap_category="GPIO", fap_category="GPIO",

View File

@@ -5,7 +5,6 @@
#include <notification/notification.h> #include <notification/notification.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
#include <gui/elements.h> #include <gui/elements.h>
#include "assets_icons.h"
#include <gui/icon_i.h> #include <gui/icon_i.h>
/* Core game logic from /* Core game logic from

View File

@@ -9,21 +9,21 @@ App(
fap_icon="wifi_10px.png", fap_icon="wifi_10px.png",
fap_category="WiFi", fap_category="WiFi",
fap_private_libs=[ fap_private_libs=[
Lib( Lib(
name="esp-serial-flasher", name="esp-serial-flasher",
fap_include_paths=["include"], fap_include_paths=["include"],
sources=[ sources=[
"src/esp_loader.c", "src/esp_loader.c",
"src/esp_targets.c", "src/esp_targets.c",
"src/md5_hash.c", "src/md5_hash.c",
"src/protocol_common.c", "src/protocol_common.c",
"src/protocol_uart.c", "src/protocol_uart.c",
"src/slip.c" "src/slip.c",
], ],
cincludes=["lib/esp-serial-flasher/private_include"], cincludes=["lib/esp-serial-flasher/private_include"],
cdefines=["SERIAL_FLASHER_INTERFACE_UART=1", "MD5_ENABLED=1"], cdefines=["SERIAL_FLASHER_INTERFACE_UART=1", "MD5_ENABLED=1"],
), ),
], ],
cdefines=["SERIAL_FLASHER_INTERFACE_UART=1"], cdefines=["SERIAL_FLASHER_INTERFACE_UART=1"],
fap_icon_assets="assets", fap_icon_assets="assets",
) )

View File

@@ -5,7 +5,7 @@ App(
entry_point="wifi_scanner_app", entry_point="wifi_scanner_app",
requires=["gui"], requires=["gui"],
stack_size=2 * 1024, stack_size=2 * 1024,
order=70, order=110,
fap_icon="wifi_10px.png", fap_icon="wifi_10px.png",
fap_category="WiFi", fap_category="WiFi",
fap_author="@SequoiaSan & @xMasterX", fap_author="@SequoiaSan & @xMasterX",