diff --git a/protocols/fiat_v0.c b/protocols/fiat_v0.c index 6d748a2..92c1439 100644 --- a/protocols/fiat_v0.c +++ b/protocols/fiat_v0.c @@ -2,8 +2,6 @@ #include "../protopirate_app_i.h" #include -#define TAG "FiatProtocolV0" - static const SubGhzBlockConst subghz_protocol_fiat_v0_const = { .te_short = 200, .te_long = 400, @@ -11,6 +9,20 @@ static const SubGhzBlockConst subghz_protocol_fiat_v0_const = { .min_count_bit_for_found = 64, }; +#define TAG "FiatProtocolV0" +#define FIAT_PROTOCOL_V0_NAME "Fiat V0" + +/* Worst-case encoder upload capacity (LevelDuration entries) + * Per burst: + * - preamble: FIAT_V0_PREAMBLE_PAIRS * 2 + * - data: max 141 entries (see encoder differential rules) + * Between bursts: one inter-burst gap entry + */ +#define FIAT_V0_DATA_MAX_EDGES ((63 + 6) * 2 + 3) +#define FIAT_V0_BURST_MAX_EDGES (FIAT_V0_PREAMBLE_PAIRS * 2 + FIAT_V0_DATA_MAX_EDGES) +#define FIAT_V0_UPLOAD_CAP \ + (FIAT_V0_TOTAL_BURSTS * FIAT_V0_BURST_MAX_EDGES + (FIAT_V0_TOTAL_BURSTS - 1)) + #define FIAT_V0_PREAMBLE_PAIRS 150 #define FIAT_V0_GAP_US 800 #define FIAT_V0_TOTAL_BURSTS 3 diff --git a/protocols/fiat_v0.h b/protocols/fiat_v0.h index e06a709..329a06f 100644 --- a/protocols/fiat_v0.h +++ b/protocols/fiat_v0.h @@ -12,20 +12,6 @@ #include "../defines.h" -#define FIAT_PROTOCOL_V0_NAME "Fiat V0" - -/* Worst-case encoder upload capacity (LevelDuration entries) - * Per burst: - * - preamble: FIAT_V0_PREAMBLE_PAIRS * 2 - * - data: max 141 entries (see encoder differential rules) - * Between bursts: one inter-burst gap entry - */ -#define FIAT_V0_DATA_MAX_EDGES ((63 + 6) * 2 + 3) -#define FIAT_V0_BURST_MAX_EDGES (FIAT_V0_PREAMBLE_PAIRS * 2 + FIAT_V0_DATA_MAX_EDGES) -#define FIAT_V0_UPLOAD_CAP \ - (FIAT_V0_TOTAL_BURSTS * FIAT_V0_BURST_MAX_EDGES + (FIAT_V0_TOTAL_BURSTS - 1)) -#define FIAT_V0_GAP_US 800 - typedef struct SubGhzProtocolDecoderFiatV0 SubGhzProtocolDecoderFiatV0; typedef struct SubGhzProtocolEncoderFiatV0 SubGhzProtocolEncoderFiatV0;