mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 16:58:36 -07:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
@@ -143,7 +143,7 @@ void ibutton_cli_write(Cli* cli, FuriString* args) {
|
||||
}
|
||||
|
||||
if(!(ibutton_protocols_get_features(protocols, ibutton_key_get_protocol_id(key)) &
|
||||
iButtonProtocolFeatureWriteBlank)) {
|
||||
iButtonProtocolFeatureWriteId)) {
|
||||
ibutton_cli_print_usage();
|
||||
break;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ void ibutton_cli_write(Cli* cli, FuriString* args) {
|
||||
ibutton_cli_print_key(protocols, key);
|
||||
printf("Press Ctrl+C to abort\r\n");
|
||||
|
||||
ibutton_worker_write_blank_start(worker, key);
|
||||
ibutton_worker_write_id_start(worker, key);
|
||||
while(true) {
|
||||
uint32_t flags = furi_event_flag_wait(
|
||||
write_context.event, EVENT_FLAG_IBUTTON_COMPLETE, FuriFlagWaitAny, 100);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
typedef enum {
|
||||
iButtonWriteModeInvalid,
|
||||
iButtonWriteModeBlank,
|
||||
iButtonWriteModeId,
|
||||
iButtonWriteModeCopy,
|
||||
} iButtonWriteMode;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ typedef enum {
|
||||
SubmenuIndexSave,
|
||||
SubmenuIndexEmulate,
|
||||
SubmenuIndexViewData,
|
||||
SubmenuIndexWriteBlank,
|
||||
SubmenuIndexWriteId,
|
||||
SubmenuIndexWriteCopy,
|
||||
} SubmenuIndex;
|
||||
|
||||
@@ -30,11 +30,11 @@ void ibutton_scene_read_key_menu_on_enter(void* context) {
|
||||
ibutton_scene_read_key_menu_submenu_callback,
|
||||
ibutton);
|
||||
|
||||
if(features & iButtonProtocolFeatureWriteBlank) {
|
||||
if(features & iButtonProtocolFeatureWriteId) {
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
"Write ID",
|
||||
SubmenuIndexWriteBlank,
|
||||
SubmenuIndexWriteId,
|
||||
ibutton_scene_read_key_menu_submenu_callback,
|
||||
ibutton);
|
||||
}
|
||||
@@ -78,8 +78,8 @@ bool ibutton_scene_read_key_menu_on_event(void* context, SceneManagerEvent event
|
||||
dolphin_deed(DolphinDeedIbuttonEmulate);
|
||||
} else if(event.event == SubmenuIndexViewData) {
|
||||
scene_manager_next_scene(scene_manager, iButtonSceneViewData);
|
||||
} else if(event.event == SubmenuIndexWriteBlank) {
|
||||
ibutton->write_mode = iButtonWriteModeBlank;
|
||||
} else if(event.event == SubmenuIndexWriteId) {
|
||||
ibutton->write_mode = iButtonWriteModeId;
|
||||
scene_manager_next_scene(scene_manager, iButtonSceneWrite);
|
||||
} else if(event.event == SubmenuIndexWriteCopy) {
|
||||
ibutton->write_mode = iButtonWriteModeCopy;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
enum SubmenuIndex {
|
||||
SubmenuIndexEmulate,
|
||||
SubmenuIndexWriteBlank,
|
||||
SubmenuIndexWriteId,
|
||||
SubmenuIndexWriteCopy,
|
||||
SubmenuIndexEdit,
|
||||
SubmenuIndexRename,
|
||||
@@ -20,9 +20,9 @@ void ibutton_scene_saved_key_menu_on_enter(void* context) {
|
||||
|
||||
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, ibutton_submenu_callback, ibutton);
|
||||
|
||||
if(features & iButtonProtocolFeatureWriteBlank) {
|
||||
if(features & iButtonProtocolFeatureWriteId) {
|
||||
submenu_add_item(
|
||||
submenu, "Write ID", SubmenuIndexWriteBlank, ibutton_submenu_callback, ibutton);
|
||||
submenu, "Write ID", SubmenuIndexWriteId, ibutton_submenu_callback, ibutton);
|
||||
}
|
||||
|
||||
if(features & iButtonProtocolFeatureWriteCopy) {
|
||||
@@ -55,8 +55,8 @@ bool ibutton_scene_saved_key_menu_on_event(void* context, SceneManagerEvent even
|
||||
if(event.event == SubmenuIndexEmulate) {
|
||||
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
|
||||
dolphin_deed(DolphinDeedIbuttonEmulate);
|
||||
} else if(event.event == SubmenuIndexWriteBlank) {
|
||||
ibutton->write_mode = iButtonWriteModeBlank;
|
||||
} else if(event.event == SubmenuIndexWriteId) {
|
||||
ibutton->write_mode = iButtonWriteModeId;
|
||||
scene_manager_next_scene(scene_manager, iButtonSceneWrite);
|
||||
} else if(event.event == SubmenuIndexWriteCopy) {
|
||||
ibutton->write_mode = iButtonWriteModeCopy;
|
||||
|
||||
@@ -51,9 +51,9 @@ void ibutton_scene_write_on_enter(void* context) {
|
||||
|
||||
ibutton_worker_write_set_callback(worker, ibutton_scene_write_callback, ibutton);
|
||||
|
||||
if(ibutton->write_mode == iButtonWriteModeBlank) {
|
||||
if(ibutton->write_mode == iButtonWriteModeId) {
|
||||
furi_string_set(tmp, "Writing ID");
|
||||
ibutton_worker_write_blank_start(worker, key);
|
||||
ibutton_worker_write_id_start(worker, key);
|
||||
|
||||
} else if(ibutton->write_mode == iButtonWriteModeCopy) {
|
||||
furi_string_set(tmp, "Full Writing");
|
||||
|
||||
@@ -270,7 +270,7 @@ void cli_command_sysctl_heap_track(Cli* cli, FuriString* args, void* context) {
|
||||
} else if(!furi_string_cmp(args, "main")) {
|
||||
furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackModeMain);
|
||||
printf("Heap tracking enabled for application main thread");
|
||||
#if FURI_DEBUG
|
||||
#ifdef FURI_DEBUG
|
||||
} else if(!furi_string_cmp(args, "tree")) {
|
||||
furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackModeTree);
|
||||
printf("Heap tracking enabled for application main and child threads");
|
||||
@@ -289,7 +289,7 @@ void cli_command_sysctl_print_usage(void) {
|
||||
printf("Cmd list:\r\n");
|
||||
|
||||
printf("\tdebug <0|1>\t - Enable or disable system debug\r\n");
|
||||
#if FURI_DEBUG
|
||||
#ifdef FURI_DEBUG
|
||||
printf("\theap_track <none|main|tree|all>\t - Set heap allocation tracking mode\r\n");
|
||||
#else
|
||||
printf("\theap_track <none|main>\t - Set heap allocation tracking mode\r\n");
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
#include <projdefs.h>
|
||||
#include <stdint.h>
|
||||
#include <furi.h>
|
||||
|
||||
#include <gui/elements.h>
|
||||
#include <gui/icon.h>
|
||||
#include <gui/view.h>
|
||||
|
||||
#include <assets_icons.h>
|
||||
|
||||
#include <desktop/desktop_settings.h>
|
||||
#include "../desktop_i.h"
|
||||
#include "desktop_view_locked.h"
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
|
||||
#include <furi.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <projdefs.h>
|
||||
#include <input/input.h>
|
||||
|
||||
#include <gui/canvas.h>
|
||||
#include <gui/view.h>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ static void power_off_draw_callback(Canvas* canvas, void* _model) {
|
||||
elements_button_center(canvas, "OK");
|
||||
elements_button_right(canvas, "Hide");
|
||||
} else {
|
||||
snprintf(buff, sizeof(buff), "Charge me!\nDont't forget!");
|
||||
snprintf(buff, sizeof(buff), "Charge me!\nDon't forget!");
|
||||
elements_multiline_text_aligned(canvas, 70, 23, AlignLeft, AlignTop, buff);
|
||||
|
||||
canvas_draw_str_aligned(canvas, 64, 60, AlignCenter, AlignBottom, "Hold a second...");
|
||||
|
||||
@@ -228,7 +228,7 @@ bool rpc_pb_stream_read(pb_istream_t* istream, pb_byte_t* buf, size_t count) {
|
||||
}
|
||||
}
|
||||
|
||||
#if SRV_RPC_DEBUG
|
||||
#ifdef SRV_RPC_DEBUG
|
||||
rpc_debug_print_data("INPUT", buf, bytes_received);
|
||||
#endif
|
||||
|
||||
@@ -268,7 +268,7 @@ static int32_t rpc_session_worker(void* context) {
|
||||
bool message_decode_failed = false;
|
||||
|
||||
if(pb_decode_ex(&istream, &PB_Main_msg, session->decoded_message, PB_DECODE_DELIMITED)) {
|
||||
#if SRV_RPC_DEBUG
|
||||
#ifdef SRV_RPC_DEBUG
|
||||
FURI_LOG_I(TAG, "INPUT:");
|
||||
rpc_debug_print_message(session->decoded_message);
|
||||
#endif
|
||||
@@ -452,7 +452,7 @@ void rpc_send(RpcSession* session, PB_Main* message) {
|
||||
|
||||
pb_ostream_t ostream = PB_OSTREAM_SIZING;
|
||||
|
||||
#if SRV_RPC_DEBUG
|
||||
#ifdef SRV_RPC_DEBUG
|
||||
FURI_LOG_I(TAG, "OUTPUT:");
|
||||
rpc_debug_print_message(message);
|
||||
#endif
|
||||
@@ -465,7 +465,7 @@ void rpc_send(RpcSession* session, PB_Main* message) {
|
||||
|
||||
pb_encode_ex(&ostream, &PB_Main_msg, message, PB_ENCODE_DELIMITED);
|
||||
|
||||
#if SRV_RPC_DEBUG
|
||||
#ifdef SRV_RPC_DEBUG
|
||||
rpc_debug_print_data("OUTPUT", buffer, ostream.bytes_written);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ static void debug_changed(VariableItem* item) {
|
||||
const char* const heap_trace_mode_text[] = {
|
||||
"None",
|
||||
"Main",
|
||||
#if FURI_DEBUG
|
||||
#ifdef FURI_DEBUG
|
||||
"Tree",
|
||||
"All",
|
||||
#endif
|
||||
@@ -101,7 +101,7 @@ const char* const heap_trace_mode_text[] = {
|
||||
const uint32_t heap_trace_mode_value[] = {
|
||||
FuriHalRtcHeapTrackModeNone,
|
||||
FuriHalRtcHeapTrackModeMain,
|
||||
#if FURI_DEBUG
|
||||
#ifdef FURI_DEBUG
|
||||
FuriHalRtcHeapTrackModeTree,
|
||||
FuriHalRtcHeapTrackModeAll,
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user