Separate weather and sgd, bc of baseband size limit

This commit is contained in:
HTotoo
2023-12-09 22:01:15 +01:00
parent 28d89fbb88
commit 76cd0e1771
13 changed files with 341 additions and 27 deletions
+4 -14
View File
@@ -24,7 +24,7 @@
#include "portapack_shared_memory.hpp"
#include "event_m4.hpp"
void WeatherProcessor::execute(const buffer_c8_t& buffer) {
void SubGhzDProcessor::execute(const buffer_c8_t& buffer) {
if (!configured) return;
// SR = 4Mhz , and we are decimating by /8 in total , decim1_out clock 4Mhz /8= 500khz samples/sec.
@@ -65,28 +65,18 @@ void WeatherProcessor::execute(const buffer_c8_t& buffer) {
}
}
void WeatherProcessor::on_message(const Message* const message) {
void SubGhzDProcessor::on_message(const Message* const message) {
if (message->id == Message::ID::WeatherRxConfigure)
configure(*reinterpret_cast<const SubGhzFPRxConfigureMessage*>(message));
}
void WeatherProcessor::configure(const SubGhzFPRxConfigureMessage& 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
decim_0.configure(taps_200k_wfm_decim_0.taps);
decim_1.configure(taps_200k_wfm_decim_1.taps);
if (protoMode != message.protoMode) {
// change it.
FProtoListGeneral* tmp = protoList;
protoList = NULL;
protoMode = message.protoMode;
if (tmp) free(tmp); // takes some time
if (protoMode == 0) protoList = new WeatherProtos();
if (protoMode == 1) protoList = new SubGhzDProtos();
}
modulation = message.modulation; // NIY
if (protoList != NULL) {
@@ -97,7 +87,7 @@ void WeatherProcessor::configure(const SubGhzFPRxConfigureMessage& message) {
}
int main() {
EventDispatcher event_dispatcher{std::make_unique<WeatherProcessor>()};
EventDispatcher event_dispatcher{std::make_unique<SubGhzDProcessor>()};
event_dispatcher.run();
return 0;
}