Enable Sample Rate to be spec'd in .ini file for Weather & SubGhzDecoder apps (#1659)

This commit is contained in:
Mark Thompson 2023-12-21 12:33:06 -06:00 committed by GitHub
parent 36e1b9a36e
commit 19a66fac20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 28 additions and 26 deletions

View file

@ -47,7 +47,7 @@ void SubGhzDProcessor::execute(const buffer_c8_t& buffer) {
tm += mag;
if (meashl == currentHiLow && currentDuration < 30'000'000) // allow pass 'end' signal
{
if (currentDuration < UINT32_MAX) currentDuration += nsPerDecSamp;
currentDuration += nsPerDecSamp;
} else { // called on change, so send the last duration and dir.
if (protoList) protoList->feed(currentHiLow, currentDuration / 1000);
currentDuration = nsPerDecSamp;
@ -73,7 +73,12 @@ void SubGhzDProcessor::on_message(const Message* const message) {
void SubGhzDProcessor::configure(const SubGhzFPRxConfigureMessage& message) {
// constexpr size_t decim_0_output_fs = baseband_fs / decim_0.decimation_factor; //unused
// constexpr size_t decim_1_output_fs = decim_0_output_fs / decim_1.decimation_factor; //unused
(void)message; // unused
modulation = message.modulation; // TODO: add support for FM (currently AM only)
baseband_fs = message.sampling_rate;
baseband_thread.set_sampling_rate(baseband_fs);
nsPerDecSamp = 1'000'000'000 / baseband_fs * 8; // Scaled it due to less array buffer sampes due to /8 decimation. 250 nseg (4Mhz) * 8
decim_0.configure(taps_200k_wfm_decim_0.taps);
decim_1.configure(taps_200k_wfm_decim_1.taps);