mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
quick debug switch
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* 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)
|
||||
## 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 Remote: Add default remote and clear slot features (by @jknlsn)
|
||||
* Fix typo in README warning about scammers (PR #931 | by @koterba)
|
||||
|
||||
@@ -25,6 +25,14 @@ bool desktop_scene_debug_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
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:
|
||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
||||
dolphin_flush(dolphin);
|
||||
|
||||
@@ -34,9 +34,7 @@ typedef enum {
|
||||
|
||||
DesktopPinTimeoutExit,
|
||||
|
||||
DesktopDebugEventDeed,
|
||||
DesktopDebugEventWrongDeed,
|
||||
DesktopDebugEventSaveState,
|
||||
DesktopDebugEventToggleDebugMode,
|
||||
DesktopDebugEventExit,
|
||||
|
||||
DesktopLockMenuEventLock,
|
||||
|
||||
@@ -80,7 +80,11 @@ void desktop_debug_render(Canvas* canvas, void* model) {
|
||||
canvas_draw_str(canvas, 0, 40 + STATUS_BAR_Y_SHIFT, buffer);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -98,6 +102,9 @@ static bool desktop_debug_input(InputEvent* event, void* context) {
|
||||
if(event->key == InputKeyBack && event->type == InputTypeShort) {
|
||||
debug_view->callback(DesktopDebugEventExit, debug_view->context);
|
||||
}
|
||||
if(event->key == InputKeyOk && event->type == InputTypeLong) {
|
||||
debug_view->callback(DesktopDebugEventToggleDebugMode, debug_view->context);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user