mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Debug prints cleanup
This commit is contained in:
@@ -418,7 +418,7 @@ bool subghz_history_add_to_history(
|
|||||||
for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
||||||
data = (data << 8) | key_data[i];
|
data = (data << 8) | key_data[i];
|
||||||
}
|
}
|
||||||
FURI_LOG_D(TAG, "Recieved data:%llx", data);
|
|
||||||
if(!(uint32_t)(data >> 32)) {
|
if(!(uint32_t)(data >> 32)) {
|
||||||
furi_string_printf(
|
furi_string_printf(
|
||||||
item->item_str,
|
item->item_str,
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ static bool
|
|||||||
data |= frame[i];
|
data |= frame[i];
|
||||||
}
|
}
|
||||||
instance->generic.data = data;
|
instance->generic.data = data;
|
||||||
FURI_LOG_D(TAG, "New data: %llx", instance->generic.data);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,7 +273,7 @@ static bool subghz_protocol_encoder_somfy_telis_get_upload(
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t size_upload = index;
|
size_t size_upload = index;
|
||||||
FURI_LOG_D(TAG, "Size upload: %d", size_upload);
|
|
||||||
if(size_upload > instance->encoder.size_upload) {
|
if(size_upload > instance->encoder.size_upload) {
|
||||||
FURI_LOG_E(TAG, "Size upload exceeds allocated encoder buffer.");
|
FURI_LOG_E(TAG, "Size upload exceeds allocated encoder buffer.");
|
||||||
return false;
|
return false;
|
||||||
@@ -401,7 +400,6 @@ void subghz_protocol_decoder_somfy_telis_feed(void* context, bool level, uint32_
|
|||||||
if((!level) && (DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_short * 4) <
|
if((!level) && (DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_short * 4) <
|
||||||
subghz_protocol_somfy_telis_const.te_delta * 4)) {
|
subghz_protocol_somfy_telis_const.te_delta * 4)) {
|
||||||
instance->decoder.parser_step = SomfyTelisDecoderStepCheckPreambula;
|
instance->decoder.parser_step = SomfyTelisDecoderStepCheckPreambula;
|
||||||
FURI_LOG_D(TAG, "Found preambula");
|
|
||||||
} else {
|
} else {
|
||||||
instance->header_count = 0;
|
instance->header_count = 0;
|
||||||
instance->decoder.parser_step = SomfyTelisDecoderStepReset;
|
instance->decoder.parser_step = SomfyTelisDecoderStepReset;
|
||||||
@@ -413,7 +411,6 @@ void subghz_protocol_decoder_somfy_telis_feed(void* context, bool level, uint32_
|
|||||||
subghz_protocol_somfy_telis_const.te_delta * 4) {
|
subghz_protocol_somfy_telis_const.te_delta * 4) {
|
||||||
instance->decoder.parser_step = SomfyTelisDecoderStepFoundPreambula;
|
instance->decoder.parser_step = SomfyTelisDecoderStepFoundPreambula;
|
||||||
instance->header_count++;
|
instance->header_count++;
|
||||||
FURI_LOG_D(TAG, "Hardware sync");
|
|
||||||
} else if(
|
} else if(
|
||||||
(instance->header_count > 1) &&
|
(instance->header_count > 1) &&
|
||||||
(DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_short * 7) <
|
(DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_short * 7) <
|
||||||
@@ -432,7 +429,6 @@ void subghz_protocol_decoder_somfy_telis_feed(void* context, bool level, uint32_
|
|||||||
ManchesterEventLongHigh,
|
ManchesterEventLongHigh,
|
||||||
&instance->manchester_saved_state,
|
&instance->manchester_saved_state,
|
||||||
NULL);
|
NULL);
|
||||||
FURI_LOG_D(TAG, "Software sync");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,31 +439,24 @@ void subghz_protocol_decoder_somfy_telis_feed(void* context, bool level, uint32_
|
|||||||
if(DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_short) <
|
if(DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_short) <
|
||||||
subghz_protocol_somfy_telis_const.te_delta) {
|
subghz_protocol_somfy_telis_const.te_delta) {
|
||||||
event = ManchesterEventShortLow;
|
event = ManchesterEventShortLow;
|
||||||
FURI_LOG_D(TAG, "Data decode short");
|
|
||||||
} else if(
|
} else if(
|
||||||
DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_long) <
|
DURATION_DIFF(duration, subghz_protocol_somfy_telis_const.te_long) <
|
||||||
subghz_protocol_somfy_telis_const.te_delta) {
|
subghz_protocol_somfy_telis_const.te_delta) {
|
||||||
event = ManchesterEventLongLow;
|
event = ManchesterEventLongLow;
|
||||||
FURI_LOG_D(TAG, "Data decode long");
|
|
||||||
} else if(
|
} else if(
|
||||||
duration >= (subghz_protocol_somfy_telis_const.te_long +
|
duration >= (subghz_protocol_somfy_telis_const.te_long +
|
||||||
subghz_protocol_somfy_telis_const.te_delta)) {
|
subghz_protocol_somfy_telis_const.te_delta)) {
|
||||||
FURI_LOG_D(
|
|
||||||
TAG, "Data decode manchester bit: %d", instance->decoder.decode_count_bit);
|
|
||||||
if(instance->decoder.decode_count_bit ==
|
if(instance->decoder.decode_count_bit ==
|
||||||
subghz_protocol_somfy_telis_const.min_count_bit_for_found) {
|
subghz_protocol_somfy_telis_const.min_count_bit_for_found) {
|
||||||
//check crc
|
//check crc
|
||||||
uint64_t data_tmp = instance->decoder.decode_data ^
|
uint64_t data_tmp = instance->decoder.decode_data ^
|
||||||
(instance->decoder.decode_data >> 8);
|
(instance->decoder.decode_data >> 8);
|
||||||
FURI_LOG_D(TAG, "Check crc: %llx", (data_tmp >> 40) & 0xF);
|
|
||||||
if(((data_tmp >> 40) & 0xF) == subghz_protocol_somfy_telis_crc(data_tmp)) {
|
if(((data_tmp >> 40) & 0xF) == subghz_protocol_somfy_telis_crc(data_tmp)) {
|
||||||
instance->generic.data = instance->decoder.decode_data;
|
instance->generic.data = instance->decoder.decode_data;
|
||||||
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
|
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
|
||||||
|
|
||||||
if(instance->base.callback)
|
if(instance->base.callback)
|
||||||
instance->base.callback(&instance->base, instance->base.context);
|
instance->base.callback(&instance->base, instance->base.context);
|
||||||
} else {
|
|
||||||
FURI_LOG_D(TAG, "Bad crc");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
instance->decoder.decode_data = 0;
|
instance->decoder.decode_data = 0;
|
||||||
@@ -649,7 +638,6 @@ void subghz_protocol_decoder_somfy_telis_get_string(void* context, FuriString* o
|
|||||||
SubGhzProtocolDecoderSomfyTelis* instance = context;
|
SubGhzProtocolDecoderSomfyTelis* instance = context;
|
||||||
|
|
||||||
subghz_protocol_somfy_telis_check_remote_controller(&instance->generic);
|
subghz_protocol_somfy_telis_check_remote_controller(&instance->generic);
|
||||||
FURI_LOG_D(TAG, "Data: %llx", instance->generic.data);
|
|
||||||
furi_string_cat_printf(
|
furi_string_cat_printf(
|
||||||
output,
|
output,
|
||||||
"%s %db\r\n"
|
"%s %db\r\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user