cleanup unused debug, set proper log levels

This commit is contained in:
MX
2024-04-05 06:41:31 +03:00
parent ef29ed149d
commit 7787845479
4 changed files with 11 additions and 34 deletions

View File

@@ -30,7 +30,7 @@ void lfrfid_scene_save_name_on_enter(void* context) {
LFRFID_KEY_NAME_SIZE,
key_name_is_empty);
FURI_LOG_I("", "%s %s", furi_string_get_cstr(folder_path), app->text_store);
FURI_LOG_D("", "%s %s", furi_string_get_cstr(folder_path), app->text_store);
ValidatorIsFile* validator_is_file = validator_is_file_alloc_init(
furi_string_get_cstr(folder_path),

View File

@@ -20,8 +20,8 @@ static AllInOneLayoutType all_in_one_get_layout(const MfUltralightData* data) {
const uint8_t layout_byte = data->page[5].data[2];
const uint8_t layout_half_byte = data->page[5].data[2] & 0x0F;
FURI_LOG_I(TAG, "Layout byte: %02x", layout_byte);
FURI_LOG_I(TAG, "Layout half-byte: %02x", layout_half_byte);
FURI_LOG_D(TAG, "Layout byte: %02x", layout_byte);
FURI_LOG_D(TAG, "Layout half-byte: %02x", layout_half_byte);
switch(layout_half_byte) {
// If it is A, the layout type is a type A layout
@@ -32,7 +32,7 @@ static AllInOneLayoutType all_in_one_get_layout(const MfUltralightData* data) {
case 0x02:
return AllInOneLayoutType2;
default:
FURI_LOG_I(TAG, "Unknown layout type: %d", layout_half_byte);
FURI_LOG_E(TAG, "Unknown layout type: %d", layout_half_byte);
return AllInOneLayoutTypeUnknown;
}
}
@@ -47,7 +47,7 @@ static bool all_in_one_parse(const NfcDevice* device, FuriString* parsed_data) {
do {
if(data->page[4].data[0] != 0x45 || data->page[4].data[1] != 0xD9) {
FURI_LOG_I(TAG, "Pass not verified");
FURI_LOG_E(TAG, "Pass not verified");
break;
}
@@ -63,7 +63,7 @@ static bool all_in_one_parse(const NfcDevice* device, FuriString* parsed_data) {
// If the layout is D, the ride count is stored in the second byte of page 9
ride_count = data->page[9].data[1];
} else {
FURI_LOG_I(TAG, "Unknown layout: %d", layout_type);
FURI_LOG_E(TAG, "Unknown layout: %d", layout_type);
ride_count = 137;
}

View File

@@ -84,7 +84,7 @@ void from_minutes_to_datetime(uint32_t minutes, DateTime* datetime, uint16_t sta
bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
uint16_t transport_departament = bit_lib_get_bits_16(block->data, 0, 10);
FURI_LOG_I(TAG, "Transport departament: %x", transport_departament);
FURI_LOG_D(TAG, "Transport departament: %x", transport_departament);
uint16_t layout_type = bit_lib_get_bits_16(block->data, 52, 4);
if(layout_type == 0xE) {
@@ -93,7 +93,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
layout_type = bit_lib_get_bits_16(block->data, 52, 14);
}
FURI_LOG_I(TAG, "Layout type %x", layout_type);
FURI_LOG_D(TAG, "Layout type %x", layout_type);
uint16_t card_view = 0;
uint16_t card_type = 0;

View File

@@ -228,9 +228,7 @@ uint32_t subghz_frequency_find_correct(uint32_t input) {
uint32_t prev_freq = 0;
uint32_t current = 0;
uint32_t result = 0;
#ifdef FURI_DEBUG
FURI_LOG_D(TAG, "input: %ld", input);
#endif
for(size_t i = 0; i < sizeof(subghz_frequency_list); i++) {
current = subghz_frequency_list[i];
if(current == input) {
@@ -281,7 +279,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
break;
}
subghz_frequency_analyzer_worker_set_trigger_level(instance->worker, trigger_level);
FURI_LOG_I(TAG, "trigger = %.1f", (double)trigger_level);
FURI_LOG_D(TAG, "trigger = %.1f", (double)trigger_level);
need_redraw = true;
} else if(event->type == InputTypePress && event->key == InputKeyUp) {
if(instance->feedback_level == 0) {
@@ -289,9 +287,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
} else {
instance->feedback_level--;
}
#ifdef FURI_DEBUG
FURI_LOG_D(TAG, "feedback_level = %d", instance->feedback_level);
#endif
need_redraw = true;
} else if(
((event->type == InputTypePress) || (event->type == InputTypeRepeat)) &&
@@ -324,13 +320,6 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
}
if(frequency_candidate > 0 &&
frequency_candidate != model->frequency_to_save) {
#ifdef FURI_DEBUG
FURI_LOG_D(
TAG,
"frequency_to_save: %ld, candidate: %ld",
model->frequency_to_save,
frequency_candidate);
#endif
model->frequency_to_save = frequency_candidate;
updated = true;
}
@@ -372,24 +361,12 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
},
true);
#ifdef FURI_DEBUG
FURI_LOG_I(
TAG,
"updated: %d, long: %d, type: %d",
updated,
(event->type == InputTypeLong),
event->type);
#endif
if(updated) {
instance->callback(SubGhzCustomEventViewFreqAnalOkShort, instance->context);
}
// First device receive short, then when user release button we get long
if(event->type == InputTypeLong && frequency_to_save > 0) {
#ifdef FURI_DEBUG
FURI_LOG_I(TAG, "Long press!");
#endif
// Stop worker
if(subghz_frequency_analyzer_worker_is_running(instance->worker)) {
subghz_frequency_analyzer_worker_stop(instance->worker);