SubCar fm mode (#2965)

This commit is contained in:
Totoo
2026-02-06 17:20:14 +01:00
committed by GitHub
parent 6562e596e8
commit fe9f0c228f
8 changed files with 353 additions and 153 deletions
+8 -8
View File
@@ -56,8 +56,8 @@ class SubCarProcessor : public BasebandProcessor {
uint32_t low_estimate = 100;
uint32_t high_estimate = 12000;
uint32_t min_high_level = 10;
uint8_t numg = 0; // count of matched signals to filter spikes
size_t baseband_fs = 0; // will be set later by configure message
uint8_t numg = 0; // count of matched signals to filter spikes
size_t baseband_fs = 4'000'000; // will be set later by configure message
uint32_t nsPerDecSamp = 0;
/* Array Buffer aux. used in decim0 and decim1 IQ c16 signed data ; (decim0 defines the max length of the array) */
@@ -74,20 +74,20 @@ class SubCarProcessor : public BasebandProcessor {
uint32_t threshold = 0x0630;
bool currentHiLow = false;
bool configured{false};
uint8_t mode = 0; // 0 = am, 1 = fm
// fm part:
struct DemodFMState {
int prev_quad = 0; // Stores 0, 1, 2, or 3
int32_t dc_offset = 0;
int32_t smoothed_error = 0;
bool current_logic_level = false;
uint32_t buffer_count = 0;
int16_t last_re = 0; // Store previous Real sample
int16_t last_im = 0;
int32_t smoothed_discrim = 0;
};
DemodFMState fm_state{};
FProtoListGeneral* protoList = new SubCarProtos(); // holds all the protocols we can parse
FProtoListGeneral* protoListFm = new SubCarProtos(); // holds all the protocols we can parse, but for fm (dupe, bc most of it is dual)
uint8_t modulation = 0; // 0 am, 1 fm
FProtoListGeneral* protoList = new SubCarProtos(); // holds all the protocols we can parse
void configure(const SubGhzFPRxConfigureMessage& message);
/* NB: Threads should be the last members in the class definition. */