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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 62 additions and 22 deletions

View file

@ -23,7 +23,7 @@
#include "ert_app.hpp"
#include "baseband_api.hpp"
#include "audio.hpp"
#include "portapack.hpp"
using namespace portapack;
@ -33,6 +33,8 @@ using namespace portapack;
#include "string_format.hpp"
#include "file_path.hpp"
namespace pmem = portapack::persistent_memory;
namespace ert {
namespace format {
@ -121,6 +123,7 @@ ERTAppView::ERTAppView(NavigationView& nav)
&field_lna,
&field_vga,
&rssi,
&field_volume,
&recent_entries_view,
});
@ -132,9 +135,15 @@ ERTAppView::ERTAppView(NavigationView& nav)
if (logger) {
logger->append(logs_dir / u"ERT.TXT");
}
if (pmem::beep_on_packets()) {
audio::set_rate(audio::Rate::Hz_24000);
audio::output::start();
}
}
ERTAppView::~ERTAppView() {
audio::output::stop();
receiver_model.disable();
baseband::shutdown();
}
@ -158,6 +167,10 @@ void ERTAppView::on_packet(const ert::Packet& packet) {
entry.update(packet);
recent_entries_view.set_dirty();
}
if (pmem::beep_on_packets()) {
baseband::request_audio_beep(1000, 24000, 60);
}
}
void ERTAppView::on_show_list() {