1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

quick debug switch

This commit is contained in:
MX
2025-12-11 07:02:07 +03:00
parent 5c539d2346
commit 36181636c8
4 changed files with 18 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
* OFW: Fix Felica standard loading from nfc file * OFW: Fix Felica standard loading from nfc file
* Apps: **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev) * Apps: **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev)
## Other changes ## Other changes
* Desktop: Quick Debug mode switch (hold down on desktop, then hold ok on version screen)
* SubGHz: OFEX support for SecPlus v1 and v2, various fixes (by @Dmitry422 & xMasterX) * SubGHz: OFEX support for SecPlus v1 and v2, various fixes (by @Dmitry422 & xMasterX)
* SubGHz Remote: Add default remote and clear slot features (by @jknlsn) * SubGHz Remote: Add default remote and clear slot features (by @jknlsn)
* Fix typo in README warning about scammers (PR #931 | by @koterba) * Fix typo in README warning about scammers (PR #931 | by @koterba)

View File

@@ -25,6 +25,14 @@ bool desktop_scene_debug_on_event(void* context, SceneManagerEvent event) {
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) { switch(event.event) {
case DesktopDebugEventToggleDebugMode:
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
furi_hal_rtc_set_flag(FuriHalRtcFlagDebug);
} else {
furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug);
}
consumed = true;
break;
case DesktopDebugEventExit: case DesktopDebugEventExit:
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain); scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
dolphin_flush(dolphin); dolphin_flush(dolphin);

View File

@@ -34,9 +34,7 @@ typedef enum {
DesktopPinTimeoutExit, DesktopPinTimeoutExit,
DesktopDebugEventDeed, DesktopDebugEventToggleDebugMode,
DesktopDebugEventWrongDeed,
DesktopDebugEventSaveState,
DesktopDebugEventExit, DesktopDebugEventExit,
DesktopLockMenuEventLock, DesktopLockMenuEventLock,

View File

@@ -80,7 +80,11 @@ void desktop_debug_render(Canvas* canvas, void* model) {
canvas_draw_str(canvas, 0, 40 + STATUS_BAR_Y_SHIFT, buffer); canvas_draw_str(canvas, 0, 40 + STATUS_BAR_Y_SHIFT, buffer);
snprintf( snprintf(
buffer, sizeof(buffer), "[%d] %s", version_get_target(ver), version_get_gitbranch(ver)); buffer,
sizeof(buffer),
"[D:%s] %s",
furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug) ? "ON" : "OFF",
version_get_gitbranch(ver));
canvas_draw_str(canvas, 0, 50 + STATUS_BAR_Y_SHIFT, buffer); canvas_draw_str(canvas, 0, 50 + STATUS_BAR_Y_SHIFT, buffer);
} }
@@ -98,6 +102,9 @@ static bool desktop_debug_input(InputEvent* event, void* context) {
if(event->key == InputKeyBack && event->type == InputTypeShort) { if(event->key == InputKeyBack && event->type == InputTypeShort) {
debug_view->callback(DesktopDebugEventExit, debug_view->context); debug_view->callback(DesktopDebugEventExit, debug_view->context);
} }
if(event->key == InputKeyOk && event->type == InputTypeLong) {
debug_view->callback(DesktopDebugEventToggleDebugMode, debug_view->context);
}
return true; return true;
} }