Beep-on-packets option in Settings and updated ERT & Sonde apps (#2058)

* Beep-on-packets option in Settings
* Add beep to ERT app
This commit is contained in:
Mark Thompson
2024-03-29 13:26:45 -05:00
committed by GitHub
parent ba36680a7b
commit fe2fbb847f
11 changed files with 62 additions and 22 deletions

View File

@@ -25,8 +25,6 @@
#include "baseband_processor.hpp"
#include "message.hpp"
#define AUDIO_SAMPLE_RATE 24000
class AudioBeepProcessor : public BasebandProcessor {
public:
AudioBeepProcessor();

View File

@@ -21,6 +21,7 @@
*/
#include "proc_ert.hpp"
#include "audio_dma.hpp"
#include "portapack_shared_memory.hpp"
@@ -109,7 +110,17 @@ void ERTProcessor::idm_handler(
shared_memory.application_queue.push(message);
}
void ERTProcessor::on_message(const Message* const msg) {
if (msg->id == Message::ID::AudioBeep)
on_beep_message(*reinterpret_cast<const AudioBeepMessage*>(msg));
}
void ERTProcessor::on_beep_message(const AudioBeepMessage& message) {
audio::dma::beep_start(message.freq, message.sample_rate, message.duration_ms);
}
int main() {
audio::dma::init_audio_out();
EventDispatcher event_dispatcher{std::make_unique<ERTProcessor>()};
event_dispatcher.run();
return 0;

View File

@@ -102,6 +102,8 @@ class ERTProcessor : public BasebandProcessor {
void scm_handler(const baseband::Packet& packet);
void scmplus_handler(const baseband::Packet& packet);
void idm_handler(const baseband::Packet& packet);
void on_message(const Message* const msg);
void on_beep_message(const AudioBeepMessage& message);
float sum_half_period[2];
float sum_period[3];