SubGhz: bug fixes (#1192)

* Subghz: fix simultaneous detection of Princeton and GateTx
* SubGhz: fix phantom frequencies in the Frequency Analyzer
This commit is contained in:
Skorpionm 2022-05-05 02:34:44 +04:00 committed by GitHub
parent 7017fa4f9e
commit f4a205142d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 27 deletions

View File

@ -71,6 +71,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
furi_hal_subghz_set_frequency(433920000);
furi_hal_subghz_flush_rx();
furi_hal_subghz_set_path(FuriHalSubGhzPathIsolate);
furi_hal_subghz_rx();
while(instance->worker_running) {

View File

@ -6,12 +6,6 @@
#include "../blocks/generic.h"
#include "../blocks/math.h"
/*
* Help
* https://phreakerclub.com/447
*
*/
#define TAG "SubGhzProtocolFirefly"
#define DIP_PATTERN "%c%c%c%c%c%c%c%c%c%c"

View File

@ -11,7 +11,7 @@
#include "../blocks/generic.h"
#include "../blocks/math.h"
#define TAG "SubGhzProtocolkeeloq"
#define TAG "SubGhzProtocolKeeloq"
static const SubGhzBlockConst subghz_protocol_keeloq_const = {
.te_short = 400,

View File

@ -6,12 +6,6 @@
#include "../blocks/generic.h"
#include "../blocks/math.h"
/*
* Help
* https://phreakerclub.com/447
*
*/
#define TAG "SubGhzProtocolNeroSketch"
static const SubGhzBlockConst subghz_protocol_nero_sketch_const = {

View File

@ -5,12 +5,6 @@
#include "../blocks/generic.h"
#include "../blocks/math.h"
/*
* Help
* https://phreakerclub.com/447
*
*/
#define TAG "SubGhzProtocolNiceFLO"
static const SubGhzBlockConst subghz_protocol_nice_flo_const = {

View File

@ -5,6 +5,7 @@
#include "../blocks/encoder.h"
#include "../blocks/generic.h"
#include "../blocks/math.h"
/*
* https://phreakerclub.com/1615
* https://phreakerclub.com/forum/showthread.php?t=2360

View File

@ -12,7 +12,7 @@
*
*/
#define TAG "SubGhzProtocolCAME"
#define TAG "SubGhzProtocolPrinceton"
static const SubGhzBlockConst subghz_protocol_princeton_const = {
.te_short = 400,
@ -28,6 +28,7 @@ struct SubGhzProtocolDecoderPrinceton {
SubGhzBlockGeneric generic;
uint32_t te;
uint32_t last_data;
};
struct SubGhzProtocolEncoderPrinceton {
@ -241,15 +242,18 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t
instance->decoder.parser_step = PrincetonDecoderStepSaveDuration;
if(instance->decoder.decode_count_bit ==
subghz_protocol_princeton_const.min_count_bit_for_found) {
instance->te /= (instance->decoder.decode_count_bit * 4 + 1);
if(instance->last_data == instance->decoder.decode_data) {
instance->te /= (instance->decoder.decode_count_bit * 4 + 1);
instance->generic.data = instance->decoder.decode_data;
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
instance->generic.serial = instance->decoder.decode_data >> 4;
instance->generic.btn = (uint8_t)instance->decoder.decode_data & 0x00000F;
instance->generic.data = instance->decoder.decode_data;
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
instance->generic.serial = instance->decoder.decode_data >> 4;
instance->generic.btn = (uint8_t)instance->decoder.decode_data & 0x00000F;
if(instance->base.callback)
instance->base.callback(&instance->base, instance->base.context);
if(instance->base.callback)
instance->base.callback(&instance->base, instance->base.context);
}
instance->last_data = instance->decoder.decode_data;
}
instance->decoder.decode_data = 0;
instance->decoder.decode_count_bit = 0;

View File

@ -2,6 +2,7 @@
#include "furi_hal.h"
#include "../blocks/math.h"
/*
* Help
* https://phreakerclub.com/447