4 minor updates

This commit is contained in:
RogueMaster
2022-12-24 01:52:18 -05:00
parent f61e322924
commit 05f8cf2492
13 changed files with 63 additions and 68 deletions
+6 -2
View File
@@ -20,9 +20,13 @@ Thank you to all the supporters!
## [BUILDS NOW AVAILABLE WITH STOCK, RM SELECT, RM SELECT + 18PLUS, RM MINIMAL (default) and RM 18PLUS ANIMATION SETS](https://www.patreon.com/RogueMaster/membership)
- Last Synced/Checked [Unleashed/xMasterX](https://github.com/DarkFlippers/unleashed-firmware), changes in [changelog](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/blob/420/CHANGELOG.md) and in [commits](https://github.com/DarkFlippers/unleashed-firmware/commits/dev): `2022-12-23 10:44 EST`
- Last Synced/Checked [OFW](https://github.com/flipperdevices/flipperzero-firmware), changes in [commits](https://github.com/flipperdevices/flipperzero-firmware/commits/dev): `2022-12-23 10:44 EST`
- Last Synced/Checked [Unleashed/xMasterX](https://github.com/DarkFlippers/unleashed-firmware), changes in [changelog](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/blob/420/CHANGELOG.md) and in [commits](https://github.com/DarkFlippers/unleashed-firmware/commits/dev): `2022-12-24 01:42 EST`
- Last Synced/Checked [OFW](https://github.com/flipperdevices/flipperzero-firmware), changes in [commits](https://github.com/flipperdevices/flipperzero-firmware/commits/dev): `2022-12-24 01:42 EST`
- Updated: [WiFi (Marauder) v3.0 (By 0xchocolate)](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion) `Req: ESP32 WITH MARAUDER FLASHED`
- Updated: [BPM Tapper (By panki27)](https://github.com/panki27/bpm-tapper)
- Updated: [Metronome (By panki27)](https://github.com/panki27/Metronome)
- Updated: [Minesweeper (By panki27)](https://github.com/panki27/minesweeper)
- Updated: [NRF24 Scanner v2.1 (By vad7)](https://github.com/vad7/nrf24scan)
## Install from Release
FLASH STOCK FIRST BEFORE UPDATING TO CUSTOM FIRMWARE!
+1 -1
View File
@@ -9,6 +9,6 @@ Hit any button other than back repeatedly. Calculates based on the average of th
## Compiling
```
./fbt firmware_bpm_tapper
./fbt fap_bpm_tapper
```
@@ -7,7 +7,7 @@ App(
requires=["gui"],
stack_size=2 * 1024,
fap_icon="bpm_10px.png",
fap_category="Music",
fap_icon_assets="icons",
order=15,
fap_category="Music",
order=35,
)
+19 -20
View File
@@ -3,6 +3,7 @@
#include <dialogs/dialogs.h>
#include <gui/gui.h>
#include <input/input.h>
#include <m-string.h>
#include <stdlib.h>
#include "BPM_Tapper_icons.h"
@@ -126,7 +127,7 @@ static void input_callback(InputEvent* input_event, FuriMessageQueue* event_queu
}
static void render_callback(Canvas* const canvas, void* ctx) {
FuriString* tempStr;
string_t tempStr;
const BPMTapper* bpm_state = acquire_mutex((ValueMutex*)ctx, 25);
if(bpm_state == NULL) {
@@ -136,32 +137,30 @@ static void render_callback(Canvas* const canvas, void* ctx) {
//canvas_draw_frame(canvas, 0, 0, 128, 64);
canvas_set_font(canvas, FontPrimary);
tempStr = furi_string_alloc();
string_init(tempStr);
furi_string_printf(tempStr, "Taps: %d", bpm_state->taps);
canvas_draw_str_aligned(canvas, 5, 10, AlignLeft, AlignBottom, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
string_printf(tempStr, "Taps: %d", bpm_state->taps);
canvas_draw_str_aligned(canvas, 5, 10, AlignLeft, AlignBottom, string_get_cstr(tempStr));
string_reset(tempStr);
furi_string_printf(tempStr, "Queue: %d", bpm_state->tap_queue->size);
canvas_draw_str_aligned(canvas, 70, 10, AlignLeft, AlignBottom, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
string_printf(tempStr, "Queue: %d", bpm_state->tap_queue->size);
canvas_draw_str_aligned(canvas, 70, 10, AlignLeft, AlignBottom, string_get_cstr(tempStr));
string_reset(tempStr);
furi_string_printf(tempStr, "Interval: %ldms", bpm_state->interval);
canvas_draw_str_aligned(canvas, 5, 20, AlignLeft, AlignBottom, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
string_printf(tempStr, "Interval: %dms", bpm_state->interval);
canvas_draw_str_aligned(canvas, 5, 20, AlignLeft, AlignBottom, string_get_cstr(tempStr));
string_reset(tempStr);
furi_string_printf(tempStr, "x2 %.2f /2 %.2f", bpm_state->bpm * 2, bpm_state->bpm / 2);
canvas_draw_str_aligned(
canvas, 64, 60, AlignCenter, AlignCenter, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
string_printf(tempStr, "x2 %.2f /2 %.2f", bpm_state->bpm * 2, bpm_state->bpm / 2);
canvas_draw_str_aligned(canvas, 64, 60, AlignCenter, AlignCenter, string_get_cstr(tempStr));
string_reset(tempStr);
furi_string_printf(tempStr, "%.2f", bpm_state->bpm);
string_printf(tempStr, "%.2f", bpm_state->bpm);
canvas_set_font(canvas, FontBigNumbers);
canvas_draw_str_aligned(
canvas, 64, 40, AlignCenter, AlignCenter, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
canvas_draw_str_aligned(canvas, 64, 40, AlignCenter, AlignCenter, string_get_cstr(tempStr));
string_reset(tempStr);
furi_string_free(tempStr);
string_clear(tempStr);
release_mutex((ValueMutex*)ctx, bpm_state);
}
+1 -3
View File
@@ -1,7 +1,5 @@
# Metronome
[Original link](https://github.com/panki27/Metronome)
A metronome for the [Flipper Zero](https://flipperzero.one/) device. Goes along perfectly with my [BPM tapper](https://github.com/panki27/bpm-tapper).
![screenshot](img/screenshot.png)
@@ -19,5 +17,5 @@ A metronome for the [Flipper Zero](https://flipperzero.one/) device. Goes along
## Compiling
```
./fbt firmware_metronome
./fbt fap_metronome
```
@@ -8,8 +8,8 @@ App(
"gui",
],
fap_icon="metronome_icon.png",
fap_icon_assets="icons",
fap_category="Music",
fap_icon_assets="images",
stack_size=2 * 1024,
order=20,
)
@@ -1,6 +1,6 @@
#include <gui/canvas.h>
#include <gui/icon_i.h>
#include <Metronome_icons.h>
#include "Metronome_icons.h"
//lib can only do bottom left/right
void elements_button_top_left(Canvas* canvas, const char* str) {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

+14 -21
View File
@@ -1,6 +1,7 @@
#include <furi.h>
#include <furi_hal.h>
#include <input/input.h>
#include <m-string.h>
#include <stdlib.h>
#include <gui/gui.h>
@@ -57,26 +58,23 @@ static void render_callback(Canvas* const canvas, void* ctx) {
return;
}
FuriString* tempStr;
tempStr = furi_string_alloc();
string_t tempStr;
string_init(tempStr);
canvas_draw_frame(canvas, 0, 0, 128, 64);
canvas_set_font(canvas, FontPrimary);
// draw bars/beat
furi_string_printf(
tempStr, "%d/%d", metronome_state->beats_per_bar, metronome_state->note_length);
canvas_draw_str_aligned(
canvas, 64, 8, AlignCenter, AlignCenter, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
string_printf(tempStr, "%d/%d", metronome_state->beats_per_bar, metronome_state->note_length);
canvas_draw_str_aligned(canvas, 64, 8, AlignCenter, AlignCenter, string_get_cstr(tempStr));
string_reset(tempStr);
// draw BPM value
furi_string_printf(tempStr, "%.2f", metronome_state->bpm);
string_printf(tempStr, "%.2f", metronome_state->bpm);
canvas_set_font(canvas, FontBigNumbers);
canvas_draw_str_aligned(
canvas, 64, 24, AlignCenter, AlignCenter, furi_string_get_cstr(tempStr));
furi_string_reset(tempStr);
canvas_draw_str_aligned(canvas, 64, 24, AlignCenter, AlignCenter, string_get_cstr(tempStr));
string_reset(tempStr);
// draw volume indicator
// always draw first waves
@@ -128,7 +126,7 @@ static void render_callback(Canvas* const canvas, void* ctx) {
canvas, 8, 36, 112, (float)metronome_state->current_beat / metronome_state->beats_per_bar);
// cleanup
furi_string_free(tempStr);
string_clear(tempStr);
release_mutex((ValueMutex*)ctx, metronome_state);
}
@@ -160,8 +158,6 @@ static void timer_callback(void* ctx) {
break;
case Silent:
break;
default:
break;
}
} else {
// unpronounced beat
@@ -177,8 +173,6 @@ static void timer_callback(void* ctx) {
break;
case Silent:
break;
default:
break;
}
};
@@ -203,8 +197,6 @@ static void timer_callback(void* ctx) {
break;
case Silent:
break;
default:
break;
}
notification_message(metronome_state->notifications, &sequence_reset_rgb);
@@ -295,6 +287,7 @@ int32_t metronome_app() {
metronome_state->timer = furi_timer_alloc(timer_callback, FuriTimerTypePeriodic, &state_mutex);
// Open GUI and register view_port
//
Gui* gui = furi_record_open("gui");
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
@@ -333,7 +326,7 @@ int32_t metronome_app() {
case InputKeyBack:
processing = false;
break;
default:
case InputKeyMAX:
break;
}
} else if(event.input.type == InputTypeLong) {
@@ -355,7 +348,7 @@ int32_t metronome_app() {
case InputKeyBack:
processing = false;
break;
default:
case InputKeyMAX:
break;
}
} else if(event.input.type == InputTypeRepeat) {
@@ -376,7 +369,7 @@ int32_t metronome_app() {
case InputKeyBack:
processing = false;
break;
default:
case InputKeyMAX:
break;
}
}
@@ -1,7 +1,5 @@
# Minesweeper
[Original Link](https://github.com/panki27/minesweeper)
This is a Minesweeper implementation for the Flipper Zero device.
![screenshot](img/screenshot.png)
@@ -217,10 +217,6 @@ static bool game_lost(Minesweeper* minesweeper_state) {
dialog_message_set_icon(message, NULL, 0, 10);
// Set cursor to initial position
minesweeper_state->cursor_x = 0;
minesweeper_state->cursor_y = 0;
NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
notification_message(notifications, &sequence_set_vibro_on);
furi_record_close(RECORD_NOTIFICATION);
@@ -476,7 +472,7 @@ int32_t minesweeper_app(void* p) {
// Exit the plugin
processing = false;
break;
default:
case InputKeyMAX:
break;
}
} else if(event.input.type == InputTypeLong) {
@@ -495,7 +491,7 @@ int32_t minesweeper_app(void* p) {
case InputKeyBack:
processing = false;
break;
default:
case InputKeyMAX:
break;
}
}
+15 -9
View File
@@ -212,8 +212,11 @@ void write_to_log_file(Storage* storage, bool f_settings) {
if(fl) {
FURI_LOG_D(TAG, "Save to %s", furi_string_get_cstr(str));
if(save_to_new_log || f_settings) {
//if(what_to_do == 1) furi_string_printf(str, "%s\n", SettingsFld_Sniff); else furi_string_reset(str);
furi_string_printf(
if(what_to_do == 1)
furi_string_printf(str, "%s\n", SettingsFld_Sniff);
else
furi_string_reset(str);
furi_string_cat_printf(
str,
"%s %d\n%s %d\n%s %d\n",
SettingsFld_Rate,
@@ -231,9 +234,11 @@ void write_to_log_file(Storage* storage, bool f_settings) {
NRF_CRC,
SettingsFld_Payload,
what_to_do == 1 ? NRF_Payload_sniff_min : NRF_Payload);
furi_string_cat_printf(str, "P0: ");
add_to_furi_str_hex_bytes(str, (char*)addrs.addr_P0, addrs.addr_len);
furi_string_cat(str, "\n");
if(addrs.addr_count > 0) {
furi_string_cat_printf(str, "P0: ");
add_to_furi_str_hex_bytes(str, (char*)addrs.addr_P0, addrs.addr_len);
furi_string_cat(str, "\n");
}
if(addrs.addr_count > 1) {
furi_string_cat_printf(str, "P1: ");
add_to_furi_str_hex_bytes(str, (char*)addrs.addr_P1, addrs.addr_len);
@@ -428,13 +433,14 @@ static uint8_t load_settings_file(Stream* file_stream) {
if(err == 0 && a) adr->addr_count = a - '0' + 1;
} else if(line_len >= 3 * 2) { // data
if(!log_loaded) {
log_loaded = true;
clear_log();
what_to_do = 0;
log_loaded = true;
}
if(log_arr_idx < MAX_LOG_RECORDS - 1) {
ConvertHexToArray(
line_ptr, APP->log_arr + log_arr_idx * LOG_REC_SIZE, LOG_REC_SIZE);
if(ConvertHexToArray(
line_ptr, APP->log_arr + log_arr_idx * LOG_REC_SIZE, LOG_REC_SIZE) > 0)
err = 0;
log_arr_idx++;
}
}
@@ -1013,7 +1019,7 @@ static void render_callback(Canvas* const canvas, void* ctx) {
if(log_arr_idx && (*p & 0x80)) { // +RAW
snprintf(screen_buf, sizeof(screen_buf), "Start read: ");
add_to_str_hex_bytes(screen_buf, (char*)p + 2, (*(p + 1) & 0b11) + 2);
if(what_to_do == 3) strcpy(screen_buf + strlen(screen_buf) - 2, "* ");
if(what_to_do == 2) strcpy(screen_buf + strlen(screen_buf) - 2, "* ");
} else
snprintf(
screen_buf,
@@ -3,6 +3,7 @@ Ch: 2
ESB: 1
DPL: 0
CRC: 2
Payload: 4
P0: C8C8C0
P1: C8C8C1
P2: C2