Improved close call precision

This commit is contained in:
furrtek
2016-05-13 01:18:04 +02:00
parent 7d193c3445
commit 9149508c83
23 changed files with 184 additions and 44 deletions
+9
View File
@@ -86,6 +86,15 @@ void shutdown() {
shared_memory.baseband_queue.push(shutdown_message);
}
void spectrum_streaming_start(size_t decimation_factor) {
shared_memory.baseband_queue.push_and_wait(
SpectrumStreamingConfigMessage {
SpectrumStreamingConfigMessage::Mode::Running,
decimation_factor
}
);
}
void spectrum_streaming_start() {
shared_memory.baseband_queue.push_and_wait(
SpectrumStreamingConfigMessage {
+1
View File
@@ -55,6 +55,7 @@ void stop();
void shutdown();
void spectrum_streaming_start(size_t decimation_factor);
void spectrum_streaming_start();
void spectrum_streaming_stop();
+1 -1
View File
@@ -66,7 +66,7 @@ private:
uint32_t baseband_bandwidth_ { max2837::filter::bandwidth_minimum };
int32_t vga_gain_db_ { 8 };
BasebandConfiguration baseband_configuration {
.mode = 0, /* TODO: Enum! */
.mode = 0,
.sampling_rate = 3072000,
.decimation_factor = 1,
};
+10 -6
View File
@@ -24,10 +24,9 @@
#include "ui_receiver.hpp"
#include "ch.h"
#include "evtimer.h"
#include "time.hpp"
#include "event_m0.hpp"
#include "ff.h"
#include "hackrf_gpio.hpp"
#include "portapack.hpp"
#include "radio.hpp"
@@ -50,6 +49,7 @@ void CloseCallView::focus() {
CloseCallView::~CloseCallView() {
receiver_model.disable();
time::signal_tick_second -= signal_token_tick_second;
}
void CloseCallView::do_detection() {
@@ -224,7 +224,7 @@ void CloseCallView::on_show() {
}
);
baseband::spectrum_streaming_start();
baseband::spectrum_streaming_start(1);
}
void CloseCallView::on_hide() {
@@ -286,7 +286,7 @@ void CloseCallView::on_vga_changed(int32_t v_db) {
receiver_model.set_vga(v_db);
}
void CloseCallView::update_rate() {
void CloseCallView::on_tick_second() {
text_rate.set(to_string_dec_uint(scan_counter, 3));
scan_counter = 0;
}
@@ -343,8 +343,8 @@ CloseCallView::CloseCallView(
};
};
field_frequency_max.set_value(receiver_model.tuning_frequency() + 5000000);
field_frequency_max.set_step(200000);
field_frequency_max.set_value(receiver_model.tuning_frequency() + 2000000);
field_frequency_max.set_step(100000);
field_frequency_max.on_change = [this](rf::Frequency f) {
(void) f;
this->on_range_changed();
@@ -373,6 +373,10 @@ CloseCallView::CloseCallView(
nav.pop();
};
signal_token_tick_second = time::signal_tick_second += [this]() {
this->on_tick_second();
};
//audio::output::mute();
receiver_model.set_baseband_configuration({
.mode = toUType(ReceiverModel::Mode::CloseCall),
+3 -2
View File
@@ -43,7 +43,7 @@
namespace ui {
#define CC_SLICE_WIDTH 5000000 //10000000
#define CC_SLICE_WIDTH 3000000 //10000000
#define CC_BIN_NB 236
#define CC_BIN_WIDTH CC_SLICE_WIDTH/CC_BIN_NB
@@ -74,6 +74,7 @@ private:
uint8_t slicemax_db[32]; // Todo: Cap max slices !
uint8_t slicemax_idx[32];
uint8_t scan_counter;
SignalToken signal_token_tick_second;
bool ignore = true;
bool slicing;
bool locked = false;
@@ -82,7 +83,7 @@ private:
void do_detection();
void on_lna_changed(int32_t v_db);
void on_vga_changed(int32_t v_db);
void update_rate();
void on_tick_second();
/* |012345678901234567890123456789|
* | Min: Max: LNA VGA |
+8 -6
View File
@@ -270,7 +270,7 @@ XylosView::XylosView(
receiver_code.set_value(1);
header_code_a.set_value(0);
header_code_b.set_value(0);
options_freq.set_selected_index(5);
options_freq.set_selected_index(6); // 5 ! DEBUG
checkbox_wcsubfamily.set_value(true);
checkbox_wcid.set_value(true);
@@ -331,13 +331,15 @@ XylosView::XylosView(
button_transmit.set_style(&style_val);
button_txtest.on_select = [this,&transmitter_model](Button&) {
XylosView::upd_message();
button_txtest.on_select = [this](Button&) {
const uint8_t ccirtest[21] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,13,12,11,0xFF };
if (txing == false) {
EventDispatcher::message_map().unregister_handler(Message::ID::TXDone);
EventDispatcher::message_map().register_handler(Message::ID::TXDone,
[this,&transmitter_model](Message* const p) {
[this](Message* const p) {
const auto message = static_cast<const TXDoneMessage*>(p);
if (message->n == 25) {
audio::headphone::set_volume(volume_t::decibel(0 - 99) + audio::headphone::volume_range().max);
@@ -364,14 +366,14 @@ XylosView::XylosView(
}
};
button_transmit.on_select = [this,&transmitter_model](Button&) {
button_transmit.on_select = [this](Button&) {
if (txing == false) {
upd_message();
EventDispatcher::message_map().unregister_handler(Message::ID::TXDone);
EventDispatcher::message_map().register_handler(Message::ID::TXDone,
[this,&transmitter_model](Message* const p) {
[this](Message* const p) {
uint8_t c;
char progress[21];
const auto message = static_cast<const TXDoneMessage*>(p);
@@ -390,7 +392,7 @@ XylosView::XylosView(
journuit();
}
} else {
for (c=0;c<message->n;c++)
for (c=0;c<message->n;c++) // Todo: Use progressbar !
progress[c] = ' ';
progress[c] = '.';
progress[++c] = 0;