mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-25 15:37:49 +00:00
Testing external clock detection and auto-switch
Simplified audio spectrum computation and transfer ACARS RX in debug mode Disabled ABI warnings Updated binary
This commit is contained in:
@@ -330,7 +330,7 @@ set(TOPT "-mthumb -DTHUMB")
|
||||
set(CWARN "-Wall -Wextra -Wstrict-prototypes")
|
||||
|
||||
# Define C++ warning options here
|
||||
set(CPPWARN "-Wall -Wextra")
|
||||
set(CPPWARN "-Wall -Wextra -Wno-psabi")
|
||||
|
||||
#
|
||||
# Compiler settings
|
||||
|
@@ -32,11 +32,16 @@ using namespace acars;
|
||||
#include "utility.hpp"
|
||||
|
||||
void ACARSLogger::log_raw_data(const acars::Packet& packet, const uint32_t frequency) {
|
||||
std::string entry = "Raw: F:" + to_string_dec_uint(frequency) + "Hz ";
|
||||
(void)frequency;
|
||||
std::string entry { }; //= "Raw: F:" + to_string_dec_uint(frequency) + "Hz ";
|
||||
entry.reserve(256);
|
||||
|
||||
// Raw hex dump of all the bytes
|
||||
for (size_t c = 0; c < packet.length(); c += 8)
|
||||
entry += to_string_hex(packet.read(c, 8), 8) + " ";
|
||||
//for (size_t c = 0; c < packet.length(); c += 32)
|
||||
// entry += to_string_hex(packet.read(c, 32), 8) + " ";
|
||||
|
||||
for (size_t c = 0; c < 256; c += 32)
|
||||
entry += to_string_bin(packet.read(c, 32), 32);
|
||||
|
||||
log_file.write_entry(packet.received_at(), entry);
|
||||
}
|
||||
@@ -107,24 +112,25 @@ void ACARSAppView::focus() {
|
||||
field_frequency.focus();
|
||||
}
|
||||
|
||||
// Useless ?
|
||||
void ACARSAppView::set_parent_rect(const Rect new_parent_rect) {
|
||||
View::set_parent_rect(new_parent_rect);
|
||||
}
|
||||
|
||||
void ACARSAppView::on_packet(const acars::Packet& packet) {
|
||||
std::string alphanum_text = "";
|
||||
std::string console_info;
|
||||
|
||||
if (!packet.is_valid())
|
||||
console.writeln("\n\x1B\x0INVALID PACKET");
|
||||
else {
|
||||
std::string console_info;
|
||||
/*if (!packet.is_valid()) {
|
||||
console_info = to_string_datetime(packet.received_at(), HMS);
|
||||
console_info += " INVALID";
|
||||
|
||||
console_info = "\n" + to_string_datetime(packet.received_at(), HM);
|
||||
console_info += " REG:" + packet.registration_number();
|
||||
console.writeln(console_info);
|
||||
} else {
|
||||
console_info = to_string_datetime(packet.received_at(), HMS);
|
||||
console_info += ":" + to_string_bin(packet.read(0, 32), 32);
|
||||
//console_info += " REG:" + packet.registration_number();
|
||||
|
||||
console.write(console_info);
|
||||
}
|
||||
console.writeln(console_info);
|
||||
}*/
|
||||
|
||||
packet_counter++;
|
||||
if (packet_counter % 10 == 0)
|
||||
console.writeln("Block #" + to_string_dec_uint(packet_counter));
|
||||
|
||||
// Log raw data whatever it contains
|
||||
if (logger && logging)
|
||||
|
@@ -51,13 +51,13 @@ public:
|
||||
ACARSAppView(NavigationView& nav);
|
||||
~ACARSAppView();
|
||||
|
||||
void set_parent_rect(const Rect new_parent_rect) override;
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "ACARS RX"; };
|
||||
std::string title() const override { return "ACARS (WIP)"; };
|
||||
|
||||
private:
|
||||
bool logging { false };
|
||||
uint32_t packet_counter { 0 };
|
||||
|
||||
RFAmpField field_rf_amp {
|
||||
{ 13 * 8, 0 * 16 }
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
};
|
||||
|
||||
Console console {
|
||||
{ 0, 4 * 16, 240, 240 }
|
||||
{ 0, 3 * 16, 240, 256 }
|
||||
};
|
||||
|
||||
std::unique_ptr<ACARSLogger> logger { };
|
||||
|
@@ -86,8 +86,7 @@ NBFMOptionsView::NBFMOptionsView(
|
||||
/* AnalogAudioView *******************************************************/
|
||||
|
||||
AnalogAudioView::AnalogAudioView(
|
||||
NavigationView& nav,
|
||||
bool eos
|
||||
NavigationView& nav
|
||||
) : nav_ (nav)
|
||||
{
|
||||
add_children({
|
||||
|
@@ -96,7 +96,7 @@ private:
|
||||
|
||||
class AnalogAudioView : public View {
|
||||
public:
|
||||
AnalogAudioView(NavigationView& nav, bool eos);
|
||||
AnalogAudioView(NavigationView& nav);
|
||||
~AnalogAudioView();
|
||||
|
||||
void on_hide() override;
|
||||
|
@@ -51,26 +51,26 @@ public:
|
||||
|
||||
private:
|
||||
Labels labels {
|
||||
{ { 8 * 8, 9 * 16 }, "/ / : :", Color::light_grey() },
|
||||
{ { 4 * 8, 11 * 16 }, "YYYY/MM/DD HH:MM:SS", Color::light_grey() }
|
||||
{ { 6 * 8, 7 * 16 }, "YYYY/MM/DD HH:MM:SS", Color::grey() },
|
||||
{ { 10 * 8, 9 * 16 }, "/ / : :", Color::light_grey() }
|
||||
};
|
||||
|
||||
NumberField field_year {
|
||||
{ 4 * 8, 9 * 16 },
|
||||
{ 6 * 8, 9 * 16 },
|
||||
4,
|
||||
{ 2015, 2099 },
|
||||
1,
|
||||
'0',
|
||||
};
|
||||
NumberField field_month {
|
||||
{ 9 * 8, 9 * 16 },
|
||||
{ 11 * 8, 9 * 16 },
|
||||
2,
|
||||
{ 1, 12 },
|
||||
1,
|
||||
'0',
|
||||
};
|
||||
NumberField field_day {
|
||||
{ 12 * 8, 9 * 16 },
|
||||
{ 14 * 8, 9 * 16 },
|
||||
2,
|
||||
{ 1, 31 },
|
||||
1,
|
||||
@@ -78,21 +78,21 @@ private:
|
||||
};
|
||||
|
||||
NumberField field_hour {
|
||||
{ 15 * 8, 9 * 16 },
|
||||
{ 17 * 8, 9 * 16 },
|
||||
2,
|
||||
{ 0, 23 },
|
||||
1,
|
||||
'0',
|
||||
};
|
||||
NumberField field_minute {
|
||||
{ 18 * 8, 9 * 16 },
|
||||
{ 20 * 8, 9 * 16 },
|
||||
2,
|
||||
{ 0, 59 },
|
||||
1,
|
||||
'0',
|
||||
};
|
||||
NumberField field_second {
|
||||
{ 21 * 8, 9 * 16 },
|
||||
{ 23 * 8, 9 * 16 },
|
||||
2,
|
||||
{ 0, 59 },
|
||||
1,
|
||||
@@ -141,7 +141,7 @@ private:
|
||||
1,
|
||||
'0',
|
||||
};
|
||||
|
||||
|
||||
Checkbox check_bias {
|
||||
{ 28, 12 * 16 },
|
||||
5,
|
||||
@@ -161,35 +161,6 @@ private:
|
||||
SetFrequencyCorrectionModel form_collect();
|
||||
};
|
||||
|
||||
class SetTouchCalibView : public View {
|
||||
public:
|
||||
SetTouchCalibView(NavigationView& nav);
|
||||
void focus() override;
|
||||
bool on_touch(const TouchEvent event) override;
|
||||
|
||||
private:
|
||||
|
||||
Text text_title {
|
||||
{ 64, 32, 40, 16 },
|
||||
"UL,UR,DL,DR !",
|
||||
};
|
||||
|
||||
Text text_debugx {
|
||||
{ 64, 64, 40, 16 },
|
||||
"X",
|
||||
};
|
||||
|
||||
Text text_debugy {
|
||||
{ 64, 80, 40, 16 },
|
||||
"Y",
|
||||
};
|
||||
|
||||
Button button_ok {
|
||||
{ 72, 192, 96, 24 },
|
||||
"OK"
|
||||
};
|
||||
};
|
||||
|
||||
class SetUIView : public View {
|
||||
public:
|
||||
SetUIView(NavigationView& nav);
|
||||
@@ -224,7 +195,7 @@ private:
|
||||
};
|
||||
|
||||
Checkbox checkbox_showsplash {
|
||||
{ 3 * 8, 8 * 16 },
|
||||
{ 3 * 8, 9 * 16 },
|
||||
11,
|
||||
"Show splash"
|
||||
};
|
||||
|
@@ -661,6 +661,28 @@ static constexpr Bitmap bitmap_icon_freqman {
|
||||
{ 16, 16 }, bitmap_icon_freqman_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_icon_clk_int_data[] = {
|
||||
0x00,
|
||||
0x00,
|
||||
0xDC,
|
||||
0x54,
|
||||
0x54,
|
||||
0x54,
|
||||
0x54,
|
||||
0x76,
|
||||
0x00,
|
||||
0x44,
|
||||
0x6C,
|
||||
0x38,
|
||||
0x38,
|
||||
0x6C,
|
||||
0x44,
|
||||
0x00,
|
||||
};
|
||||
static constexpr Bitmap bitmap_icon_clk_int {
|
||||
{ 8, 16 }, bitmap_icon_clk_int_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_ok_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
@@ -1699,6 +1721,28 @@ static constexpr Bitmap bitmap_target {
|
||||
{ 16, 16 }, bitmap_target_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_icon_clk_ext_data[] = {
|
||||
0x00,
|
||||
0x00,
|
||||
0xDC,
|
||||
0x54,
|
||||
0x54,
|
||||
0x54,
|
||||
0x54,
|
||||
0x76,
|
||||
0x00,
|
||||
0x10,
|
||||
0x38,
|
||||
0x7C,
|
||||
0x10,
|
||||
0x10,
|
||||
0x10,
|
||||
0x00,
|
||||
};
|
||||
static constexpr Bitmap bitmap_icon_clk_ext {
|
||||
{ 8, 16 }, bitmap_icon_clk_ext_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_icon_sstv_data[] = {
|
||||
0x10, 0x08,
|
||||
0x20, 0x04,
|
||||
|
@@ -247,10 +247,10 @@ constexpr ClockControls si5351_clock_control_clkin {
|
||||
si5351_clock_control_common[4] | si5351_clock_control_ms_src_clkin,
|
||||
si5351_clock_control_common[5] | si5351_clock_control_ms_src_clkin,
|
||||
si5351_clock_control_common[6] | si5351_clock_control_ms_src_clkin,
|
||||
si5351_clock_control_common[7] | si5351_clock_control_ms_src_clkin,
|
||||
si5351_clock_control_common[7] | si5351_clock_control_ms_src_xtal,
|
||||
};
|
||||
|
||||
void ClockManager::init() {
|
||||
void ClockManager::init(const bool use_clkin) {
|
||||
/* Must be sure to run the M4 core from IRC when messing with the signal
|
||||
* generator that sources the GP_CLKIN signal that drives the micro-
|
||||
* controller's PLL1 input.
|
||||
@@ -269,7 +269,7 @@ void ClockManager::init() {
|
||||
clock_generator.enable_fanout();
|
||||
clock_generator.set_pll_input_sources(si5351_pll_input_sources);
|
||||
|
||||
const bool use_clkin = false;
|
||||
//const bool use_clkin = false;
|
||||
clock_generator.set_clock_control(
|
||||
use_clkin ?
|
||||
si5351_clock_control_clkin
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void init();
|
||||
void init(const bool use_clkin);
|
||||
void shutdown();
|
||||
|
||||
void run_from_irc();
|
||||
|
@@ -223,6 +223,8 @@ void EventDispatcher::handle_local_queue() {
|
||||
|
||||
void EventDispatcher::handle_rtc_tick() {
|
||||
sd_card::poll_inserted();
|
||||
|
||||
portapack::poll_ext_clock();
|
||||
|
||||
portapack::temperature_logger.second_tick();
|
||||
|
||||
|
@@ -302,10 +302,6 @@ public:
|
||||
|
||||
void reset();
|
||||
|
||||
uint8_t device_status() {
|
||||
return read_register(Register::DeviceStatus);
|
||||
}
|
||||
|
||||
void wait_for_device_ready() {
|
||||
while(device_status() & 0x80);
|
||||
}
|
||||
@@ -382,7 +378,11 @@ public:
|
||||
_clock_control[n] |= ClockControl::CLK_PDN_Mask;
|
||||
write_register(Register::CLKControl_Base + n, _clock_control[n]);
|
||||
}
|
||||
|
||||
|
||||
bool clkin_status() {
|
||||
return ((device_status() & DeviceStatus::LOS_Mask) == DeviceStatus::LOS_ValidClockAtCLKIN);
|
||||
}
|
||||
|
||||
template<size_t N>
|
||||
void write_registers(const uint8_t reg, const std::array<uint8_t, N>& values) {
|
||||
std::array<uint8_t, N + 1> data;
|
||||
@@ -397,6 +397,10 @@ private:
|
||||
const I2C::address_t _address;
|
||||
uint8_t _output_enable;
|
||||
|
||||
uint8_t device_status() {
|
||||
return read_register(Register::DeviceStatus);
|
||||
}
|
||||
|
||||
void update_output_enable_control() {
|
||||
write_register(Register::OutputEnableControl, ~_output_enable);
|
||||
}
|
||||
|
@@ -29,13 +29,16 @@
|
||||
|
||||
// Note about messages:
|
||||
// There can only be one message handler for one kind of message at once
|
||||
// If an attempt is made to register a second handler, there's a chDbgPanic
|
||||
// If an attempt is made to register a second handler, there's a chDbgPanic "MsgDblReg"
|
||||
|
||||
// Note about matched filters: see proc_sonde.hpp
|
||||
|
||||
//TEST: Goertzel tone detect
|
||||
//TEST: Menuview refresh, seems to blink a lot
|
||||
//TEST: Check AFSK transmit end, skips last bits ?
|
||||
//TEST: Imperial in whipcalc
|
||||
|
||||
//BUG: Console lock-up if first string to be printed starts with escape character ?
|
||||
//BUG: (Workaround ok) CPLD-related rx ok, tx bad, see portapack.cpp lines 214+ to disable CPLD overlay
|
||||
//BUG: SCANNER Lock on frequency, if frequency jump, still locked on first one
|
||||
//BUG: SCANNER Multiple slices
|
||||
@@ -43,6 +46,7 @@
|
||||
//GLITCH: Start of tx using ReplayThread plays a small bit of previous transmission (content of 1 buffer ?)
|
||||
// See fifo.reset_in() ?
|
||||
|
||||
//TODO: Continue acars receiver. See matched filter, probably doesn't shift the spectrum correctly
|
||||
//TODO: Add larger description text field in frequency load, under menuview
|
||||
//TODO: Allow apps to select a preferred FREQMAN file
|
||||
//TODO: Make play button larger in Replay
|
||||
|
@@ -30,6 +30,7 @@
|
||||
using namespace hackrf::one;
|
||||
|
||||
#include "clock_manager.hpp"
|
||||
#include "event_m0.hpp"
|
||||
|
||||
#include "backlight.hpp"
|
||||
#include "touch_adc.hpp"
|
||||
@@ -82,6 +83,7 @@ TransmitterModel transmitter_model;
|
||||
TemperatureLogger temperature_logger;
|
||||
|
||||
bool antenna_bias { false };
|
||||
bool prev_clkin_status { false };
|
||||
uint8_t bl_tick_counter { 0 };
|
||||
|
||||
void set_antenna_bias(const bool v) {
|
||||
@@ -92,6 +94,22 @@ bool get_antenna_bias() {
|
||||
return antenna_bias;
|
||||
}
|
||||
|
||||
bool get_ext_clock() {
|
||||
return prev_clkin_status;
|
||||
}
|
||||
|
||||
void poll_ext_clock() {
|
||||
auto clkin_status = clock_generator.clkin_status();
|
||||
|
||||
if (clkin_status != prev_clkin_status) {
|
||||
StatusRefreshMessage message { };
|
||||
EventDispatcher::send_message(message);
|
||||
clock_manager.init(clkin_status);
|
||||
}
|
||||
|
||||
prev_clkin_status = clkin_status;
|
||||
}
|
||||
|
||||
class Power {
|
||||
public:
|
||||
void init() {
|
||||
@@ -278,7 +296,7 @@ bool init() {
|
||||
led_rx.setup();
|
||||
led_tx.setup();
|
||||
|
||||
clock_manager.init();
|
||||
clock_manager.init(false);
|
||||
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
||||
clock_manager.run_at_full_speed();
|
||||
|
||||
|
@@ -59,6 +59,9 @@ extern TemperatureLogger temperature_logger;
|
||||
void set_antenna_bias(const bool v);
|
||||
bool get_antenna_bias();
|
||||
|
||||
void poll_ext_clock();
|
||||
bool get_ext_clock();
|
||||
|
||||
bool init();
|
||||
void shutdown();
|
||||
|
||||
|
@@ -166,26 +166,26 @@ std::string to_string_datetime(const rtc::RTC& value, const TimeFormat format) {
|
||||
|
||||
if (format == YMDHMS) {
|
||||
string += to_string_dec_uint(value.year(), 4) + "/" +
|
||||
to_string_dec_uint(value.month(), 2) + "/" +
|
||||
to_string_dec_uint(value.day(), 2) + " ";
|
||||
to_string_dec_uint(value.month(), 2, '0') + "/" +
|
||||
to_string_dec_uint(value.day(), 2, '0') + " ";
|
||||
}
|
||||
|
||||
string += to_string_dec_uint(value.hour(), 2) + ":" +
|
||||
string += to_string_dec_uint(value.minute(), 2);
|
||||
string += to_string_dec_uint(value.hour(), 2, '0') + ":" +
|
||||
string += to_string_dec_uint(value.minute(), 2, '0');
|
||||
|
||||
if ((format == YMDHMS) || (format == HMS))
|
||||
string += ":" + to_string_dec_uint(value.second(), 2);
|
||||
string += ":" + to_string_dec_uint(value.second(), 2, '0');
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
std::string to_string_timestamp(const rtc::RTC& value) {
|
||||
return to_string_dec_uint(value.year(), 4) +
|
||||
to_string_dec_uint(value.month(), 2) +
|
||||
to_string_dec_uint(value.day(), 2) +
|
||||
to_string_dec_uint(value.hour(), 2) +
|
||||
to_string_dec_uint(value.minute(), 2) +
|
||||
to_string_dec_uint(value.second(), 2);
|
||||
return to_string_dec_uint(value.year(), 4, '0') +
|
||||
to_string_dec_uint(value.month(), 2, '0') +
|
||||
to_string_dec_uint(value.day(), 2, '0') +
|
||||
to_string_dec_uint(value.hour(), 2, '0') +
|
||||
to_string_dec_uint(value.minute(), 2, '0') +
|
||||
to_string_dec_uint(value.second(), 2, '0');
|
||||
}
|
||||
|
||||
std::string to_string_FAT_timestamp(const FATTimestamp& timestamp) {
|
||||
|
@@ -74,9 +74,9 @@ void AudioSpectrumView::paint(Painter& painter) {
|
||||
);
|
||||
}
|
||||
|
||||
void AudioSpectrumView::on_audio_spectrum(const AudioSpectrum& spectrum) {
|
||||
for (size_t i = 0; i < spectrum.db.size(); i++)
|
||||
audio_spectrum[i] = ((int16_t)spectrum.db[i] - 127) * 256;
|
||||
void AudioSpectrumView::on_audio_spectrum(const AudioSpectrum* spectrum) {
|
||||
for (size_t i = 0; i < spectrum->db.size(); i++)
|
||||
audio_spectrum[i] = ((int16_t)spectrum->db[i] - 127) * 256;
|
||||
waveform.set_dirty();
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ void WaterfallWidget::show_audio_spectrum_view(const bool show) {
|
||||
add_child(audio_spectrum_view.get());
|
||||
update_widgets_rect();
|
||||
} else {
|
||||
audio_fifo = nullptr;
|
||||
audio_spectrum_update = false;
|
||||
remove_child(audio_spectrum_view.get());
|
||||
audio_spectrum_view.reset();
|
||||
update_widgets_rect();
|
||||
@@ -395,8 +395,8 @@ void WaterfallWidget::on_channel_spectrum(const ChannelSpectrum& spectrum) {
|
||||
);
|
||||
}
|
||||
|
||||
void WaterfallWidget::on_audio_spectrum(const AudioSpectrum& spectrum) {
|
||||
audio_spectrum_view->on_audio_spectrum(spectrum);
|
||||
void WaterfallWidget::on_audio_spectrum() {
|
||||
audio_spectrum_view->on_audio_spectrum(audio_spectrum_data);
|
||||
}
|
||||
|
||||
} /* namespace spectrum */
|
||||
|
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
void on_audio_spectrum(const AudioSpectrum& spectrum);
|
||||
void on_audio_spectrum(const AudioSpectrum* spectrum);
|
||||
|
||||
private:
|
||||
static constexpr int cursor_band_height = 4;
|
||||
@@ -150,7 +150,8 @@ private:
|
||||
FrequencyScale frequency_scale { };
|
||||
|
||||
ChannelSpectrumFIFO* channel_fifo { nullptr };
|
||||
AudioSpectrumFIFO* audio_fifo { nullptr };
|
||||
AudioSpectrum* audio_spectrum_data { nullptr };
|
||||
bool audio_spectrum_update { false };
|
||||
|
||||
std::unique_ptr<AudioSpectrumView> audio_spectrum_view { };
|
||||
|
||||
@@ -166,11 +167,12 @@ private:
|
||||
this->channel_fifo = message.fifo;
|
||||
}
|
||||
};
|
||||
MessageHandlerRegistration message_handler_audio_spectrum_config {
|
||||
Message::ID::AudioSpectrumConfig,
|
||||
MessageHandlerRegistration message_handler_audio_spectrum {
|
||||
Message::ID::AudioSpectrum,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const AudioSpectrumConfigMessage*>(p);
|
||||
this->audio_fifo = message.fifo;
|
||||
const auto message = *reinterpret_cast<const AudioSpectrumMessage*>(p);
|
||||
this->audio_spectrum_data = message.data;
|
||||
this->audio_spectrum_update = true;
|
||||
}
|
||||
};
|
||||
MessageHandlerRegistration message_handler_frame_sync {
|
||||
@@ -182,18 +184,15 @@ private:
|
||||
this->on_channel_spectrum(channel_spectrum);
|
||||
}
|
||||
}
|
||||
if( this->audio_fifo ) {
|
||||
AudioSpectrum audio_spectrum;
|
||||
while( audio_fifo->out(audio_spectrum) ) {
|
||||
// Unstack everything available and only use last buffer (should only be one max. ready per frame)
|
||||
}
|
||||
this->on_audio_spectrum(audio_spectrum);
|
||||
if (this->audio_spectrum_update) {
|
||||
this->audio_spectrum_update = false;
|
||||
this->on_audio_spectrum();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void on_channel_spectrum(const ChannelSpectrum& spectrum);
|
||||
void on_audio_spectrum(const AudioSpectrum& spectrum);
|
||||
void on_audio_spectrum();
|
||||
};
|
||||
|
||||
} /* namespace spectrum */
|
||||
|
@@ -106,6 +106,7 @@ SystemStatusView::SystemStatusView(
|
||||
&button_camera,
|
||||
&button_sleep,
|
||||
&button_bias_tee,
|
||||
&image_clock_status,
|
||||
&sd_card_status_view,
|
||||
});
|
||||
|
||||
@@ -157,6 +158,14 @@ void SystemStatusView::refresh() {
|
||||
button_bias_tee.set_bitmap(&bitmap_icon_biast_off);
|
||||
button_bias_tee.set_foreground(ui::Color::light_grey());
|
||||
}
|
||||
|
||||
if (portapack::get_ext_clock()) {
|
||||
image_clock_status.set_bitmap(&bitmap_icon_clk_ext);
|
||||
button_bias_tee.set_foreground(ui::Color::green());
|
||||
} else {
|
||||
image_clock_status.set_bitmap(&bitmap_icon_clk_int);
|
||||
button_bias_tee.set_foreground(ui::Color::light_grey());
|
||||
}
|
||||
}
|
||||
|
||||
void SystemStatusView::set_back_enabled(bool new_value) {
|
||||
@@ -334,7 +343,7 @@ ReceiversMenuView::ReceiversMenuView(NavigationView& nav) {
|
||||
{ "ACARS: Planes", ui::Color::yellow(),&bitmap_icon_adsb, [&nav](){ nav.replace<ACARSAppView>(); }, },
|
||||
{ "AIS: Boats", ui::Color::green(), &bitmap_icon_ais, [&nav](){ nav.replace<AISAppView>(); } },
|
||||
{ "AFSK", ui::Color::yellow(),&bitmap_icon_receivers, [&nav](){ nav.replace<AFSKRxView>(); } },
|
||||
{ "Audio", ui::Color::green(), &bitmap_icon_speaker, [&nav](){ nav.replace<AnalogAudioView>(false); } },
|
||||
{ "Audio", ui::Color::green(), &bitmap_icon_speaker, [&nav](){ nav.replace<AnalogAudioView>(); } },
|
||||
{ "ERT: Utility Meters", ui::Color::green(), &bitmap_icon_ert, [&nav](){ nav.replace<ERTAppView>(); } },
|
||||
{ "POCSAG", ui::Color::green(), &bitmap_icon_pocsag, [&nav](){ nav.replace<POCSAGAppView>(); } },
|
||||
{ "Radiosondes", ui::Color::yellow(),&bitmap_icon_sonde, [&nav](){ nav.replace<SondeView>(); } },
|
||||
@@ -370,7 +379,7 @@ TransmittersMenuView::TransmittersMenuView(NavigationView& nav) {
|
||||
{ "Soundboard", ui::Color::green(), &bitmap_icon_soundboard, [&nav](){ nav.push<SoundBoardView>(); } },
|
||||
{ "SSTV", ui::Color::green(), &bitmap_icon_sstv, [&nav](){ nav.push<SSTVTXView>(); } },
|
||||
{ "TEDI/LCR AFSK", ui::Color::yellow(), &bitmap_icon_lcr, [&nav](){ nav.push<LCRView>(); } },
|
||||
{ "TouchTunes remote", ui::Color::yellow(), &bitmap_icon_remote [&nav](){ nav.push<TouchTunesView>(); } },
|
||||
{ "TouchTunes remote", ui::Color::yellow(), &bitmap_icon_remote, [&nav](){ nav.push<TouchTunesView>(); } },
|
||||
{ "Custom remote", ui::Color::grey(), &bitmap_icon_remote, [&nav](){ nav.push<RemoteView>(); } },
|
||||
});
|
||||
on_left = [&nav](){ nav.pop(); };
|
||||
|
@@ -125,12 +125,12 @@ private:
|
||||
};
|
||||
|
||||
Text title {
|
||||
{ 20, 0, 17 * 8, 1 * 16 },
|
||||
{ 20, 0, 16 * 8, 1 * 16 },
|
||||
default_title,
|
||||
};
|
||||
|
||||
ImageButton button_stealth {
|
||||
{ 20 * 8, 0, 2 * 8, 1 * 16 },
|
||||
{ 19 * 8, 0, 2 * 8, 1 * 16 },
|
||||
&bitmap_icon_stealth,
|
||||
Color::light_grey(),
|
||||
Color::dark_grey()
|
||||
@@ -144,26 +144,33 @@ private:
|
||||
};*/
|
||||
|
||||
ImageButton button_camera {
|
||||
{ 22 * 8, 0, 2 * 8, 1 * 16 },
|
||||
{ 21 * 8, 0, 2 * 8, 1 * 16 },
|
||||
&bitmap_icon_camera,
|
||||
Color::white(),
|
||||
Color::dark_grey()
|
||||
};
|
||||
|
||||
ImageButton button_sleep {
|
||||
{ 24 * 8, 0, 2 * 8, 1 * 16 },
|
||||
{ 23 * 8, 0, 2 * 8, 1 * 16 },
|
||||
&bitmap_icon_sleep,
|
||||
Color::white(),
|
||||
Color::dark_grey()
|
||||
};
|
||||
|
||||
ImageButton button_bias_tee {
|
||||
{ 26 * 8, 0, 12, 1 * 16 },
|
||||
{ 25 * 8, 0, 12, 1 * 16 },
|
||||
&bitmap_icon_biast_off,
|
||||
Color::light_grey(),
|
||||
Color::dark_grey()
|
||||
};
|
||||
|
||||
Image image_clock_status {
|
||||
{ 27 * 8, 0 * 16, 2 * 8, 1 * 16 },
|
||||
&bitmap_icon_clk_int,
|
||||
Color::light_grey(),
|
||||
Color::dark_grey()
|
||||
};
|
||||
|
||||
SDCardStatusView sd_card_status_view {
|
||||
{ 28 * 8, 0 * 16, 2 * 8, 1 * 16 }
|
||||
};
|
||||
|
Reference in New Issue
Block a user