mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-31 18:49:15 -04: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:
parent
1a87f2d701
commit
536981998b
5 changed files with 149 additions and 46 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue