Half part of the transition of baseband processor.

This commit is contained in:
HTotoo
2023-12-08 13:12:48 +01:00
parent a5705e1d6c
commit b45638f9ed
23 changed files with 502 additions and 216 deletions
+15 -3
View File
@@ -37,7 +37,7 @@ void WeatherProcessor::execute(const buffer_c8_t& buffer) {
{
if (currentDuration < UINT32_MAX) currentDuration += usperTick;
} else { // called on change, so send the last duration and dir.
protoList.feed(currentHiLow, currentDuration / 1000);
if (protoList) protoList->feed(currentHiLow, currentDuration / 1000);
currentDuration = usperTick;
currentHiLow = meashl;
}
@@ -54,11 +54,23 @@ void WeatherProcessor::execute(const buffer_c8_t& buffer) {
void WeatherProcessor::on_message(const Message* const message) {
if (message->id == Message::ID::WeatherRxConfigure)
configure(*reinterpret_cast<const WeatherRxConfigureMessage*>(message));
configure(*reinterpret_cast<const SubGhzFPRxConfigureMessage*>(message));
}
void WeatherProcessor::configure(const WeatherRxConfigureMessage& message) {
void WeatherProcessor::configure(const SubGhzFPRxConfigureMessage& message) {
(void)message;
modulation = message.modulation; // NIY
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();
}
configured = true;
}