Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Apr 6, 2023
2 parents 1a88e01 + 5a7cddf commit 977ac09
Show file tree
Hide file tree
Showing 113 changed files with 3,688 additions and 640 deletions.
18 changes: 13 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ steps:
commands:
- curl -X POST -F 'key='$UPD_KEY'' $UPD_URL

- name: "Send files to telegram"
- name: "Send message to telegram"
image: appleboy/drone-telegram
settings:
token:
Expand All @@ -385,16 +385,24 @@ steps:
Commit: https://github.com/DarkFlippers/unleashed-firmware/commit/{{commit.sha}}
Commit message: {{commit.message}}
[-> Sponsor our project](https://boosty.to/mmxdev)
[-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}e)
[-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER})
[-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}e)"

[-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER})"
- name: "Send build to telegram"
image: appleboy/drone-telegram
settings:
token:
from_secret: tgtoken
to:
from_secret: tgid_dev
format: markdown
message: "Regular Build:"
document:
- dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ openocd.log
# PVS Studio temporary files
.PVS-Studio/
PVS-Studio.log
*.PVS-Studio.*

.gdbinit
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
url = https://github.com/ataradov/free-dap.git
[submodule "applications/external/subbrute"]
path = applications/external/subbrute
url = https://github.com/derskythe/flipperzero-subbrute.git
url = https://github.com/DarkFlippers/flipperzero-subbrute.git
[submodule "lib/heatshrink"]
path = lib/heatshrink
url = https://github.com/flipperdevices/heatshrink.git
36 changes: 11 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
### New changes
* SubGHz: Support for Allmatic(reads as Beninca), also fix Beninca protocol
* SubGHz: Allmatic -> Add Manually
* Plugins: Show External CC1101 module status in Weather Station and in POCSAG Pager plugins
* Plugins: Update **TOTP (Authenticator)** [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator) (Fixes BT issues)
* SubGHz: Fix false detections of StarLine 72bit, flipper can decode only 64bit
* SubGHz: ScherKhan, more informative messages instead of "Unknown", may be not correct, because we guessing type by bits
* SubGHz: Clear code in "Add Manually" scene (by @gid9798 | PR #403)
* SubGHz: Unification of custom buttons (by @gid9798 | PR #405)
* Infrared: Universal remote assets updated (by @amec0e | PR #404)
* Plugins: GPS NMEA (UART) modifications
```
- Ability to change baudrate using Up button, hold button to switch between baudrates (9600, 57600, 115200) (i set 57600 as default)
- Ok button will set backlight to always on mode, to disable press ok button again (it will restore default settings after app exit too)
- Long press Right button to change speed from knots to kilometers per hour
- Exit from app using long press on back button instead of short press, may be useful in case you want to turn backlight on and accidentally click back
```
* OFW PR 2536: Fixing parsing troika card number (by @achistyakov)
* OFW PR 2548: Picopass Add more detail to saved info screen (by @bettse)
* OFW PR 2544: added WAIT_FOR_BUTTON_PRESS functionality to badusb (by @p4p1)
* OFW PR 2475: AVR ISP Programmer FAP (by @Skorpionm) (+ AVR ISP enable 5v power on start fix) (beta test, report found issues in our repo)
* OFW: FatFS: use rtc for timestamping
* OFW: RPC: increase max message size
* OFW: Picopass: Elite progress
* OFW: Improved thread lifecycle
* OFW: View Model: recursive mutex
* SubGHz: AN-Motors AT4 - Add manually fixes
* SubGHz: StarLine ignore option (in Read -> Config) (by @gid9798 | PR #410)
* Plugins: Update **TOTP (Authenticator)** [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator) (Steam guard support)
* Plugins: Update **UART Terminal** [(by cool4uma)](https://github.com/cool4uma/UART_Terminal/tree/main) (AT commands support)
* Plugins: Add IR Scope app. (by @kallanreed | PR #407)
* OFW: scripts: sconsdist: added stub file artifact for older ufbt
* OFW: Graphics cleanup and icon rotation
* OFW: Moved ufbt to fbt codebase
* OFW: SD Driver: do not cache sd status.
* OFW: Furi: more gpio checks in HAL
* OFW: WeatherStation: fix protocol TX141TH-BV2

#### [🎲 Download latest extra apps pack](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)

Expand Down
24 changes: 12 additions & 12 deletions applications/external/avr_isp_programmer/avr_isp_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ static void avr_isp_app_tick_event_callback(void* context) {
AvrIspApp* avr_isp_app_alloc() {
AvrIspApp* app = malloc(sizeof(AvrIspApp));

// Enable 5v power, multiple attempts to avoid issues with power chip protection false triggering
uint8_t attempts = 0;
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
furi_hal_power_enable_otg();
furi_delay_ms(10);
}

app->file_path = furi_string_alloc();
furi_string_set(app->file_path, STORAGE_APP_DATA_PATH_PREFIX);
app->error = AvrIspErrorNoError;
Expand Down Expand Up @@ -102,6 +95,13 @@ AvrIspApp* avr_isp_app_alloc() {
AvrIspViewChipDetect,
avr_isp_chip_detect_view_get_view(app->avr_isp_chip_detect_view));

// Enable 5v power, multiple attempts to avoid issues with power chip protection false triggering
uint8_t attempts = 0;
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
furi_hal_power_enable_otg();
furi_delay_ms(10);
}

scene_manager_next_scene(app->scene_manager, AvrIspSceneStart);

return app;
Expand All @@ -110,6 +110,11 @@ AvrIspApp* avr_isp_app_alloc() {
void avr_isp_app_free(AvrIspApp* app) {
furi_assert(app);

// Disable 5v power
if(furi_hal_power_is_otg_enabled()) {
furi_hal_power_disable_otg();
}

// Submenu
view_dispatcher_remove_view(app->view_dispatcher, AvrIspViewSubmenu);
submenu_free(app->submenu);
Expand Down Expand Up @@ -159,11 +164,6 @@ void avr_isp_app_free(AvrIspApp* app) {
// Path strings
furi_string_free(app->file_path);

// Disable 5v power
if(furi_hal_power_is_otg_enabled()) {
furi_hal_power_disable_otg();
}

free(app);
}

Expand Down
8 changes: 4 additions & 4 deletions applications/external/dap_link/gui/views/dap_main_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ static void dap_main_view_draw_callback(Canvas* canvas, void* _model) {
canvas_set_color(canvas, ColorBlack);
if(model->dap_active) {
canvas_draw_icon(canvas, 14, 16, &I_ArrowUpFilled_12x18);
canvas_draw_icon(canvas, 28, 16, &I_ArrowDownFilled_12x18);
canvas_draw_icon_ex(canvas, 28, 16, &I_ArrowUpFilled_12x18, IconRotation180);
} else {
canvas_draw_icon(canvas, 14, 16, &I_ArrowUpEmpty_12x18);
canvas_draw_icon(canvas, 28, 16, &I_ArrowDownEmpty_12x18);
canvas_draw_icon_ex(canvas, 28, 16, &I_ArrowUpEmpty_12x18, IconRotation180);
}

switch(model->mode) {
Expand All @@ -76,9 +76,9 @@ static void dap_main_view_draw_callback(Canvas* canvas, void* _model) {
}

if(model->rx_active) {
canvas_draw_icon(canvas, 101, 16, &I_ArrowDownFilled_12x18);
canvas_draw_icon_ex(canvas, 101, 16, &I_ArrowUpFilled_12x18, IconRotation180);
} else {
canvas_draw_icon(canvas, 101, 16, &I_ArrowDownEmpty_12x18);
canvas_draw_icon_ex(canvas, 101, 16, &I_ArrowUpEmpty_12x18, IconRotation180);
}

canvas_draw_str_aligned(canvas, 100, 38, AlignCenter, AlignTop, "UART");
Expand Down
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions applications/external/ir_scope/application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
App(
appid="ir_scope",
name="IR Scope",
apptype=FlipperAppType.EXTERNAL,
entry_point="ir_scope_app",
cdefines=["APP_IR_SCOPE"],
requires=["gui"],
stack_size=2 * 1024,
fap_icon="ir_scope.png",
fap_category="Tools",
)
183 changes: 183 additions & 0 deletions applications/external/ir_scope/ir_scope.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
// Author: github.com/kallanreed
#include <furi.h>
#include <furi_hal.h>
#include <infrared.h>
#include <infrared_worker.h>
#include <furi_hal_infrared.h>
#include <gui/gui.h>

#define TAG "IR Scope"
#define COLS 128
#define ROWS 8

typedef struct {
bool autoscale;
uint16_t us_per_sample;
size_t timings_cnt;
uint32_t* timings;
uint32_t timings_sum;
FuriMutex* mutex;
} IRScopeState;

static void state_set_autoscale(IRScopeState* state) {
if(state->autoscale) state->us_per_sample = state->timings_sum / (ROWS * COLS);
}

static void canvas_draw_str_outline(Canvas* canvas, int x, int y, const char* str) {
canvas_set_color(canvas, ColorWhite);
for(int y1 = -1; y1 <= 1; ++y1)
for(int x1 = -1; x1 <= 1; ++x1) canvas_draw_str(canvas, x + x1, y + y1, str);

canvas_set_color(canvas, ColorBlack);
canvas_draw_str(canvas, x, y, str);
}

static void render_callback(Canvas* canvas, void* ctx) {
const IRScopeState* state = (IRScopeState*)ctx;

furi_mutex_acquire(state->mutex, FuriWaitForever);

canvas_clear(canvas);
canvas_draw_frame(canvas, 0, 0, 128, 64);

// Draw the signal chart.
bool on = false;
bool done = false;
size_t ix = 0;
int timing_cols = -1; // Count of columns used to draw the current timing
for(size_t row = 0; row < ROWS && !done; ++row) {
for(size_t col = 0; col < COLS && !done; ++col) {
done = ix >= state->timings_cnt;

if(!done && timing_cols < 0) {
timing_cols = state->timings[ix] / state->us_per_sample;
on = !on;
}

if(timing_cols == 0) ++ix;

int y = row * 8 + 7;
canvas_draw_line(canvas, col, y, col, y - (on ? 5 : 0));
--timing_cols;
}
}

canvas_set_font(canvas, FontSecondary);
if(state->autoscale)
canvas_draw_str_outline(canvas, 100, 64, "Auto");
else {
char buf[20];
snprintf(buf, sizeof(buf), "%uus", state->us_per_sample);
canvas_draw_str_outline(canvas, 100, 64, buf);
}

furi_mutex_release(state->mutex);
}

static void input_callback(InputEvent* input_event, void* ctx) {
FuriMessageQueue* event_queue = ctx;
furi_message_queue_put(event_queue, input_event, FuriWaitForever);
}

static void ir_received_callback(void* ctx, InfraredWorkerSignal* signal) {
furi_check(signal);
IRScopeState* state = (IRScopeState*)ctx;

furi_mutex_acquire(state->mutex, FuriWaitForever);

const uint32_t* timings;
infrared_worker_get_raw_signal(signal, &timings, &state->timings_cnt);

if(state->timings) {
free(state->timings);
state->timings_sum = 0;
}

state->timings = malloc(state->timings_cnt * sizeof(uint32_t));

// Copy and sum.
for(size_t i = 0; i < state->timings_cnt; ++i) {
state->timings[i] = timings[i];
state->timings_sum += timings[i];
}

state_set_autoscale(state);

furi_mutex_release(state->mutex);
}

int32_t ir_scope_app(void* p) {
UNUSED(p);

FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
furi_check(event_queue);

if(furi_hal_infrared_is_busy()) {
FURI_LOG_E(TAG, "Infrared is busy.");
return -1;
}

IRScopeState state = {
.autoscale = false, .us_per_sample = 200, .timings = NULL, .timings_cnt = 0, .mutex = NULL};
state.mutex = furi_mutex_alloc(FuriMutexTypeNormal);
if(!state.mutex) {
FURI_LOG_E(TAG, "Cannot create mutex.");
return -1;
}

ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, render_callback, &state);
view_port_input_callback_set(view_port, input_callback, event_queue);

Gui* gui = furi_record_open("gui");
gui_add_view_port(gui, view_port, GuiLayerFullscreen);

InfraredWorker* worker = infrared_worker_alloc();
infrared_worker_rx_enable_signal_decoding(worker, false);
infrared_worker_rx_enable_blink_on_receiving(worker, true);
infrared_worker_rx_set_received_signal_callback(worker, ir_received_callback, &state);
infrared_worker_rx_start(worker);

InputEvent event;
bool processing = true;
while(processing &&
furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
if(event.type == InputTypeRelease) {
furi_mutex_acquire(state.mutex, FuriWaitForever);

if(event.key == InputKeyBack) {
processing = false;
} else if(event.key == InputKeyUp) {
state.us_per_sample = MIN(1000, state.us_per_sample + 25);
state.autoscale = false;
} else if(event.key == InputKeyDown) {
state.us_per_sample = MAX(25, state.us_per_sample - 25);
state.autoscale = false;
} else if(event.key == InputKeyOk) {
state.autoscale = !state.autoscale;
if(state.autoscale)
state_set_autoscale(&state);
else
state.us_per_sample = 200;
}

view_port_update(view_port);
furi_mutex_release(state.mutex);
}
}

// Clean up.
infrared_worker_rx_stop(worker);
infrared_worker_free(worker);

if(state.timings) free(state.timings);

view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
furi_record_close("gui");
view_port_free(view_port);
furi_message_queue_free(event_queue);
furi_mutex_free(state.mutex);

return 0;
}
Binary file added applications/external/ir_scope/ir_scope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion applications/external/totp/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ App(
name="base32",
),
Lib(
name="list",
name="base64",
),
Lib(
name="linked_list"
),
Lib(
name="timezone_utils",
Expand Down
4 changes: 3 additions & 1 deletion applications/external/totp/cli/cli_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ bool totp_cli_read_line(Cli* cli, FuriString* out_str, bool mask_user_input) {
} else if(c == CliSymbolAsciiETX) {
cli_nl();
return false;
} else if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
} else if(
(c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
c == '/' || c == '=' || c == '+') {
if(mask_user_input) {
putc('*', stdout);
} else {
Expand Down
Loading

0 comments on commit 977ac09

Please sign in to comment.