mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-04-18 06:56:03 -04:00
Name change...
This commit is contained in:
parent
aa9aa45342
commit
6bb83043b5
8
firmware/application/external/external.cmake
vendored
8
firmware/application/external/external.cmake
vendored
@ -204,9 +204,9 @@ set(EXTCPPSRC
|
||||
external/level/main.cpp
|
||||
external/level/ui_level.cpp
|
||||
|
||||
#rf3d
|
||||
external/rf3d/main.cpp
|
||||
external/rf3d/ui_rf3d.cpp
|
||||
#gfxEQ
|
||||
external/gfxeq/main.cpp
|
||||
external/gfxeq/ui_gfxeq.cpp
|
||||
)
|
||||
|
||||
set(EXTAPPLIST
|
||||
@ -259,5 +259,5 @@ set(EXTAPPLIST
|
||||
debug_pmem
|
||||
scanner
|
||||
level
|
||||
rf3d
|
||||
gfxeq
|
||||
)
|
||||
|
10
firmware/application/external/external.ld
vendored
10
firmware/application/external/external.ld
vendored
@ -72,7 +72,7 @@ MEMORY
|
||||
ram_external_app_debug_pmem (rwx) : org = 0xADDF0000, len = 32k
|
||||
ram_external_app_scanner (rwx) : org = 0xADE00000, len = 32k
|
||||
ram_external_app_level (rwx) : org = 0xADE10000, len = 32k
|
||||
ram_external_app_rf3d (rwx) : org = 0xADE20000, len = 32k
|
||||
ram_external_app_gfxeq (rwx) : org = 0xADE20000, len = 32k
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
@ -370,9 +370,9 @@ SECTIONS
|
||||
*(*ui*external_app*level*);
|
||||
} > ram_external_app_level
|
||||
|
||||
.external_app_rf3d : ALIGN(4) SUBALIGN(4)
|
||||
.external_app_gfxeq : ALIGN(4) SUBALIGN(4)
|
||||
{
|
||||
KEEP(*(.external_app.app_rf3d.application_information));
|
||||
*(*ui*external_app*rf3d*);
|
||||
} > ram_external_app_rf3d
|
||||
KEEP(*(.external_app.app_gfxeq.application_information));
|
||||
*(*ui*external_app*gfxeq*);
|
||||
} > ram_external_app_gfxeq
|
||||
}
|
||||
|
30
firmware/application/external/gfxeq/main.cpp
vendored
Normal file
30
firmware/application/external/gfxeq/main.cpp
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
#include "ui_gfxeq.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "external_app.hpp"
|
||||
|
||||
namespace ui::external_app::gfxeq {
|
||||
void initialize_app(ui::NavigationView& nav) {
|
||||
nav.push<gfxEQView>();
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
__attribute__((section(".external_app.app_gfxeq.application_information"), used)) application_information_t _application_information_gfxeq = {
|
||||
(uint8_t*)0x00000000,
|
||||
ui::external_app::gfxeq::initialize_app,
|
||||
CURRENT_HEADER_VERSION,
|
||||
VERSION_MD5,
|
||||
"gfxEQ",
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
||||
},
|
||||
ui::Color::green().v,
|
||||
app_location_t::RX,
|
||||
-1,
|
||||
{'P', 'N', 'F', 'M'},
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
} // namespace ui::external_app::gfxeq
|
@ -1,4 +1,4 @@
|
||||
#include "ui_rf3d.hpp"
|
||||
#include "ui_gfxeq.hpp"
|
||||
#include "ui.hpp"
|
||||
#include "ui_freqman.hpp"
|
||||
#include "tone_key.hpp"
|
||||
@ -8,9 +8,9 @@
|
||||
|
||||
using namespace portapack;
|
||||
|
||||
namespace ui::external_app::rf3d {
|
||||
namespace ui::external_app::gfxeq {
|
||||
|
||||
RF3DView::RF3DView(NavigationView& nav)
|
||||
gfxEQView::gfxEQView(NavigationView& nav)
|
||||
: nav_{nav}, bar_heights(NUM_BARS, 0), prev_bar_heights(NUM_BARS, 0) {
|
||||
baseband::run_image(spi_flash::image_tag_wfm_audio);
|
||||
add_children({&rssi, &channel, &audio, &field_frequency, &field_lna, &field_vga,
|
||||
@ -46,29 +46,29 @@ RF3DView::RF3DView(NavigationView& nav)
|
||||
audio::output::start();
|
||||
}
|
||||
|
||||
RF3DView::~RF3DView() {
|
||||
gfxEQView::~gfxEQView() {
|
||||
audio::output::stop();
|
||||
receiver_model.disable();
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void RF3DView::focus() {
|
||||
void gfxEQView::focus() {
|
||||
field_frequency.focus();
|
||||
}
|
||||
|
||||
void RF3DView::start() {
|
||||
void gfxEQView::start() {
|
||||
if (!running) {
|
||||
running = true;
|
||||
}
|
||||
}
|
||||
|
||||
void RF3DView::stop() {
|
||||
void gfxEQView::stop() {
|
||||
if (running) {
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
void RF3DView::update_spectrum(const AudioSpectrum& spectrum) {
|
||||
void gfxEQView::update_audio_spectrum(const AudioSpectrum& spectrum) {
|
||||
const int bins_per_bar = 128 / NUM_BARS;
|
||||
for (int bar = 0; bar < NUM_BARS; bar++) {
|
||||
int start_bin = bar * bins_per_bar;
|
||||
@ -83,7 +83,7 @@ void RF3DView::update_spectrum(const AudioSpectrum& spectrum) {
|
||||
}
|
||||
}
|
||||
|
||||
void RF3DView::render_equalizer(Painter& painter) {
|
||||
void gfxEQView::render_equalizer(Painter& painter) {
|
||||
const int num_bars = SCREEN_WIDTH / (BAR_WIDTH + BAR_SPACING);
|
||||
const int num_segments = RENDER_HEIGHT / SEGMENT_HEIGHT;
|
||||
|
||||
@ -109,7 +109,7 @@ void RF3DView::render_equalizer(Painter& painter) {
|
||||
}
|
||||
}
|
||||
|
||||
void RF3DView::paint(Painter& painter) {
|
||||
void gfxEQView::paint(Painter& painter) {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
start();
|
||||
@ -118,20 +118,20 @@ void RF3DView::paint(Painter& painter) {
|
||||
render_equalizer(painter);
|
||||
}
|
||||
|
||||
void RF3DView::on_modulation_changed(ReceiverModel::Mode modulation) {
|
||||
void gfxEQView::on_modulation_changed(ReceiverModel::Mode modulation) {
|
||||
stop();
|
||||
update_modulation(modulation);
|
||||
on_show_options_modulation();
|
||||
start();
|
||||
}
|
||||
|
||||
void RF3DView::on_show_options_rf_gain() {
|
||||
void gfxEQView::on_show_options_rf_gain() {
|
||||
auto widget = std::make_unique<RadioGainOptionsView>(options_view_rect, Theme::getInstance()->option_active);
|
||||
set_options_widget(std::move(widget));
|
||||
field_lna.set_style(Theme::getInstance()->option_active);
|
||||
}
|
||||
|
||||
void RF3DView::on_show_options_modulation() {
|
||||
void gfxEQView::on_show_options_modulation() {
|
||||
std::unique_ptr<Widget> widget;
|
||||
const auto modulation = receiver_model.modulation();
|
||||
switch (modulation) {
|
||||
@ -158,16 +158,16 @@ void RF3DView::on_show_options_modulation() {
|
||||
options_modulation.set_style(Theme::getInstance()->option_active);
|
||||
}
|
||||
|
||||
void RF3DView::on_frequency_step_changed(rf::Frequency f) {
|
||||
void gfxEQView::on_frequency_step_changed(rf::Frequency f) {
|
||||
receiver_model.set_frequency_step(f);
|
||||
field_frequency.set_step(f);
|
||||
}
|
||||
|
||||
void RF3DView::on_reference_ppm_correction_changed(int32_t v) {
|
||||
void gfxEQView::on_reference_ppm_correction_changed(int32_t v) {
|
||||
persistent_memory::set_correction_ppb(v * 1000);
|
||||
}
|
||||
|
||||
void RF3DView::remove_options_widget() {
|
||||
void gfxEQView::remove_options_widget() {
|
||||
if (options_widget) {
|
||||
remove_child(options_widget.get());
|
||||
options_widget.reset();
|
||||
@ -177,7 +177,7 @@ void RF3DView::remove_options_widget() {
|
||||
field_frequency.set_style(nullptr);
|
||||
}
|
||||
|
||||
void RF3DView::set_options_widget(std::unique_ptr<Widget> new_widget) {
|
||||
void gfxEQView::set_options_widget(std::unique_ptr<Widget> new_widget) {
|
||||
remove_options_widget();
|
||||
if (new_widget) {
|
||||
options_widget = std::move(new_widget);
|
||||
@ -187,7 +187,7 @@ void RF3DView::set_options_widget(std::unique_ptr<Widget> new_widget) {
|
||||
add_child(options_widget.get());
|
||||
}
|
||||
|
||||
void RF3DView::update_modulation(ReceiverModel::Mode modulation) {
|
||||
void gfxEQView::update_modulation(ReceiverModel::Mode modulation) {
|
||||
audio::output::mute();
|
||||
record_view.stop();
|
||||
baseband::shutdown();
|
||||
@ -242,8 +242,8 @@ void RF3DView::update_modulation(ReceiverModel::Mode modulation) {
|
||||
}
|
||||
}
|
||||
|
||||
void RF3DView::handle_coded_squelch(uint32_t value) {
|
||||
void gfxEQView::handle_coded_squelch(uint32_t value) {
|
||||
text_ctcss.set(tonekey::tone_key_string_by_value(value, text_ctcss.parent_rect().width() / 8));
|
||||
}
|
||||
|
||||
} // namespace ui::external_app::rf3d
|
||||
} // namespace ui::external_app::gfxeq
|
@ -1,5 +1,5 @@
|
||||
#ifndef __UI_RF3D_HPP__
|
||||
#define __UI_RF3D_HPP__
|
||||
#ifndef __UI_GFXEQ_HPP__
|
||||
#define __UI_GFXEQ_HPP__
|
||||
|
||||
#include "ui_widget.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
@ -11,18 +11,18 @@
|
||||
#include "ui_spectrum.hpp"
|
||||
#include "ui_freq_field.hpp"
|
||||
|
||||
namespace ui::external_app::rf3d {
|
||||
namespace ui::external_app::gfxeq {
|
||||
|
||||
class RF3DView : public View {
|
||||
class gfxEQView : public View {
|
||||
public:
|
||||
RF3DView(NavigationView& nav);
|
||||
~RF3DView();
|
||||
gfxEQView(NavigationView& nav);
|
||||
~gfxEQView();
|
||||
|
||||
RF3DView(const RF3DView&) = delete;
|
||||
RF3DView& operator=(const RF3DView&) = delete;
|
||||
gfxEQView(const gfxEQView&) = delete;
|
||||
gfxEQView& operator=(const gfxEQView&) = delete;
|
||||
|
||||
void focus() override;
|
||||
std::string title() const override { return "RF3D"; }
|
||||
std::string title() const override { return "gfxEQ"; }
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
@ -74,7 +74,7 @@ private:
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
void update_spectrum(const AudioSpectrum& spectrum);
|
||||
void update_audio_spectrum(const AudioSpectrum& spectrum);
|
||||
void render_equalizer(Painter& painter);
|
||||
void on_modulation_changed(ReceiverModel::Mode modulation);
|
||||
void on_show_options_rf_gain();
|
||||
@ -94,7 +94,7 @@ private:
|
||||
Message::ID::AudioSpectrum,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const AudioSpectrumMessage*>(p);
|
||||
this->update_spectrum(*message.data);
|
||||
this->update_audio_spectrum(*message.data);
|
||||
this->set_dirty();
|
||||
}
|
||||
};
|
||||
@ -107,6 +107,6 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace ui::external_app::rf3d
|
||||
} // namespace ui::external_app::gfxeq
|
||||
|
||||
#endif
|
30
firmware/application/external/rf3d/main.cpp
vendored
30
firmware/application/external/rf3d/main.cpp
vendored
@ -1,30 +0,0 @@
|
||||
#include "ui_rf3d.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "external_app.hpp"
|
||||
|
||||
namespace ui::external_app::rf3d {
|
||||
void initialize_app(ui::NavigationView& nav) {
|
||||
nav.push<RF3DView>();
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
__attribute__((section(".external_app.app_rf3d.application_information"), used)) application_information_t _application_information_3drf = {
|
||||
(uint8_t*)0x00000000,
|
||||
ui::external_app::rf3d::initialize_app,
|
||||
CURRENT_HEADER_VERSION,
|
||||
VERSION_MD5,
|
||||
"RF3D",
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
||||
},
|
||||
/*.icon_color = */ ui::Color::green().v,
|
||||
/*.menu_location = */ app_location_t::RX,
|
||||
/*.desired_menu_position = */ -1,
|
||||
|
||||
/*.m4_app_tag = portapack::spi_flash::image_tag_nfm_audio */ {'P', 'N', 'F', 'M'},
|
||||
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user