mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 10:47:44 +00:00
Level fix and beep, RSSI avg fix (#2027)
* fix average value being overflow'd * fix audio and mod changes, preps for beep mode * fixed beep_freq range, added a stop and set a variable sooner * added support for audio beep messages * better scaler for beep * added bip squelch and saving of bip squelch and audio mode * saving modulation, fixing audio * added save and restore of bandwidth * simpler ctcss clean on change mode
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "proc_capture.hpp"
|
||||
|
||||
#include "audio_dma.hpp"
|
||||
#include "dsp_fir_taps.hpp"
|
||||
#include "event_m4.hpp"
|
||||
#include "utility.hpp"
|
||||
@@ -55,6 +55,16 @@ void CaptureProcessor::execute(const buffer_c8_t& buffer) {
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureProcessor::on_signal_message(const RequestSignalMessage& message) {
|
||||
if (message.signal == RequestSignalMessage::Signal::BeepStopRequest) {
|
||||
audio::dma::beep_stop();
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureProcessor::on_beep_message(const AudioBeepMessage& message) {
|
||||
audio::dma::beep_start(message.freq, message.sample_rate, message.duration_ms);
|
||||
}
|
||||
|
||||
void CaptureProcessor::on_message(const Message* const message) {
|
||||
switch (message->id) {
|
||||
case Message::ID::UpdateSpectrum:
|
||||
@@ -70,6 +80,14 @@ void CaptureProcessor::on_message(const Message* const message) {
|
||||
capture_config(*reinterpret_cast<const CaptureConfigMessage*>(message));
|
||||
break;
|
||||
|
||||
case Message::ID::RequestSignal:
|
||||
on_signal_message(*reinterpret_cast<const RequestSignalMessage*>(message));
|
||||
break;
|
||||
|
||||
case Message::ID::AudioBeep:
|
||||
on_beep_message(*reinterpret_cast<const AudioBeepMessage*>(message));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -152,7 +170,8 @@ void CaptureProcessor::capture_config(const CaptureConfigMessage& message) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
audio::dma::init_audio_out();
|
||||
EventDispatcher event_dispatcher{std::make_unique<CaptureProcessor>()};
|
||||
event_dispatcher.run();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "dsp_decimate.hpp"
|
||||
#include "spectrum_collector.hpp"
|
||||
#include "stream_input.hpp"
|
||||
#include "message.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
@@ -92,6 +93,9 @@ class CaptureProcessor : public BasebandProcessor {
|
||||
void on_message(const Message* const message) override;
|
||||
|
||||
private:
|
||||
void on_signal_message(const RequestSignalMessage& message);
|
||||
void on_beep_message(const AudioBeepMessage& message);
|
||||
|
||||
size_t baseband_fs = 3072000; // aka: sample_rate
|
||||
static constexpr auto spectrum_rate_hz = 50.0f;
|
||||
|
||||
|
Reference in New Issue
Block a user