Pocsag improvements (#20)

* Update analog_audio_app.cpp (#353)

* Adding phase field (extracted from @jamesshao8 repo)
This commit is contained in:
Erwin Ried 2020-05-09 13:13:21 +02:00 committed by GitHub
parent 3e15baa251
commit 4aaac8545b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 11 deletions

View file

@ -69,6 +69,7 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
&field_vga,
&field_frequency,
&options_bitrate,
&options_phase,
&check_log,
&check_ignore,
&sym_ignore,
@ -99,10 +100,13 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
};
options_bitrate.on_change = [this](size_t, OptionsField::value_t v) {
on_bitrate_changed(v);
on_config_changed(v, options_phase.selected_index_value());
};
options_bitrate.set_selected_index(1); // 1200bps
options_phase.on_change = [this](size_t, OptionsField::value_t v) {
on_config_changed(options_bitrate.selected_index_value(),v);
};
check_ignore.set_value(ignore);
check_ignore.on_select = [this](Checkbox&, bool v) {
ignore = v;
@ -197,8 +201,8 @@ void POCSAGAppView::on_packet(const POCSAGPacketMessage * message) {
logger->log_raw_data(message->packet, target_frequency());
}
void POCSAGAppView::on_bitrate_changed(const uint32_t new_bitrate) {
baseband::set_pocsag(pocsag_bitrates[new_bitrate]);
void POCSAGAppView::on_config_changed(const uint32_t new_bitrate, bool new_phase) {
baseband::set_pocsag(pocsag_bitrates[new_bitrate], new_phase);
}
void POCSAGAppView::set_target_frequency(const uint32_t new_value) {