Merge pull request #519 from notpike/replay_antenna_bias

Replay App Enable Bias-tee
This commit is contained in:
Erwin Ried 2022-03-28 10:09:51 +02:00 committed by GitHub
commit 8da0dbe36b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek * Copyright (C) 2016 Furrtek
* Copyleft () 2022 NotPike
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *
@ -121,6 +122,7 @@ void ReplayAppView::start() {
auto open_error = p->open(file_path); auto open_error = p->open(file_path);
if( open_error.is_valid() ) { if( open_error.is_valid() ) {
file_error(); file_error();
return; // Fixes TX bug if there's a file error
} else { } else {
reader = std::move(p); reader = std::move(p);
} }
@ -151,6 +153,9 @@ void ReplayAppView::start() {
}; };
field_rfamp.set_value(rf_amp ? 14 : 0); field_rfamp.set_value(rf_amp ? 14 : 0);
//Enable Bias Tee if selected
radio::set_antenna_bias(portapack::get_antenna_bias());
radio::enable({ radio::enable({
receiver_model.tuning_frequency(), receiver_model.tuning_frequency(),
sample_rate * 8, sample_rate * 8,
@ -160,7 +165,6 @@ void ReplayAppView::start() {
static_cast<int8_t>(receiver_model.lna()), static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga()) static_cast<int8_t>(receiver_model.vga())
}); });
} }
void ReplayAppView::stop(const bool do_loop) { void ReplayAppView::stop(const bool do_loop) {
@ -170,6 +174,7 @@ void ReplayAppView::stop(const bool do_loop) {
if (do_loop && check_loop.value()) { if (do_loop && check_loop.value()) {
start(); start();
} else { } else {
radio::set_antenna_bias(false); //Turn off Bias Tee
radio::disable(); radio::disable();
button_play.set_bitmap(&bitmap_play); button_play.set_bitmap(&bitmap_play);
} }