mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 03:34:35 +00:00
Add lots of value constructors.
This commit is contained in:
parent
cd31ae86d7
commit
4eb0facacb
@ -49,8 +49,8 @@ using namespace lpc43xx;
|
|||||||
|
|
||||||
struct AISPosition {
|
struct AISPosition {
|
||||||
rtc::RTC timestamp { };
|
rtc::RTC timestamp { };
|
||||||
ais::Latitude latitude;
|
ais::Latitude latitude { };
|
||||||
ais::Longitude longitude;
|
ais::Longitude longitude { };
|
||||||
ais::RateOfTurn rate_of_turn { -128 };
|
ais::RateOfTurn rate_of_turn { -128 };
|
||||||
ais::SpeedOverGround speed_over_ground { 1023 };
|
ais::SpeedOverGround speed_over_ground { 1023 };
|
||||||
ais::CourseOverGround course_over_ground { 3600 };
|
ais::CourseOverGround course_over_ground { 3600 };
|
||||||
@ -78,6 +78,9 @@ struct AISRecentEntry {
|
|||||||
AISRecentEntry(
|
AISRecentEntry(
|
||||||
const ais::MMSI& mmsi
|
const ais::MMSI& mmsi
|
||||||
) : mmsi { mmsi },
|
) : mmsi { mmsi },
|
||||||
|
name { },
|
||||||
|
call_sign { },
|
||||||
|
destination { },
|
||||||
last_position { },
|
last_position { },
|
||||||
received_count { 0 },
|
received_count { 0 },
|
||||||
navigational_status { -1 }
|
navigational_status { -1 }
|
||||||
@ -102,7 +105,7 @@ public:
|
|||||||
void on_packet(const ais::Packet& packet);
|
void on_packet(const ais::Packet& packet);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LogFile log_file;
|
LogFile log_file { };
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
@ -111,7 +114,7 @@ using AISRecentEntriesView = RecentEntriesView<AISRecentEntries>;
|
|||||||
|
|
||||||
class AISRecentEntryDetailView : public View {
|
class AISRecentEntryDetailView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(void)> on_close;
|
std::function<void(void)> on_close { };
|
||||||
|
|
||||||
AISRecentEntryDetailView();
|
AISRecentEntryDetailView();
|
||||||
|
|
||||||
@ -122,7 +125,7 @@ public:
|
|||||||
void paint(Painter&) override;
|
void paint(Painter&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AISRecentEntry entry_;
|
AISRecentEntry entry_ { };
|
||||||
|
|
||||||
Button button_done {
|
Button button_done {
|
||||||
{ 72, 216, 96, 24 },
|
{ 72, 216, 96, 24 },
|
||||||
@ -158,15 +161,15 @@ private:
|
|||||||
static constexpr uint32_t sampling_rate = 2457600;
|
static constexpr uint32_t sampling_rate = 2457600;
|
||||||
static constexpr uint32_t baseband_bandwidth = 1750000;
|
static constexpr uint32_t baseband_bandwidth = 1750000;
|
||||||
|
|
||||||
AISRecentEntries recent;
|
AISRecentEntries recent { };
|
||||||
std::unique_ptr<AISLogger> logger;
|
std::unique_ptr<AISLogger> logger { };
|
||||||
|
|
||||||
const RecentEntriesColumns columns { {
|
const RecentEntriesColumns columns { {
|
||||||
{ "MMSI", 9 },
|
{ "MMSI", 9 },
|
||||||
{ "Name/Call", 20 },
|
{ "Name/Call", 20 },
|
||||||
} };
|
} };
|
||||||
AISRecentEntriesView recent_entries_view { columns, recent };
|
AISRecentEntriesView recent_entries_view { columns, recent };
|
||||||
AISRecentEntryDetailView recent_entry_detail_view;
|
AISRecentEntryDetailView recent_entry_detail_view { };
|
||||||
|
|
||||||
static constexpr auto header_height = 1 * 16;
|
static constexpr auto header_height = 1 * 16;
|
||||||
|
|
||||||
|
@ -139,14 +139,14 @@ private:
|
|||||||
' ',
|
' ',
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<Widget> options_widget;
|
std::unique_ptr<Widget> options_widget { };
|
||||||
|
|
||||||
RecordView record_view {
|
RecordView record_view {
|
||||||
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
|
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
|
||||||
u"AUD_????", RecordView::FileType::WAV, 4096, 4
|
u"AUD_????", RecordView::FileType::WAV, 4096, 4
|
||||||
};
|
};
|
||||||
|
|
||||||
spectrum::WaterfallWidget waterfall;
|
spectrum::WaterfallWidget waterfall { };
|
||||||
|
|
||||||
void on_tuning_frequency_changed(rf::Frequency f);
|
void on_tuning_frequency_changed(rf::Frequency f);
|
||||||
void on_baseband_bandwidth_changed(uint32_t bandwidth_hz);
|
void on_baseband_bandwidth_changed(uint32_t bandwidth_hz);
|
||||||
|
@ -92,7 +92,7 @@ private:
|
|||||||
u"BBD_????", RecordView::FileType::RawS16, 16384, 3
|
u"BBD_????", RecordView::FileType::RawS16, 16384, 3
|
||||||
};
|
};
|
||||||
|
|
||||||
spectrum::WaterfallWidget waterfall;
|
spectrum::WaterfallWidget waterfall { };
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
@ -53,7 +53,7 @@ private:
|
|||||||
std::unique_ptr<stream::Writer> writer;
|
std::unique_ptr<stream::Writer> writer;
|
||||||
std::function<void()> success_callback;
|
std::function<void()> success_callback;
|
||||||
std::function<void(File::Error)> error_callback;
|
std::function<void(File::Error)> error_callback;
|
||||||
Thread* thread;
|
Thread* thread { nullptr };
|
||||||
|
|
||||||
static msg_t static_fn(void* arg);
|
static msg_t static_fn(void* arg);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mask_t mask;
|
mask_t mask { };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif/*__DIRTY_REGISTERS_H__*/
|
#endif/*__DIRTY_REGISTERS_H__*/
|
||||||
|
@ -72,7 +72,7 @@ struct ERTRecentEntry {
|
|||||||
|
|
||||||
size_t received_count { 0 };
|
size_t received_count { 0 };
|
||||||
|
|
||||||
ert::Consumption last_consumption;
|
ert::Consumption last_consumption { };
|
||||||
|
|
||||||
ERTRecentEntry(
|
ERTRecentEntry(
|
||||||
const Key& key
|
const Key& key
|
||||||
@ -97,7 +97,7 @@ public:
|
|||||||
void on_packet(const ert::Packet& packet);
|
void on_packet(const ert::Packet& packet);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LogFile log_file;
|
LogFile log_file { };
|
||||||
};
|
};
|
||||||
|
|
||||||
using ERTRecentEntries = RecentEntries<ERTRecentEntry>;
|
using ERTRecentEntries = RecentEntries<ERTRecentEntry>;
|
||||||
@ -126,8 +126,8 @@ public:
|
|||||||
std::string title() const override { return "ERT"; };
|
std::string title() const override { return "ERT"; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ERTRecentEntries recent;
|
ERTRecentEntries recent { };
|
||||||
std::unique_ptr<ERTLogger> logger;
|
std::unique_ptr<ERTLogger> logger { };
|
||||||
|
|
||||||
const RecentEntriesColumns columns { {
|
const RecentEntriesColumns columns { {
|
||||||
{ "ID", 10 },
|
{ "ID", 10 },
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
using MapType = std::array<MessageHandler, toUType(Message::ID::MAX)>;
|
using MapType = std::array<MessageHandler, toUType(Message::ID::MAX)>;
|
||||||
MapType map_;
|
MapType map_ { };
|
||||||
};
|
};
|
||||||
|
|
||||||
static MessageHandlerMap message_map;
|
static MessageHandlerMap message_map;
|
||||||
|
@ -94,7 +94,7 @@ private:
|
|||||||
|
|
||||||
static Thread* thread_event_loop;
|
static Thread* thread_event_loop;
|
||||||
|
|
||||||
touch::Manager touch_manager;
|
touch::Manager touch_manager { };
|
||||||
ui::Widget* const top_widget;
|
ui::Widget* const top_widget;
|
||||||
ui::Painter painter;
|
ui::Painter painter;
|
||||||
ui::Context& context;
|
ui::Context& context;
|
||||||
|
@ -37,10 +37,7 @@ namespace std {
|
|||||||
namespace filesystem {
|
namespace filesystem {
|
||||||
|
|
||||||
struct filesystem_error {
|
struct filesystem_error {
|
||||||
constexpr filesystem_error(
|
constexpr filesystem_error() = default;
|
||||||
) : err { FR_OK }
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr filesystem_error(
|
constexpr filesystem_error(
|
||||||
FRESULT fatfs_error
|
FRESULT fatfs_error
|
||||||
@ -61,7 +58,7 @@ struct filesystem_error {
|
|||||||
std::string what() const;
|
std::string what() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t err;
|
uint32_t err { FR_OK };
|
||||||
};
|
};
|
||||||
|
|
||||||
struct path {
|
struct path {
|
||||||
@ -196,8 +193,8 @@ class directory_iterator {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<Impl> impl;
|
std::shared_ptr<Impl> impl { };
|
||||||
const path pattern;
|
const path pattern { };
|
||||||
|
|
||||||
friend bool operator!=(const directory_iterator& lhs, const directory_iterator& rhs);
|
friend bool operator!=(const directory_iterator& lhs, const directory_iterator& rhs);
|
||||||
|
|
||||||
@ -320,7 +317,7 @@ public:
|
|||||||
Optional<Error> sync();
|
Optional<Error> sync();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FIL f;
|
FIL f { };
|
||||||
|
|
||||||
Optional<Error> open_fatfs(const std::filesystem::path& filename, BYTE mode);
|
Optional<Error> open_fatfs(const std::filesystem::path& filename, BYTE mode);
|
||||||
};
|
};
|
||||||
|
@ -44,7 +44,7 @@ public:
|
|||||||
File::Result<File::Size> write(const void* const buffer, const File::Size bytes) override;
|
File::Result<File::Size> write(const void* const buffer, const File::Size bytes) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
File file;
|
File file { };
|
||||||
uint64_t bytes_written { 0 };
|
uint64_t bytes_written { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -97,8 +97,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t sampling_rate;
|
uint32_t sampling_rate { 0 };
|
||||||
uint32_t bytes_written;
|
uint32_t bytes_written { 0 };
|
||||||
|
|
||||||
Optional<File::Error> update_header();
|
Optional<File::Error> update_header();
|
||||||
};
|
};
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
Optional<File::Error> write_entry(const rtc::RTC& datetime, const std::string& entry);
|
Optional<File::Error> write_entry(const rtc::RTC& datetime, const std::string& entry);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
File file;
|
File file { };
|
||||||
|
|
||||||
Optional<File::Error> write_line(const std::string& message);
|
Optional<File::Error> write_line(const std::string& message);
|
||||||
};
|
};
|
||||||
|
@ -897,7 +897,7 @@ private:
|
|||||||
spi::arbiter::Target& _target;
|
spi::arbiter::Target& _target;
|
||||||
|
|
||||||
RegisterMap _map { initial_register_values };
|
RegisterMap _map { initial_register_values };
|
||||||
DirtyRegisters<Register, reg_count> _dirty;
|
DirtyRegisters<Register, reg_count> _dirty { };
|
||||||
|
|
||||||
void flush_one(const Register reg);
|
void flush_one(const Register reg);
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class RecentEntriesTable : public Widget {
|
|||||||
public:
|
public:
|
||||||
using Entry = typename Entries::value_type;
|
using Entry = typename Entries::value_type;
|
||||||
|
|
||||||
std::function<void(const Entry& entry)> on_select;
|
std::function<void(const Entry& entry)> on_select { };
|
||||||
|
|
||||||
RecentEntriesTable(
|
RecentEntriesTable(
|
||||||
Entries& recent
|
Entries& recent
|
||||||
@ -231,7 +231,7 @@ class RecentEntriesView : public View {
|
|||||||
public:
|
public:
|
||||||
using Entry = typename Entries::value_type;
|
using Entry = typename Entries::value_type;
|
||||||
|
|
||||||
std::function<void(const Entry& entry)> on_select;
|
std::function<void(const Entry& entry)> on_select { };
|
||||||
|
|
||||||
RecentEntriesView(
|
RecentEntriesView(
|
||||||
const RecentEntriesColumns& columns,
|
const RecentEntriesColumns& columns,
|
||||||
|
@ -813,10 +813,10 @@ public:
|
|||||||
reg_t read(const address_t reg_num);
|
reg_t read(const address_t reg_num);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
spi::SPI _bus;
|
spi::SPI _bus { };
|
||||||
|
|
||||||
RegisterMap _map { default_hackrf_one };
|
RegisterMap _map { default_hackrf_one };
|
||||||
DirtyRegisters<Register, reg_count> _dirty;
|
DirtyRegisters<Register, reg_count> _dirty { };
|
||||||
|
|
||||||
void write(const address_t reg_num, const reg_t value);
|
void write(const address_t reg_num, const reg_t value);
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ private:
|
|||||||
|
|
||||||
using EntryType = std::unique_ptr<CallbackEntry>;
|
using EntryType = std::unique_ptr<CallbackEntry>;
|
||||||
|
|
||||||
std::list<EntryType> entries;
|
std::list<EntryType> entries { };
|
||||||
SignalToken next_token = 1;
|
SignalToken next_token = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
std::vector<sample_t> history() const;
|
std::vector<sample_t> history() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<sample_t, 128> samples;
|
std::array<sample_t, 128> samples { };
|
||||||
|
|
||||||
static constexpr size_t sample_interval = 5;
|
static constexpr size_t sample_interval = 5;
|
||||||
size_t sample_phase = 0;
|
size_t sample_phase = 0;
|
||||||
|
@ -154,13 +154,7 @@ const Calibration default_calibration();
|
|||||||
template<size_t N>
|
template<size_t N>
|
||||||
class Filter {
|
class Filter {
|
||||||
public:
|
public:
|
||||||
constexpr Filter(
|
constexpr Filter() = default;
|
||||||
) : history(),
|
|
||||||
history_history { 0 },
|
|
||||||
accumulator { 0 },
|
|
||||||
n { 0 }
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
history.fill(0);
|
history.fill(0);
|
||||||
@ -196,10 +190,10 @@ public:
|
|||||||
private:
|
private:
|
||||||
static constexpr uint32_t history_history_mask { (1U << N) - 1 };
|
static constexpr uint32_t history_history_mask { (1U << N) - 1 };
|
||||||
|
|
||||||
std::array<sample_t, N> history;
|
std::array<sample_t, N> history { };
|
||||||
uint32_t history_history;
|
uint32_t history_history { 0 };
|
||||||
uint32_t accumulator;
|
uint32_t accumulator { 0 };
|
||||||
size_t n;
|
size_t n { 0 };
|
||||||
|
|
||||||
bool history_valid() const {
|
bool history_valid() const {
|
||||||
return (history_history & history_history_mask) == history_history_mask;
|
return (history_history & history_history_mask) == history_history_mask;
|
||||||
@ -208,7 +202,7 @@ private:
|
|||||||
|
|
||||||
class Manager {
|
class Manager {
|
||||||
public:
|
public:
|
||||||
std::function<void(ui::TouchEvent)> on_event;
|
std::function<void(ui::TouchEvent)> on_event { };
|
||||||
|
|
||||||
void feed(const Frame& frame);
|
void feed(const Frame& frame);
|
||||||
|
|
||||||
@ -224,8 +218,8 @@ private:
|
|||||||
|
|
||||||
// Ensure filter length is equal or less than touch_count_threshold,
|
// Ensure filter length is equal or less than touch_count_threshold,
|
||||||
// or coordinates from the last touch will be in the initial averages.
|
// or coordinates from the last touch will be in the initial averages.
|
||||||
Filter<touch_count_threshold> filter_x;
|
Filter<touch_count_threshold> filter_x { };
|
||||||
Filter<touch_count_threshold> filter_y;
|
Filter<touch_count_threshold> filter_y { };
|
||||||
|
|
||||||
//Debounce touch_debounce;
|
//Debounce touch_debounce;
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ struct TPMSRecentEntry {
|
|||||||
|
|
||||||
size_t received_count { 0 };
|
size_t received_count { 0 };
|
||||||
|
|
||||||
Optional<Pressure> last_pressure;
|
Optional<Pressure> last_pressure { };
|
||||||
Optional<Temperature> last_temperature;
|
Optional<Temperature> last_temperature { };
|
||||||
Optional<tpms::Flags> last_flags;
|
Optional<tpms::Flags> last_flags { };
|
||||||
|
|
||||||
TPMSRecentEntry(
|
TPMSRecentEntry(
|
||||||
const Key& key
|
const Key& key
|
||||||
@ -83,7 +83,7 @@ public:
|
|||||||
void on_packet(const tpms::Packet& packet, const uint32_t target_frequency);
|
void on_packet(const tpms::Packet& packet, const uint32_t target_frequency);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LogFile log_file;
|
LogFile log_file { };
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
@ -150,8 +150,8 @@ private:
|
|||||||
{ 18 * 8, 0 * 16 }
|
{ 18 * 8, 0 * 16 }
|
||||||
};
|
};
|
||||||
|
|
||||||
TPMSRecentEntries recent;
|
TPMSRecentEntries recent { };
|
||||||
std::unique_ptr<TPMSLogger> logger;
|
std::unique_ptr<TPMSLogger> logger { };
|
||||||
|
|
||||||
const RecentEntriesColumns columns { {
|
const RecentEntriesColumns columns { {
|
||||||
{ "Tp", 2 },
|
{ "Tp", 2 },
|
||||||
|
@ -193,7 +193,7 @@ public:
|
|||||||
void focus();
|
void focus();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Text text_title;
|
Text text_title { };
|
||||||
|
|
||||||
RegistersWidget registers_widget;
|
RegistersWidget registers_widget;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ private:
|
|||||||
|
|
||||||
class MenuView : public View {
|
class MenuView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(void)> on_left;
|
std::function<void(void)> on_left { };
|
||||||
|
|
||||||
MenuView() {
|
MenuView() {
|
||||||
set_focusable(true);
|
set_focusable(true);
|
||||||
|
@ -41,7 +41,7 @@ namespace ui {
|
|||||||
|
|
||||||
class SystemStatusView : public View {
|
class SystemStatusView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(void)> on_back;
|
std::function<void(void)> on_back { };
|
||||||
|
|
||||||
SystemStatusView();
|
SystemStatusView();
|
||||||
|
|
||||||
@ -86,9 +86,9 @@ private:
|
|||||||
|
|
||||||
class NavigationView : public View {
|
class NavigationView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(const View&)> on_view_changed;
|
std::function<void(const View&)> on_view_changed { };
|
||||||
|
|
||||||
NavigationView() { }
|
NavigationView() = default;
|
||||||
|
|
||||||
NavigationView(const NavigationView&) = delete;
|
NavigationView(const NavigationView&) = delete;
|
||||||
NavigationView(NavigationView&&) = delete;
|
NavigationView(NavigationView&&) = delete;
|
||||||
@ -107,7 +107,7 @@ public:
|
|||||||
void focus() override;
|
void focus() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<View>> view_stack;
|
std::vector<std::unique_ptr<View>> view_stack { };
|
||||||
Widget* modal_view { nullptr };
|
Widget* modal_view { nullptr };
|
||||||
|
|
||||||
Widget* view() const;
|
Widget* view() const;
|
||||||
@ -142,8 +142,8 @@ public:
|
|||||||
Context& context() const override;
|
Context& context() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SystemStatusView status_view;
|
SystemStatusView status_view { };
|
||||||
NavigationView navigation_view;
|
NavigationView navigation_view { };
|
||||||
Context& context_;
|
Context& context_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ namespace ui {
|
|||||||
|
|
||||||
class FrequencyField : public Widget {
|
class FrequencyField : public Widget {
|
||||||
public:
|
public:
|
||||||
std::function<void(rf::Frequency)> on_change;
|
std::function<void(rf::Frequency)> on_change { };
|
||||||
std::function<void(void)> on_edit;
|
std::function<void(void)> on_edit { };
|
||||||
std::function<void(void)> on_show_options;
|
std::function<void(void)> on_show_options { };
|
||||||
|
|
||||||
using range_t = rf::FrequencyRange;
|
using range_t = rf::FrequencyRange;
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
const size_t length_;
|
const size_t length_;
|
||||||
const range_t range;
|
const range_t range;
|
||||||
rf::Frequency value_;
|
rf::Frequency value_ { 0 };
|
||||||
rf::Frequency step { 25000 };
|
rf::Frequency step { 25000 };
|
||||||
|
|
||||||
rf::Frequency clamp_value(rf::Frequency value);
|
rf::Frequency clamp_value(rf::Frequency value);
|
||||||
@ -135,8 +135,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
using array_type = std::array<char, N>;
|
using array_type = std::array<char, N>;
|
||||||
|
|
||||||
array_type s;
|
array_type s { };
|
||||||
Justify justify;
|
Justify justify { Justify::Left };
|
||||||
|
|
||||||
template<typename Iterator>
|
template<typename Iterator>
|
||||||
void remove_zeros(Iterator begin, Iterator end) {
|
void remove_zeros(Iterator begin, Iterator end) {
|
||||||
@ -174,7 +174,7 @@ private:
|
|||||||
|
|
||||||
class FrequencyKeypadView : public View {
|
class FrequencyKeypadView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(rf::Frequency)> on_changed;
|
std::function<void(rf::Frequency)> on_changed { };
|
||||||
|
|
||||||
FrequencyKeypadView(
|
FrequencyKeypadView(
|
||||||
NavigationView& nav,
|
NavigationView& nav,
|
||||||
@ -201,7 +201,7 @@ private:
|
|||||||
{ 0, 0, text_digits * button_w, button_h }
|
{ 0, 0, text_digits * button_w, button_h }
|
||||||
};
|
};
|
||||||
|
|
||||||
std::array<Button, 12> buttons;
|
std::array<Button, 12> buttons { };
|
||||||
|
|
||||||
Button button_close {
|
Button button_close {
|
||||||
{ 0, button_h * 4 + button_h, button_w * 3, button_h },
|
{ 0, button_h * 4 + button_h, button_w * 3, button_h },
|
||||||
@ -257,8 +257,8 @@ public:
|
|||||||
|
|
||||||
class FrequencyOptionsView : public View {
|
class FrequencyOptionsView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(rf::Frequency)> on_change_step;
|
std::function<void(rf::Frequency)> on_change_step { };
|
||||||
std::function<void(int32_t)> on_change_reference_ppm_correction;
|
std::function<void(int32_t)> on_change_reference_ppm_correction { };
|
||||||
|
|
||||||
FrequencyOptionsView(const Rect parent_rect, const Style* const style);
|
FrequencyOptionsView(const Rect parent_rect, const Style* const style);
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ private:
|
|||||||
|
|
||||||
class LNAGainField : public NumberField {
|
class LNAGainField : public NumberField {
|
||||||
public:
|
public:
|
||||||
std::function<void(void)> on_show_options;
|
std::function<void(void)> on_show_options { };
|
||||||
|
|
||||||
LNAGainField(Point parent_pos);
|
LNAGainField(Point parent_pos);
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ public:
|
|||||||
|
|
||||||
class VGAGainField : public NumberField {
|
class VGAGainField : public NumberField {
|
||||||
public:
|
public:
|
||||||
std::function<void(void)> on_show_options;
|
std::function<void(void)> on_show_options { };
|
||||||
|
|
||||||
VGAGainField(Point parent_pos);
|
VGAGainField(Point parent_pos);
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ public:
|
|||||||
|
|
||||||
class TXGainField : public NumberField {
|
class TXGainField : public NumberField {
|
||||||
public:
|
public:
|
||||||
std::function<void(void)> on_show_options;
|
std::function<void(void)> on_show_options { };
|
||||||
|
|
||||||
TXGainField(Point parent_pos);
|
TXGainField(Point parent_pos);
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace ui {
|
|||||||
|
|
||||||
class RecordView : public View {
|
class RecordView : public View {
|
||||||
public:
|
public:
|
||||||
std::function<void(std::string)> on_error;
|
std::function<void(std::string)> on_error { };
|
||||||
|
|
||||||
enum FileType {
|
enum FileType {
|
||||||
RawS16 = 2,
|
RawS16 = 2,
|
||||||
@ -77,7 +77,7 @@ private:
|
|||||||
const size_t write_size;
|
const size_t write_size;
|
||||||
const size_t buffer_count;
|
const size_t buffer_count;
|
||||||
size_t sampling_rate { 0 };
|
size_t sampling_rate { 0 };
|
||||||
SignalToken signal_token_tick_second;
|
SignalToken signal_token_tick_second { };
|
||||||
|
|
||||||
Rectangle rect_background {
|
Rectangle rect_background {
|
||||||
Color::black()
|
Color::black()
|
||||||
@ -105,7 +105,7 @@ private:
|
|||||||
"",
|
"",
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<CaptureThread> capture_thread;
|
std::unique_ptr<CaptureThread> capture_thread { };
|
||||||
|
|
||||||
MessageHandlerRegistration message_handler_capture_thread_error {
|
MessageHandlerRegistration message_handler_capture_thread_error {
|
||||||
Message::ID::CaptureThreadDone,
|
Message::ID::CaptureThreadDone,
|
||||||
|
@ -86,7 +86,7 @@ private:
|
|||||||
|
|
||||||
static Thread* thread;
|
static Thread* thread;
|
||||||
volatile Result _result { Result::Incomplete };
|
volatile Result _result { Result::Incomplete };
|
||||||
Stats _stats;
|
Stats _stats { };
|
||||||
|
|
||||||
static msg_t static_fn(void* arg) {
|
static msg_t static_fn(void* arg) {
|
||||||
auto obj = static_cast<SDCardTestThread*>(arg);
|
auto obj = static_cast<SDCardTestThread*>(arg);
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
void focus() override;
|
void focus() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SignalToken sd_card_status_signal_token;
|
SignalToken sd_card_status_signal_token { };
|
||||||
|
|
||||||
void on_status(const sd_card::Status status);
|
void on_status(const sd_card::Status status);
|
||||||
void on_test();
|
void on_test();
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
void paint(Painter& painter) override;
|
void paint(Painter& painter) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SignalToken sd_card_status_signal_token;
|
SignalToken sd_card_status_signal_token { };
|
||||||
|
|
||||||
void on_status(const sd_card::Status status);
|
void on_status(const sd_card::Status status);
|
||||||
};
|
};
|
||||||
|
@ -84,8 +84,8 @@ public:
|
|||||||
void paint(Painter& painter) override;
|
void paint(Painter& painter) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WaterfallView waterfall_view;
|
WaterfallView waterfall_view { };
|
||||||
FrequencyScale frequency_scale;
|
FrequencyScale frequency_scale { };
|
||||||
ChannelSpectrumFIFO* fifo { nullptr };
|
ChannelSpectrumFIFO* fifo { nullptr };
|
||||||
|
|
||||||
MessageHandlerRegistration message_handler_spectrum_config {
|
MessageHandlerRegistration message_handler_spectrum_config {
|
||||||
|
@ -65,9 +65,9 @@ private:
|
|||||||
|
|
||||||
uint32_t samples_count { 0 };
|
uint32_t samples_count { 0 };
|
||||||
|
|
||||||
touch::DigitizerPoint average;
|
touch::DigitizerPoint average { };
|
||||||
|
|
||||||
std::array<touch::DigitizerPoint, 3> digitizer_points;
|
std::array<touch::DigitizerPoint, 3> digitizer_points { };
|
||||||
|
|
||||||
touch::Calibration calibration;
|
touch::Calibration calibration;
|
||||||
|
|
||||||
|
@ -55,13 +55,13 @@ private:
|
|||||||
|
|
||||||
BlockDecimator<float, 32> block_buffer { 1 };
|
BlockDecimator<float, 32> block_buffer { 1 };
|
||||||
|
|
||||||
IIRBiquadFilter hpf;
|
IIRBiquadFilter hpf { };
|
||||||
IIRBiquadFilter deemph;
|
IIRBiquadFilter deemph { };
|
||||||
FMSquelch squelch;
|
FMSquelch squelch { };
|
||||||
|
|
||||||
std::unique_ptr<StreamInput> stream;
|
std::unique_ptr<StreamInput> stream { };
|
||||||
|
|
||||||
AudioStatsCollector audio_stats;
|
AudioStatsCollector audio_stats { };
|
||||||
|
|
||||||
uint64_t audio_present_history = 0;
|
uint64_t audio_present_history = 0;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ private:
|
|||||||
float max_squared { 0 };
|
float max_squared { 0 };
|
||||||
size_t count { 0 };
|
size_t count { 0 };
|
||||||
|
|
||||||
AudioStatistics statistics;
|
AudioStatistics statistics { };
|
||||||
|
|
||||||
void consume_audio_buffer(const buffer_f32_t& src);
|
void consume_audio_buffer(const buffer_f32_t& src);
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ protected:
|
|||||||
void feed_channel_stats(const buffer_c16_t& channel);
|
void feed_channel_stats(const buffer_c16_t& channel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChannelStatsCollector channel_stats;
|
ChannelStatsCollector channel_stats { };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif/*__BASEBAND_PROCESSOR_H__*/
|
#endif/*__BASEBAND_PROCESSOR_H__*/
|
||||||
|
@ -48,8 +48,8 @@ private:
|
|||||||
static Thread* thread;
|
static Thread* thread;
|
||||||
|
|
||||||
BasebandProcessor* baseband_processor { nullptr };
|
BasebandProcessor* baseband_processor { nullptr };
|
||||||
baseband::Direction _direction;
|
baseband::Direction _direction { baseband::Direction::Receive };
|
||||||
uint32_t sampling_rate;
|
uint32_t sampling_rate { 0 };
|
||||||
|
|
||||||
void run() override;
|
void run() override;
|
||||||
};
|
};
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<T, N> buffer;
|
std::array<T, N> buffer { };
|
||||||
uint32_t input_sampling_rate_ { 0 };
|
uint32_t input_sampling_rate_ { 0 };
|
||||||
size_t factor_ { 1 };
|
size_t factor_ { 1 };
|
||||||
size_t src_i { 0 };
|
size_t src_i { 0 };
|
||||||
|
@ -38,12 +38,6 @@ public:
|
|||||||
By16,
|
By16,
|
||||||
By32,
|
By32,
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr ChannelDecimator(
|
|
||||||
) : decimation_factor { DecimationFactor::By32 },
|
|
||||||
fs_over_4_downconvert { true }
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr ChannelDecimator(
|
constexpr ChannelDecimator(
|
||||||
const DecimationFactor decimation_factor,
|
const DecimationFactor decimation_factor,
|
||||||
@ -64,17 +58,17 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<complex16_t, 1024> work_baseband;
|
std::array<complex16_t, 1024> work_baseband { };
|
||||||
|
|
||||||
dsp::decimate::TranslateByFSOver4AndDecimateBy2CIC3 translate;
|
dsp::decimate::TranslateByFSOver4AndDecimateBy2CIC3 translate { };
|
||||||
dsp::decimate::Complex8DecimateBy2CIC3 cic_0;
|
dsp::decimate::Complex8DecimateBy2CIC3 cic_0 { };
|
||||||
dsp::decimate::DecimateBy2CIC3 cic_1;
|
dsp::decimate::DecimateBy2CIC3 cic_1 { };
|
||||||
dsp::decimate::DecimateBy2CIC3 cic_2;
|
dsp::decimate::DecimateBy2CIC3 cic_2 { };
|
||||||
dsp::decimate::DecimateBy2CIC3 cic_3;
|
dsp::decimate::DecimateBy2CIC3 cic_3 { };
|
||||||
dsp::decimate::DecimateBy2CIC3 cic_4;
|
dsp::decimate::DecimateBy2CIC3 cic_4 { };
|
||||||
|
|
||||||
DecimationFactor decimation_factor;
|
DecimationFactor decimation_factor { DecimationFactor::By32 };
|
||||||
const bool fs_over_4_downconvert;
|
const bool fs_over_4_downconvert { true };
|
||||||
|
|
||||||
buffer_c16_t execute_decimation(const buffer_c8_t& buffer);
|
buffer_c16_t execute_decimation(const buffer_c8_t& buffer);
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<float, 3> t { { 0.0f, 0.0f, 0.0f } };
|
std::array<float, 3> t { };
|
||||||
size_t symbol_phase { 0 };
|
size_t symbol_phase { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -154,9 +154,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
dsp::interpolation::LinearResampler resampler;
|
dsp::interpolation::LinearResampler resampler { };
|
||||||
GardnerTimingErrorDetector timing_error_detector;
|
GardnerTimingErrorDetector timing_error_detector { };
|
||||||
ErrorFilter error_filter;
|
ErrorFilter error_filter { };
|
||||||
const SymbolHandler symbol_handler;
|
const SymbolHandler symbol_handler;
|
||||||
|
|
||||||
void resampler_callback(const float interpolated_sample) {
|
void resampler_callback(const float interpolated_sample) {
|
||||||
|
@ -86,8 +86,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<int16_t, taps_count + 2> z;
|
std::array<int16_t, taps_count + 2> z { };
|
||||||
std::array<int16_t, taps_count> taps;
|
std::array<int16_t, taps_count> taps { };
|
||||||
};
|
};
|
||||||
|
|
||||||
class FIRC8xR16x24FS4Decim4 {
|
class FIRC8xR16x24FS4Decim4 {
|
||||||
@ -115,8 +115,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<vec2_s16, taps_count - decimation_factor> z_;
|
std::array<vec2_s16, taps_count - decimation_factor> z_ { };
|
||||||
std::array<tap_t, taps_count> taps_;
|
std::array<tap_t, taps_count> taps_ { };
|
||||||
int32_t output_scale = 0;
|
int32_t output_scale = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -145,8 +145,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<vec2_s16, taps_count - decimation_factor> z_;
|
std::array<vec2_s16, taps_count - decimation_factor> z_ { };
|
||||||
std::array<tap_t, taps_count> taps_;
|
std::array<tap_t, taps_count> taps_ { };
|
||||||
int32_t output_scale = 0;
|
int32_t output_scale = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -169,8 +169,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<vec2_s16, taps_count - decimation_factor> z_;
|
std::array<vec2_s16, taps_count - decimation_factor> z_ { };
|
||||||
std::array<tap_t, taps_count> taps_;
|
std::array<tap_t, taps_count> taps_ { };
|
||||||
int32_t output_scale = 0;
|
int32_t output_scale = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -193,8 +193,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::array<vec2_s16, taps_count - decimation_factor> z_;
|
std::array<vec2_s16, taps_count - decimation_factor> z_ { };
|
||||||
std::array<tap_t, taps_count> taps_;
|
std::array<tap_t, taps_count> taps_ { };
|
||||||
int32_t output_scale = 0;
|
int32_t output_scale = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -208,11 +208,6 @@ public:
|
|||||||
/* NOTE! Current code makes an assumption that block of samples to be
|
/* NOTE! Current code makes an assumption that block of samples to be
|
||||||
* processed will be a multiple of the taps_count.
|
* processed will be a multiple of the taps_count.
|
||||||
*/
|
*/
|
||||||
FIRAndDecimateComplex(
|
|
||||||
) : taps_count_ { 0 },
|
|
||||||
decimation_factor_ { 1 }
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void configure(
|
void configure(
|
||||||
@ -230,10 +225,10 @@ public:
|
|||||||
private:
|
private:
|
||||||
using samples_t = sample_t[];
|
using samples_t = sample_t[];
|
||||||
|
|
||||||
std::unique_ptr<samples_t> samples_;
|
std::unique_ptr<samples_t> samples_ { };
|
||||||
std::unique_ptr<taps_t> taps_reversed_;
|
std::unique_ptr<taps_t> taps_reversed_ { };
|
||||||
size_t taps_count_;
|
size_t taps_count_ { 0 };
|
||||||
size_t decimation_factor_;
|
size_t decimation_factor_ { 1 };
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void configure(
|
void configure(
|
||||||
@ -259,7 +254,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int16_t z[5];
|
int16_t z[5] { };
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace decimate */
|
} /* namespace decimate */
|
||||||
|
@ -66,8 +66,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
using samples_t = sample_t[];
|
using samples_t = sample_t[];
|
||||||
|
|
||||||
std::unique_ptr<samples_t> samples_;
|
std::unique_ptr<samples_t> samples_ { };
|
||||||
std::unique_ptr<taps_t> taps_reversed_;
|
std::unique_ptr<taps_t> taps_reversed_ { };
|
||||||
size_t taps_count_ { 0 };
|
size_t taps_count_ { 0 };
|
||||||
size_t decimation_factor_ { 1 };
|
size_t decimation_factor_ { 1 };
|
||||||
size_t decimation_phase { 0 };
|
size_t decimation_phase { 0 };
|
||||||
|
@ -122,13 +122,13 @@ private:
|
|||||||
|
|
||||||
const PayloadHandlerFunc payload_handler;
|
const PayloadHandlerFunc payload_handler;
|
||||||
|
|
||||||
BitHistory bit_history;
|
BitHistory bit_history { };
|
||||||
PreambleMatcher preamble;
|
PreambleMatcher preamble { };
|
||||||
UnstuffMatcher unstuff;
|
UnstuffMatcher unstuff { };
|
||||||
EndMatcher end;
|
EndMatcher end { };
|
||||||
|
|
||||||
State state { State::Preamble };
|
State state { State::Preamble };
|
||||||
baseband::Packet packet;
|
baseband::Packet packet { };
|
||||||
|
|
||||||
void reset_state() {
|
void reset_state() {
|
||||||
packet.clear();
|
packet.clear();
|
||||||
|
@ -54,21 +54,21 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
std::array<complex16_t, 512> dst;
|
std::array<complex16_t, 512> dst { };
|
||||||
const buffer_c16_t dst_buffer {
|
const buffer_c16_t dst_buffer {
|
||||||
dst.data(),
|
dst.data(),
|
||||||
dst.size()
|
dst.size()
|
||||||
};
|
};
|
||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0;
|
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1;
|
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
||||||
dsp::matched_filter::MatchedFilter mf { baseband::ais::square_taps_38k4_1t_p, 2 };
|
dsp::matched_filter::MatchedFilter mf { baseband::ais::square_taps_38k4_1t_p, 2 };
|
||||||
|
|
||||||
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery {
|
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery {
|
||||||
19200, 9600, { 0.0555f },
|
19200, 9600, { 0.0555f },
|
||||||
[this](const float symbol) { this->consume_symbol(symbol); }
|
[this](const float symbol) { this->consume_symbol(symbol); }
|
||||||
};
|
};
|
||||||
symbol_coding::NRZIDecoder nrzi_decode;
|
symbol_coding::NRZIDecoder nrzi_decode { };
|
||||||
PacketBuilder<BitPattern, BitPattern, BitPattern> packet_builder {
|
PacketBuilder<BitPattern, BitPattern, BitPattern> packet_builder {
|
||||||
{ 0b0101010101111110, 16, 1 },
|
{ 0b0101010101111110, 16, 1 },
|
||||||
{ 0b111110, 6 },
|
{ 0b111110, 6 },
|
||||||
|
@ -49,31 +49,31 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
std::array<complex16_t, 512> dst;
|
std::array<complex16_t, 512> dst { };
|
||||||
const buffer_c16_t dst_buffer {
|
const buffer_c16_t dst_buffer {
|
||||||
dst.data(),
|
dst.data(),
|
||||||
dst.size()
|
dst.size()
|
||||||
};
|
};
|
||||||
std::array<float, 32> audio;
|
std::array<float, 32> audio { };
|
||||||
const buffer_f32_t audio_buffer {
|
const buffer_f32_t audio_buffer {
|
||||||
audio.data(),
|
audio.data(),
|
||||||
audio.size()
|
audio.size()
|
||||||
};
|
};
|
||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0;
|
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1;
|
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
||||||
dsp::decimate::FIRAndDecimateComplex decim_2;
|
dsp::decimate::FIRAndDecimateComplex decim_2 { };
|
||||||
dsp::decimate::FIRAndDecimateComplex channel_filter;
|
dsp::decimate::FIRAndDecimateComplex channel_filter { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
uint32_t channel_filter_pass_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
uint32_t channel_filter_stop_f = 0;
|
||||||
|
|
||||||
bool modulation_ssb = false;
|
bool modulation_ssb = false;
|
||||||
dsp::demodulate::AM demod_am;
|
dsp::demodulate::AM demod_am { };
|
||||||
dsp::demodulate::SSB demod_ssb;
|
dsp::demodulate::SSB demod_ssb { };
|
||||||
FeedForwardCompressor audio_compressor;
|
FeedForwardCompressor audio_compressor { };
|
||||||
AudioOutput audio_output;
|
AudioOutput audio_output { };
|
||||||
|
|
||||||
SpectrumCollector channel_spectrum;
|
SpectrumCollector channel_spectrum { };
|
||||||
|
|
||||||
bool configured { false };
|
bool configured { false };
|
||||||
void configure(const AMConfigureMessage& message);
|
void configure(const AMConfigureMessage& message);
|
||||||
|
@ -51,20 +51,20 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
std::array<complex16_t, 512> dst;
|
std::array<complex16_t, 512> dst { };
|
||||||
const buffer_c16_t dst_buffer {
|
const buffer_c16_t dst_buffer {
|
||||||
dst.data(),
|
dst.data(),
|
||||||
dst.size()
|
dst.size()
|
||||||
};
|
};
|
||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0;
|
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x16Decim2 decim_1;
|
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
uint32_t channel_filter_pass_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
uint32_t channel_filter_stop_f = 0;
|
||||||
|
|
||||||
std::unique_ptr<StreamInput> stream;
|
std::unique_ptr<StreamInput> stream { };
|
||||||
|
|
||||||
SpectrumCollector channel_spectrum;
|
SpectrumCollector channel_spectrum { };
|
||||||
size_t spectrum_interval_samples = 0;
|
size_t spectrum_interval_samples = 0;
|
||||||
size_t spectrum_samples = 0;
|
size_t spectrum_samples = 0;
|
||||||
|
|
||||||
|
@ -46,28 +46,28 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
std::array<complex16_t, 512> dst;
|
std::array<complex16_t, 512> dst { };
|
||||||
const buffer_c16_t dst_buffer {
|
const buffer_c16_t dst_buffer {
|
||||||
dst.data(),
|
dst.data(),
|
||||||
dst.size()
|
dst.size()
|
||||||
};
|
};
|
||||||
std::array<float, 32> audio;
|
std::array<float, 32> audio { };
|
||||||
const buffer_f32_t audio_buffer {
|
const buffer_f32_t audio_buffer {
|
||||||
audio.data(),
|
audio.data(),
|
||||||
audio.size()
|
audio.size()
|
||||||
};
|
};
|
||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0;
|
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1;
|
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
||||||
dsp::decimate::FIRAndDecimateComplex channel_filter;
|
dsp::decimate::FIRAndDecimateComplex channel_filter { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
uint32_t channel_filter_pass_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
uint32_t channel_filter_stop_f = 0;
|
||||||
|
|
||||||
dsp::demodulate::FM demod;
|
dsp::demodulate::FM demod { };
|
||||||
|
|
||||||
AudioOutput audio_output;
|
AudioOutput audio_output { };
|
||||||
|
|
||||||
SpectrumCollector channel_spectrum;
|
SpectrumCollector channel_spectrum { };
|
||||||
|
|
||||||
bool configured { false };
|
bool configured { false };
|
||||||
void configure(const NBFMConfigureMessage& message);
|
void configure(const NBFMConfigureMessage& message);
|
||||||
|
@ -69,14 +69,14 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
std::array<complex16_t, 512> dst;
|
std::array<complex16_t, 512> dst { };
|
||||||
const buffer_c16_t dst_buffer {
|
const buffer_c16_t dst_buffer {
|
||||||
dst.data(),
|
dst.data(),
|
||||||
dst.size()
|
dst.size()
|
||||||
};
|
};
|
||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0;
|
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x16Decim2 decim_1;
|
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
||||||
|
|
||||||
dsp::matched_filter::MatchedFilter mf_38k4_1t_19k2 { rect_taps_307k2_38k4_1t_19k2_p, 8 };
|
dsp::matched_filter::MatchedFilter mf_38k4_1t_19k2 { rect_taps_307k2_38k4_1t_19k2_p, 8 };
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
std::array<complex16_t, 512> dst;
|
std::array<complex16_t, 512> dst { };
|
||||||
const buffer_c16_t dst_buffer {
|
const buffer_c16_t dst_buffer {
|
||||||
dst.data(),
|
dst.data(),
|
||||||
dst.size()
|
dst.size()
|
||||||
@ -55,19 +55,19 @@ private:
|
|||||||
sizeof(dst) / sizeof(int16_t)
|
sizeof(dst) / sizeof(int16_t)
|
||||||
};
|
};
|
||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0;
|
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x16Decim2 decim_1;
|
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
uint32_t channel_filter_pass_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
uint32_t channel_filter_stop_f = 0;
|
||||||
|
|
||||||
dsp::demodulate::FM demod;
|
dsp::demodulate::FM demod { };
|
||||||
dsp::decimate::DecimateBy2CIC4Real audio_dec_1;
|
dsp::decimate::DecimateBy2CIC4Real audio_dec_1 { };
|
||||||
dsp::decimate::DecimateBy2CIC4Real audio_dec_2;
|
dsp::decimate::DecimateBy2CIC4Real audio_dec_2 { };
|
||||||
dsp::decimate::FIR64AndDecimateBy2Real audio_filter;
|
dsp::decimate::FIR64AndDecimateBy2Real audio_filter { };
|
||||||
|
|
||||||
AudioOutput audio_output;
|
AudioOutput audio_output { };
|
||||||
|
|
||||||
SpectrumCollector channel_spectrum;
|
SpectrumCollector channel_spectrum { };
|
||||||
size_t spectrum_interval_samples = 0;
|
size_t spectrum_interval_samples = 0;
|
||||||
size_t spectrum_samples = 0;
|
size_t spectrum_samples = 0;
|
||||||
|
|
||||||
|
@ -46,9 +46,9 @@ private:
|
|||||||
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
|
||||||
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
RSSIThread rssi_thread { NORMALPRIO + 10 };
|
||||||
|
|
||||||
SpectrumCollector channel_spectrum;
|
SpectrumCollector channel_spectrum { };
|
||||||
|
|
||||||
std::array<complex16_t, 256> spectrum;
|
std::array<complex16_t, 256> spectrum { };
|
||||||
|
|
||||||
size_t phase = 0;
|
size_t phase = 0;
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr float update_interval { 0.1f };
|
static constexpr float update_interval { 0.1f };
|
||||||
RSSIStatistics statistics;
|
RSSIStatistics statistics { };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif/*__RSSI_STATS_COLLECTOR_H__*/
|
#endif/*__RSSI_STATS_COLLECTOR_H__*/
|
||||||
|
@ -34,12 +34,6 @@
|
|||||||
|
|
||||||
class SpectrumCollector {
|
class SpectrumCollector {
|
||||||
public:
|
public:
|
||||||
constexpr SpectrumCollector(
|
|
||||||
) : channel_spectrum_decimator { 1 },
|
|
||||||
fifo { fifo_data, ChannelSpectrumConfigMessage::fifo_k }
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_message(const Message* const message);
|
void on_message(const Message* const message);
|
||||||
|
|
||||||
void set_decimation_factor(const size_t decimation_factor);
|
void set_decimation_factor(const size_t decimation_factor);
|
||||||
@ -51,13 +45,13 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BlockDecimator<complex16_t, 256> channel_spectrum_decimator;
|
BlockDecimator<complex16_t, 256> channel_spectrum_decimator { 1 };
|
||||||
ChannelSpectrumFIFO fifo;
|
ChannelSpectrum fifo_data[1 << ChannelSpectrumConfigMessage::fifo_k] { };
|
||||||
ChannelSpectrum fifo_data[1 << ChannelSpectrumConfigMessage::fifo_k];
|
ChannelSpectrumFIFO fifo { fifo_data, ChannelSpectrumConfigMessage::fifo_k };
|
||||||
|
|
||||||
volatile bool channel_spectrum_request_update { false };
|
volatile bool channel_spectrum_request_update { false };
|
||||||
bool streaming { false };
|
bool streaming { false };
|
||||||
std::array<std::complex<float>, 256> channel_spectrum;
|
std::array<std::complex<float>, 256> channel_spectrum { };
|
||||||
uint32_t channel_spectrum_sampling_rate { 0 };
|
uint32_t channel_spectrum_sampling_rate { 0 };
|
||||||
uint32_t channel_filter_pass_frequency { 0 };
|
uint32_t channel_filter_pass_frequency { 0 };
|
||||||
uint32_t channel_filter_stop_frequency { 0 };
|
uint32_t channel_filter_stop_frequency { 0 };
|
||||||
|
@ -42,12 +42,12 @@ private:
|
|||||||
|
|
||||||
FIFO<StreamBuffer*> fifo_buffers_empty;
|
FIFO<StreamBuffer*> fifo_buffers_empty;
|
||||||
FIFO<StreamBuffer*> fifo_buffers_full;
|
FIFO<StreamBuffer*> fifo_buffers_full;
|
||||||
std::array<StreamBuffer, buffer_count_max> buffers;
|
std::array<StreamBuffer, buffer_count_max> buffers { };
|
||||||
std::array<StreamBuffer*, buffer_count_max> buffers_empty;
|
std::array<StreamBuffer*, buffer_count_max> buffers_empty { };
|
||||||
std::array<StreamBuffer*, buffer_count_max> buffers_full;
|
std::array<StreamBuffer*, buffer_count_max> buffers_full { };
|
||||||
StreamBuffer* active_buffer { nullptr };
|
StreamBuffer* active_buffer { nullptr };
|
||||||
CaptureConfig* const config { nullptr };
|
CaptureConfig* const config { nullptr };
|
||||||
std::unique_ptr<uint8_t[]> data;
|
std::unique_ptr<uint8_t[]> data { };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif/*__STREAM_INPUT_H__*/
|
#endif/*__STREAM_INPUT_H__*/
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::bitset<1408> data;
|
std::bitset<1408> data { };
|
||||||
Timestamp timestamp_ { };
|
Timestamp timestamp_ { };
|
||||||
size_t count { 0 };
|
size_t count { 0 };
|
||||||
};
|
};
|
||||||
|
@ -68,9 +68,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
CaptureConfig* const config;
|
CaptureConfig* const config;
|
||||||
FIFO<StreamBuffer*>* fifo_buffers_for_baseband;
|
FIFO<StreamBuffer*>* fifo_buffers_for_baseband { nullptr };
|
||||||
FIFO<StreamBuffer*>* fifo_buffers_for_application;
|
FIFO<StreamBuffer*>* fifo_buffers_for_application { nullptr };
|
||||||
Thread* thread;
|
Thread* thread { nullptr };
|
||||||
static BufferExchange* obj;
|
static BufferExchange* obj;
|
||||||
|
|
||||||
void check_fifo_isr() {
|
void check_fifo_isr() {
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
FIFO<uint8_t> fifo;
|
FIFO<uint8_t> fifo;
|
||||||
Mutex mutex_write;
|
Mutex mutex_write { };
|
||||||
|
|
||||||
Message* peek(std::array<uint8_t, Message::MAX_SIZE>& buf) {
|
Message* peek(std::array<uint8_t, Message::MAX_SIZE>& buf) {
|
||||||
Message* const p = reinterpret_cast<Message*>(buf.data());
|
Message* const p = reinterpret_cast<Message*>(buf.data());
|
||||||
|
@ -44,10 +44,10 @@ private:
|
|||||||
static constexpr int width { 240 };
|
static constexpr int width { 240 };
|
||||||
static constexpr int height { 320 };
|
static constexpr int height { 320 };
|
||||||
|
|
||||||
File file;
|
File file { };
|
||||||
int scanline_count { 0 };
|
int scanline_count { 0 };
|
||||||
CRC<32, true, true> crc { 0x04c11db7, 0xffffffff, 0xffffffff };
|
CRC<32, true, true> crc { 0x04c11db7, 0xffffffff, 0xffffffff };
|
||||||
Adler32 adler_32;
|
Adler32 adler_32 { };
|
||||||
|
|
||||||
void write_chunk_header(const size_t length, const std::array<uint8_t, 4>& type);
|
void write_chunk_header(const size_t length, const std::array<uint8_t, 4>& type);
|
||||||
void write_chunk_content(const void* const p, const size_t count);
|
void write_chunk_content(const void* const p, const size_t count);
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FocusManager focus_manager_;
|
FocusManager focus_manager_ { };
|
||||||
};
|
};
|
||||||
|
|
||||||
class Widget {
|
class Widget {
|
||||||
@ -161,7 +161,7 @@ public:
|
|||||||
virtual std::string title() const;
|
virtual std::string title() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<Widget*> children_;
|
std::vector<Widget*> children_ { };
|
||||||
|
|
||||||
void invalidate_child(Widget* const widget);
|
void invalidate_child(Widget* const widget);
|
||||||
};
|
};
|
||||||
@ -198,7 +198,7 @@ private:
|
|||||||
|
|
||||||
class Button : public Widget {
|
class Button : public Widget {
|
||||||
public:
|
public:
|
||||||
std::function<void(Button&)> on_select;
|
std::function<void(Button&)> on_select { };
|
||||||
|
|
||||||
Button(Rect parent_rect, std::string text);
|
Button(Rect parent_rect, std::string text);
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ private:
|
|||||||
|
|
||||||
class ImageButton : public Image {
|
class ImageButton : public Image {
|
||||||
public:
|
public:
|
||||||
std::function<void(ImageButton&)> on_select;
|
std::function<void(ImageButton&)> on_select { };
|
||||||
|
|
||||||
ImageButton(
|
ImageButton(
|
||||||
const Rect parent_rect,
|
const Rect parent_rect,
|
||||||
@ -263,8 +263,8 @@ public:
|
|||||||
using option_t = std::pair<name_t, value_t>;
|
using option_t = std::pair<name_t, value_t>;
|
||||||
using options_t = std::vector<option_t>;
|
using options_t = std::vector<option_t>;
|
||||||
|
|
||||||
std::function<void(size_t, value_t)> on_change;
|
std::function<void(size_t, value_t)> on_change { };
|
||||||
std::function<void(void)> on_show_options;
|
std::function<void(void)> on_show_options { };
|
||||||
|
|
||||||
OptionsField(Point parent_pos, size_t length, options_t options);
|
OptionsField(Point parent_pos, size_t length, options_t options);
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ private:
|
|||||||
|
|
||||||
class NumberField : public Widget {
|
class NumberField : public Widget {
|
||||||
public:
|
public:
|
||||||
std::function<void(int32_t)> on_change;
|
std::function<void(int32_t)> on_change { };
|
||||||
|
|
||||||
using range_t = std::pair<int32_t, int32_t>;
|
using range_t = std::pair<int32_t, int32_t>;
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ private:
|
|||||||
const int32_t step;
|
const int32_t step;
|
||||||
const size_t length_;
|
const size_t length_;
|
||||||
const char fill_char;
|
const char fill_char;
|
||||||
int32_t value_;
|
int32_t value_ { 0 };
|
||||||
|
|
||||||
int32_t clip_value(int32_t value);
|
int32_t clip_value(int32_t value);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user