mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-04-10 02:19:01 -04:00
Move BasebandConfiguration message handling into baseband thread.
This commit is contained in:
parent
fd612dc207
commit
c9f9d97d07
@ -69,8 +69,12 @@ void BasebandThread::set_configuration(const BasebandConfiguration& new_configur
|
||||
}
|
||||
|
||||
void BasebandThread::on_message(const Message* const message) {
|
||||
if( baseband_processor ) {
|
||||
baseband_processor->on_message(message);
|
||||
if( message->id == Message::ID::BasebandConfiguration ) {
|
||||
set_configuration(reinterpret_cast<const BasebandConfigurationMessage*>(message)->configuration);
|
||||
} else {
|
||||
if( baseband_processor ) {
|
||||
baseband_processor->on_message(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,6 @@ public:
|
||||
|
||||
Thread* start(const tprio_t priority);
|
||||
|
||||
void set_configuration(const BasebandConfiguration& new_configuration);
|
||||
|
||||
void on_message(const Message* const message);
|
||||
void on_update_spectrum();
|
||||
|
||||
@ -61,6 +59,8 @@ private:
|
||||
|
||||
void disable();
|
||||
void enable();
|
||||
|
||||
void set_configuration(const BasebandConfiguration& new_configuration);
|
||||
};
|
||||
|
||||
#endif/*__BASEBAND_THREAD_H__*/
|
||||
|
@ -170,10 +170,6 @@ private:
|
||||
|
||||
void on_message(const Message* const message) {
|
||||
switch(message->id) {
|
||||
case Message::ID::BasebandConfiguration:
|
||||
on_message_baseband_configuration(*reinterpret_cast<const BasebandConfigurationMessage*>(message));
|
||||
break;
|
||||
|
||||
case Message::ID::Shutdown:
|
||||
on_message_shutdown(*reinterpret_cast<const ShutdownMessage*>(message));
|
||||
break;
|
||||
@ -184,10 +180,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
void on_message_baseband_configuration(const BasebandConfigurationMessage& message) {
|
||||
baseband_thread.set_configuration(message.configuration);
|
||||
}
|
||||
|
||||
void on_message_shutdown(const ShutdownMessage&) {
|
||||
request_stop();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user