Compare commits

..

35 Commits

Author SHA1 Message Date
gullradriel 5c4e27ea29 Merge pull request #927 from gullradriel/dsp-warning-fix
Dsp warning fix
2023-04-27 16:08:18 +02:00
GullCode 54e4230191 indentation 2023-04-27 16:07:57 +02:00
GullCode f069383c2a Fix unused warnings in ssb_execute 2023-04-27 16:06:47 +02:00
gullradriel d3a356d415 Merge pull request #926 from gullradriel/gitignore-fix
restoring gitignore
2023-04-27 15:51:54 +02:00
GullCode f0e4fdcbcc restoring gitignore, bad move on last commit 2023-04-27 15:50:59 +02:00
ittercho d5f6f42fae Addition of water meters (#892)
Water Meters frequency list
NRK and RMF radio stations frequencies list
Fixed and ordered as much as possible PRESETS.TXT
Co-authored-by: gullradriel
2023-04-27 15:44:32 +02:00
gullradriel 7a89858cc6 Merge pull request #925 from gullradriel/level-mem-workaround
Automatically reduce rssi graph history
2023-04-27 15:42:06 +02:00
gullradriel 15c9a76536 Merge pull request #924 from bernd-herzog/dfu_menu
added frame drop rate for m4 signal processing
2023-04-27 15:41:46 +02:00
GullCode d7359a8cd5 Automatically reduce rssi graph history when hidden, restore size on show. Prevent Memory exhaustion in apps like 'Level' or any app eating a bit too much mem before launching a FrequencyPadView 2023-04-27 15:38:29 +02:00
Bernd Herzog 50e5bc60ee added frame miss rate for m4 signal processing 2023-04-26 22:28:14 +02:00
jLynx 9385be4f1e Merge pull request #920 from zxkmm/ready_to_pr_2_20230426_imp_issue_917
implemented issue#917
2023-04-27 07:01:02 +12:00
zxkmmOnHaseeWSL 9cddab9a5e fix mistakenly remane dir as file -- credit:Gull 2023-04-26 19:09:38 +08:00
zxkmmOnHaseeWSL 6e01a1d0dc change ?: to if else 2023-04-26 16:20:05 +08:00
gullradriel f73cd39d2d Merge pull request #922 from NotherNgineer/next
#910 Brighter color for .C8/.C16 files in fileman
2023-04-26 09:29:57 +02:00
Mark Thompson 0303c658ea Brighter color for .C8/.C16 files in fileman
See https://github.com/eried/portapack-mayhem/issues/910
2023-04-26 02:04:37 -05:00
gullradriel 94ddb63b1d Merge pull request #921 from zxkmm/ready_to_pr_20230426_3_textual_change_for_flash_unity
textual change for  the flash unity
2023-04-26 08:29:51 +02:00
gullradriel b1aa607a7c Merge pull request #907 from NotherNgineer/next
Support for ERT SCM+ meter protocol
2023-04-26 08:28:39 +02:00
Mark Thompson 509f86c1f7 Merge branch 'eried:next' into next 2023-04-26 01:25:46 -05:00
zxkmmOnHaseeWSL b45ca43e27 textual change for the flash unity 2023-04-26 13:29:11 +08:00
zxkmmOnHaseeWSL 47482d1e58 fixed var.clear 2023-04-26 13:22:50 +08:00
zxkmmOnHaseeWSL 59dfe5b50b implemented issue#917 2023-04-26 13:01:51 +08:00
Mark Thompson b1f5023fe1 Removed unneeded space characters 2023-04-24 15:29:51 -05:00
gullradriel a54b94fe53 Merge pull request #915 from gullradriel/recon-update
Recon description flashing on range fix
2023-04-24 21:15:56 +02:00
GullCode 45bdabcef9 Fix for description being updated at each step on a range 2023-04-24 21:14:34 +02:00
Mark Thompson 6cdada1118 Include ERT packet type in ert.txt log file 2023-04-24 09:59:43 -05:00
gullradriel cffc72c516 Merge pull request #913 from gullradriel/looking-glass-zoom
Looking glass zoom update
2023-04-24 13:56:04 +02:00
GullCode e53514aa12 tweaking scan start values and ranges, allowing <24MHz range 2023-04-24 13:51:31 +02:00
Bernd Herzog 775de5ce6f Merge pull request #912 from bernd-herzog/dfu_menu
improved stability of cpu usage calculation
2023-04-24 13:05:36 +02:00
Bernd Herzog 4ff92be23b refactoring 2023-04-24 13:04:59 +02:00
Bernd Herzog 948d8d947e improved stability of cpu usage calculation 2023-04-24 13:00:34 +02:00
Mark Thompson 44b2e5ea61 Support for ERT SCM+ meter protocol 2023-04-23 01:34:56 -05:00
Mark Thompson 48ed7b1b1a Support for ERT SCM+ meter protocol 2023-04-23 01:33:42 -05:00
Mark Thompson 6201be82ea Support for ERT SCM+ meter protocol 2023-04-23 01:31:45 -05:00
Mark Thompson fe1d296b48 Support for ERT SCM+ meter protocol 2023-04-23 01:29:51 -05:00
Mark Thompson 697876d86a Support for ERT SCM+ meter protocol 2023-04-23 01:26:37 -05:00
26 changed files with 366 additions and 104 deletions
+1
View File
@@ -155,6 +155,7 @@ set(CPPSRC
${COMMON}/ui_widget.cpp
${COMMON}/utility.cpp
${COMMON}/wm8731.cpp
${COMMON}/performance_counter.cpp
app_settings.cpp
audio.cpp
baseband_api.cpp
+3 -1
View File
@@ -41,6 +41,7 @@ std::string type(Packet::Type value) {
case Packet::Type::Unknown: return "???";
case Packet::Type::IDM: return "IDM";
case Packet::Type::SCM: return "SCM";
case Packet::Type::SCMPLUS: return "SCM+";
}
}
@@ -62,7 +63,8 @@ std::string commodity_type(CommodityType value) {
void ERTLogger::on_packet(const ert::Packet& packet) {
const auto formatted = packet.symbols_formatted();
log_file.write_entry(packet.received_at(), formatted.data + "/" + formatted.errors);
std::string entry = ert::format::type(packet.type()) + " " + formatted.data + "/" + formatted.errors;
log_file.write_entry(packet.received_at(), entry);
}
const ERTRecentEntry::Key ERTRecentEntry::invalid_key { };
+12 -18
View File
@@ -21,6 +21,7 @@
#include "ui_dfu_menu.hpp"
#include "portapack_shared_memory.hpp"
#include "performance_counter.hpp"
namespace ui {
@@ -34,37 +35,30 @@ DfuMenu::DfuMenu(NavigationView& nav) : nav_ (nav) {
&text_info_line_4,
&text_info_line_5,
&text_info_line_6,
&text_info_line_7
&text_info_line_7,
&text_info_line_8
});
}
void DfuMenu::paint(Painter& painter) {
auto now = chTimeNow();
auto idle_ticks = chThdGetTicks(chSysGetIdleThread());
static systime_t last_time;
static systime_t last_last_time;
auto time_elapsed = now - last_time;
auto idle_elapsed = idle_ticks - last_last_time;
last_time = now;
last_last_time = idle_ticks;
auto utilisation = get_cpu_utilisation_in_percent();
text_info_line_1.set(to_string_dec_uint(chCoreStatus(), 6));
text_info_line_2.set(to_string_dec_uint((uint32_t)get_free_stack_space(), 6));
text_info_line_3.set(to_string_dec_uint((time_elapsed - idle_elapsed) / 10, 6));
text_info_line_3.set(to_string_dec_uint(utilisation, 6));
text_info_line_4.set(to_string_dec_uint(shared_memory.m4_heap_usage, 6));
text_info_line_5.set(to_string_dec_uint(shared_memory.m4_stack_usage, 6));
text_info_line_6.set(to_string_dec_uint(shared_memory.m4_cpu_usage, 6));
text_info_line_7.set(to_string_dec_uint(chTimeNow()/1000, 6));
text_info_line_7.set(to_string_dec_uint(shared_memory.m4_buffer_missed, 6));
text_info_line_8.set(to_string_dec_uint(chTimeNow()/1000, 6));
constexpr auto margin = 5;
constexpr auto lines = 8 + 2;
painter.fill_rectangle(
{
{6 * CHARACTER_WIDTH - margin, 3 * LINE_HEIGHT - margin},
{15 * CHARACTER_WIDTH + margin * 2, 9 * LINE_HEIGHT + margin * 2}
{15 * CHARACTER_WIDTH + margin * 2, lines * LINE_HEIGHT + margin * 2}
},
ui::Color::black()
);
@@ -72,7 +66,7 @@ void DfuMenu::paint(Painter& painter) {
painter.fill_rectangle(
{
{5 * CHARACTER_WIDTH - margin, 3 * LINE_HEIGHT - margin},
{CHARACTER_WIDTH, 9 * LINE_HEIGHT + margin * 2}
{CHARACTER_WIDTH, lines * LINE_HEIGHT + margin * 2}
},
ui::Color::dark_cyan()
);
@@ -80,7 +74,7 @@ void DfuMenu::paint(Painter& painter) {
painter.fill_rectangle(
{
{21 * CHARACTER_WIDTH + margin, 3 * LINE_HEIGHT - margin},
{CHARACTER_WIDTH, 9 * LINE_HEIGHT + margin * 2}
{CHARACTER_WIDTH, lines * LINE_HEIGHT + margin * 2}
},
ui::Color::dark_cyan()
);
@@ -95,7 +89,7 @@ void DfuMenu::paint(Painter& painter) {
painter.fill_rectangle(
{
{5 * CHARACTER_WIDTH - margin, 12 * LINE_HEIGHT + margin},
{5 * CHARACTER_WIDTH - margin, (lines+3) * LINE_HEIGHT + margin},
{17 * CHARACTER_WIDTH + margin * 2, 8}
},
ui::Color::dark_cyan()
+3 -1
View File
@@ -54,7 +54,8 @@ private:
{ { 6 * CHARACTER_WIDTH, 8 * LINE_HEIGHT }, "M4 heap:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH, 9 * LINE_HEIGHT }, "M4 stack:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH,10 * LINE_HEIGHT }, "M4 cpu %:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH,11 * LINE_HEIGHT }, "uptime:", Color::dark_cyan() }
{ { 6 * CHARACTER_WIDTH,11 * LINE_HEIGHT }, "M4 miss:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH,12 * LINE_HEIGHT }, "uptime:", Color::dark_cyan() }
};
Text text_info_line_1 {{ 15 * CHARACTER_WIDTH, 5 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
@@ -64,6 +65,7 @@ private:
Text text_info_line_5 {{ 15 * CHARACTER_WIDTH, 9 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_6 {{ 15 * CHARACTER_WIDTH,10 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_7 {{ 15 * CHARACTER_WIDTH,11 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_8 {{ 15 * CHARACTER_WIDTH,12 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
};
} /* namespace ui */
+22 -6
View File
@@ -264,17 +264,24 @@ void FileManagerView::on_rename(NavigationView& nav) {
void FileManagerView::on_refactor(NavigationView& nav) {
text_prompt(nav, name_buffer, max_filename_length, [this](std::string& buffer) {
std::string destination_path = current_path.string();
if (destination_path.back() != '/')
destination_path += '/';
destination_path = destination_path + buffer;
rename_file(get_selected_path(), destination_path); //rename the selected file
std::string destination_path = current_path.string();
if (destination_path.back() != '/')//if the path is not ended with '/', add '/'
destination_path += '/';
auto selected_path = get_selected_path();
auto extension = selected_path.extension().string();
if (!extension.empty() && selected_path.string().back() != '/' && extension.substr(1) == "C16") {
if(extension.empty()){// Is Dir
destination_path = destination_path + buffer;
extension_buffer = "";
}else{//is File
destination_path = destination_path + buffer + extension_buffer;
}
rename_file(get_selected_path(), destination_path); //rename the selected file
if (!extension.empty() && selected_path.string().back() != '/' && extension.substr(1) == "C16") { //substr(1) is for ignore the dot
// Rename its partner ( C16 <-> TXT ) file.
auto partner_file_path = selected_path.string().substr(0, selected_path.string().size() - 4) + ".TXT";
destination_path = destination_path.substr(0, destination_path.size() - 4) + ".TXT";
@@ -288,7 +295,9 @@ void FileManagerView::on_refactor(NavigationView& nav) {
load_directory_contents(current_path);
refresh_list();
});
}
void FileManagerView::on_delete() {
@@ -359,6 +368,13 @@ FileManagerView::FileManagerView(
button_refactor.on_select = [this, &nav](Button&) {
name_buffer = entry_list[menu_view.highlighted_index()].entry_path.filename().string().substr(0, max_filename_length);
size_t pos = name_buffer.find_last_of(".");
if (pos != std::string::npos) {
extension_buffer = name_buffer.substr(pos);
name_buffer = name_buffer.substr(0, pos);
}
on_refactor(nav);
};
+3 -2
View File
@@ -67,8 +67,8 @@ protected:
{ ".TXT", &bitmap_icon_file_text, ui::Color::white() },
{ ".PNG", &bitmap_icon_file_image, ui::Color::green() },
{ ".BMP", &bitmap_icon_file_image, ui::Color::green() },
{ ".C8", &bitmap_icon_file_iq, ui::Color::blue() },
{ ".C16", &bitmap_icon_file_iq, ui::Color::blue() },
{ ".C8", &bitmap_icon_file_iq, ui::Color::dark_cyan() },
{ ".C16", &bitmap_icon_file_iq, ui::Color::dark_cyan() },
{ ".WAV", &bitmap_icon_file_wav, ui::Color::dark_magenta() },
{ "", &bitmap_icon_file, ui::Color::light_grey() }
};
@@ -143,6 +143,7 @@ public:
private:
std::string name_buffer { };
std::string extension_buffer { };
void refresh_widgets(const bool v);
void on_rename(NavigationView& nav);
@@ -1,7 +1,6 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2020 euquiq
* Copyright (C) 2023 gullradriel, Nilorea Studio Inc.
*
* This file is part of PortaPack.
*
@@ -39,6 +38,16 @@ namespace ui
baseband::shutdown();
}
// Returns the next multiple of num that is a multiple of multiplier
int64_t GlassView::next_mult_of(int64_t num, int64_t multiplier) {
return ((num / multiplier) + 1) * multiplier;
}
// Returns the previous multiple of num that is a multiple of multiplier
//int64_t GlassView::prev_mult_of(int64_t num, int64_t multiplier) {
// return (num / multiplier) * multiplier;
//}
void GlassView::adjust_range(int64_t* f_min, int64_t* f_max, int64_t width) {
int64_t span = *f_max - *f_min;
int64_t num_intervals = span / width;
@@ -136,7 +145,7 @@ namespace ui
void GlassView::on_channel_spectrum(const ChannelSpectrum &spectrum)
{
baseband::spectrum_streaming_stop();
if( fast_scan )
if( fast_scan || ( LOOKING_GLASS_SLICE_WIDTH < LOOKING_GLASS_SLICE_WIDTH_MAX ) )
{
// Convert bins of this spectrum slice into a representative max_power and when enough, into pixels
// Spectrum.db has 256 bins. Center 12 bins are ignored (DC spike is blanked) Leftmost and rightmost 2 bins are ignored
@@ -168,7 +177,7 @@ namespace ui
if (!pixel_index) // Received indication that a waterfall line has been completed
{
bins_Hz_size = 0; // Since this is an entire pixel line, we don't carry "Pixels into next bin"
f_center = f_center_ini; // Start a new sweep
f_center = f_center_ini - 2 * each_bin_size ; // Start a new sweep
radio::set_tuning_frequency(f_center); // tune rx for this new slice directly, faster than using persistent memory saving
chThdSleepMilliseconds(10);
baseband::spectrum_streaming_start(); // Do the RX
@@ -177,15 +186,14 @@ namespace ui
bins_Hz_size -= marker_pixel_step; // reset bins size, but carrying the eventual excess Hz into next pixel
}
}
f_center += LOOKING_GLASS_SLICE_WIDTH; // Move into the next bandwidth slice NOTE: spectrum.sampling_rate = LOOKING_GLASS_SLICE_WIDTH
f_center += 240 * each_bin_size ; // Move into the next bandwidth slice NOTE: spectrum.sampling_rate = LOOKING_GLASS_SLICE_WIDTH
}
else //slow scan
{
for( int16_t bin = 0 ; bin < 120 ; bin++)
for (uint8_t bin = 0; bin < 120 ; bin++)
{
if (spectrum.db[134 + bin] > max_power) // 134
max_power = spectrum.db[134 + bin];
max_power = spectrum.db[134 + bin];
bins_Hz_size += each_bin_size; // add this bin Hz count into the "pixel fulfilled bag of Hz"
@@ -200,8 +208,8 @@ namespace ui
if (!pixel_index) // Received indication that a waterfall line has been completed
{
bins_Hz_size = 0; // Since this is an entire pixel line, we don't carry "Pixels into next bin"
f_center = f_center_ini; // Start a new sweep
bins_Hz_size = 0; // Since this is an entire pixel line, we don't carry "Pixels into next bin"
f_center = f_center_ini - 2 * each_bin_size ; // Start a new sweep
radio::set_tuning_frequency(f_center); // tune rx for this new slice directly, faster than using persistent memory saving
chThdSleepMilliseconds(10);
baseband::spectrum_streaming_start(); // Do the RX
@@ -210,11 +218,10 @@ namespace ui
bins_Hz_size -= marker_pixel_step; // reset bins size, but carrying the eventual excess Hz into next pixel
}
}
f_center += LOOKING_GLASS_SLICE_WIDTH / 2 ;
f_center += 120 * each_bin_size ;
}
radio::set_tuning_frequency(f_center); // tune rx for this new slice directly, faster than using persistent memory saving
chThdSleepMilliseconds(5);
// receiver_model.set_tuning_frequency(f_center); //tune rx for this slice
baseband::spectrum_streaming_start(); // Do the RX
}
@@ -269,7 +276,20 @@ namespace ui
pixel_index = 0; // reset pixel counter
max_power = 0;
bins_Hz_size = 0; // reset amount of Hz filled up by pixels
if( next_mult_of( (f_max - f_min) , 240 ) <= LOOKING_GLASS_SLICE_WIDTH_MAX )
{
LOOKING_GLASS_SLICE_WIDTH = next_mult_of( (f_max - f_min) , 240 );
receiver_model.set_sampling_rate(LOOKING_GLASS_SLICE_WIDTH);
receiver_model.set_baseband_bandwidth(LOOKING_GLASS_SLICE_WIDTH/2);
}
else if( LOOKING_GLASS_SLICE_WIDTH != LOOKING_GLASS_SLICE_WIDTH_MAX )
{
LOOKING_GLASS_SLICE_WIDTH = LOOKING_GLASS_SLICE_WIDTH_MAX ;
receiver_model.set_sampling_rate(LOOKING_GLASS_SLICE_WIDTH);
receiver_model.set_baseband_bandwidth(LOOKING_GLASS_SLICE_WIDTH);
}
receiver_model.set_squelch_level(0);
each_bin_size = LOOKING_GLASS_SLICE_WIDTH / 240 ;
baseband::set_spectrum(LOOKING_GLASS_SLICE_WIDTH, field_trigger.value());
receiver_model.set_tuning_frequency(f_center_ini); // tune rx for this slice
}
@@ -324,8 +344,8 @@ namespace ui
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 20 )
min_size = 20 ;
if( min_size < 2 )
min_size = 2 ;
if( v > 7200 - min_size )
{
v = 7200 - min_size ;
@@ -347,8 +367,8 @@ namespace ui
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 20 )
min_size = 20 ;
if( min_size < 2 )
min_size = 2 ;
if( freq > (7200 - min_size ) )
freq = 7200 - min_size ;
field_frequency_min.set_value( freq );
@@ -364,8 +384,8 @@ namespace ui
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 20 )
min_size = 20 ;
if( min_size < 2 )
min_size = 2 ;
if( v < min_size )
{
v = min_size ;
@@ -386,8 +406,8 @@ namespace ui
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 20 )
min_size = 20 ;
if( min_size < 2 )
min_size = 2 ;
int32_t freq = f / 1000000 ;
if( freq < min_size )
freq = min_size ;
@@ -37,6 +37,7 @@
namespace ui
{
#define LOOKING_GLASS_SLICE_WIDTH_MAX 19999920
#define MHZ_DIV 1000000
#define X2_MHZ_DIV 2000000
@@ -80,11 +81,16 @@ namespace ui
std::vector<preset_entry> presets_db{};
int64_t LOOKING_GLASS_SLICE_WIDTH = 19999920; // Each slice bandwidth 20 MHz and a multiple of 240
// since we are using LOOKING_GLASS_SLICE_WIDTH/240 as the each_bin_size
// it should also be a multiple of 2 since we are using LOOKING_GLASS_SLICE_WIDTH / 2 as centering freq
// Each slice bandwidth 20 MHz and a multiple of 240
// since we are using LOOKING_GLASS_SLICE_WIDTH/240 as the each_bin_size
// it should also be a multiple of 2 since we are using LOOKING_GLASS_SLICE_WIDTH / 2 as centering freq
int64_t LOOKING_GLASS_SLICE_WIDTH = 19999920;
// frequency rounding helpers
int64_t next_mult_of(int64_t num, int64_t multiplier);
//int64_t prev_mult_of(int64_t num, int64_t multiplier);
void adjust_range(int64_t* f_min, int64_t* f_max, int64_t width);
void on_channel_spectrum(const ChannelSpectrum& spectrum);
void do_timers();
void on_range_changed();
+18 -22
View File
@@ -528,32 +528,28 @@ namespace ui {
}
}
}
}
uint32_t freq_lock = recon_thread->is_freq_lock();
if( freq_lock == 0 ) {
//NO FREQ LOCK, ONGOING STANDARD SCANNING
if( index < 1000 && index < frequency_list.size() )
text_cycle.set_text( to_string_dec_uint( index + 1 , 3 ) );
if(frequency_list[index].description.size() > 0)
{
text_cycle.set_text( to_string_dec_uint( index + 1 , 3 ) );
if(frequency_list[index].description.size() > 0)
switch( frequency_list[current_index].type )
{
switch( frequency_list[current_index].type )
{
case RANGE:
desc_cycle.set( "R: " + frequency_list[current_index].description ); //Show new description
break ;
case HAMRADIO:
desc_cycle.set( "H: " + frequency_list[current_index].description ); //Show new description
break ;
default:
case SINGLE:
desc_cycle.set( "S: " + frequency_list[current_index].description ); //Show new description
break ;
}
case RANGE:
desc_cycle.set( "R: " + frequency_list[current_index].description ); //Show new description
break ;
case HAMRADIO:
desc_cycle.set( "H: " + frequency_list[current_index].description ); //Show new description
break ;
default:
case SINGLE:
desc_cycle.set( "S: " + frequency_list[current_index].description ); //Show new description
break ;
}
}
}
uint32_t freq_lock = recon_thread->is_freq_lock();
if( freq_lock == 0 ) {
//NO FREQ LOCK, ONGOING STANDARD SCANNING
big_display.set_style(&style_white);
if( !userpause )
button_pause.set_text("<PAUSE>");
+17
View File
@@ -434,6 +434,23 @@ namespace ui {
void RSSIGraph::set_nb_columns( int16_t nb )
{
nb_columns = nb ;
while( graph_list.size() > nb_columns )
{
graph_list.erase( graph_list.begin() );
}
}
void RSSIGraph::on_hide() {
nb_columns_before_hide = nb_columns ;
nb_columns = 1 ;
while( graph_list.size() > nb_columns )
{
graph_list.erase( graph_list.begin() );
}
}
void RSSIGraph::on_show() {
nb_columns = nb_columns_before_hide ;
}
void RSSI::on_focus() {
+4
View File
@@ -115,8 +115,12 @@ namespace ui {
void paint(Painter& painter) override;
void add_values(int16_t rssi_min, int16_t rssi_avg, int16_t rssi_max, int16_t db );
void set_nb_columns( int16_t nb );
void on_hide() override ;
void on_show() override ;
private:
uint16_t nb_columns_before_hide = 16 ;
uint16_t nb_columns = 16 ;
RSSIGraphList graph_list { } ;
};
+1
View File
@@ -139,6 +139,7 @@ set(CPPSRC
${COMMON}/chibios_cpp.cpp
debug.cpp
${COMMON}/gcc.cpp
${COMMON}/performance_counter.cpp
tone_gen.cpp
)
+9
View File
@@ -20,6 +20,7 @@
*/
#include "baseband_dma.hpp"
#include "portapack_shared_memory.hpp"
#include <cstdint>
#include <cstddef>
@@ -103,8 +104,12 @@ static constexpr auto& gpdma_channel_sgpio = gpdma::channels[portapack::sgpio_gp
static ThreadWait thread_wait;
volatile uint32_t buffer_transfered = 0;
volatile uint32_t buffer_handled = 0;
static void transfer_complete() {
const auto next_lli_index = gpdma_channel_sgpio.next_lli() - &lli_loop[0];
buffer_transfered++;
thread_wait.wake_from_interrupt(next_lli_index);
}
@@ -158,6 +163,10 @@ void disable() {
baseband::buffer_t wait_for_buffer() {
const auto next_index = thread_wait.sleep();
buffer_handled++;
auto buffer_missed = buffer_transfered - buffer_handled;
shared_memory.m4_buffer_missed = buffer_missed;
if( next_index >= 0 ) {
const size_t free_index = (next_index + transfers_per_buffer - 2) & transfers_mask;
+8 -14
View File
@@ -26,6 +26,7 @@
#include <hal.h>
#include "portapack_shared_memory.hpp"
#include "performance_counter.hpp"
void write_m4_panic_msg(const char *panic_message, struct extctx *ctxp) {
if (ctxp == nullptr) {
@@ -120,29 +121,22 @@ void update_performance_counters() {
auto performance_counter_active = shared_memory.request_m4_performance_counter;
if (performance_counter_active == 0x00)
return;
static bool last_paint_state = false;
if ((((chTimeNow()>>10) & 0x01) == 0x01) == last_paint_state)
return;
// Idle thread state is sometimes unuseable
if (chThdGetTicks(chSysGetIdleThread()) > 0x10000000)
return;
last_paint_state = !last_paint_state;
auto now = chTimeNow();
auto idle_ticks = chThdGetTicks(chSysGetIdleThread());
static systime_t last_time;
static systime_t last_last_time;
auto time_elapsed = now - last_time;
auto idle_elapsed = idle_ticks - last_last_time;
last_time = now;
last_last_time = idle_ticks;
auto cpu_usage = (time_elapsed - idle_elapsed) / 10;
auto utilisation = get_cpu_utilisation_in_percent();
auto free_stack = (uint32_t)get_free_stack_space();
auto free_heap = chCoreStatus();
shared_memory.m4_cpu_usage = cpu_usage;
shared_memory.m4_cpu_usage = utilisation;
shared_memory.m4_stack_usage = free_stack;
shared_memory.m4_heap_usage = free_heap;
}
+6
View File
@@ -83,6 +83,12 @@ SSB::SSB() : hilbert() {
}
void SSB::execute(const buffer_s16_t& audio, const buffer_c8_t& buffer, bool& configured_in, uint32_t& new_beep_index, uint32_t& new_beep_timer,TXProgressMessage& new_txprogress_message, AudioLevelReportMessage& new_level_message, uint32_t& new_power_acc_count, uint32_t& new_divider ) {
//unused
(void)configured_in ;
(void)new_beep_index ;
(void)new_beep_timer ;
(void)new_txprogress_message ;
// No way to activate correctly the roger beep in this option, Maybe not enough M4 CPU power , Let's block roger beep in SSB selection by now .
int32_t sample = 0;
int8_t re = 0, im = 0;
+8
View File
@@ -87,6 +87,7 @@ void ERTProcessor::consume_symbol(
) {
const uint_fast8_t sliced_symbol = (raw_symbol >= 0.0f) ? 1 : 0;
scm_builder.execute(sliced_symbol);
scmplus_builder.execute(sliced_symbol);
idm_builder.execute(sliced_symbol);
}
@@ -97,6 +98,13 @@ void ERTProcessor::scm_handler(
shared_memory.application_queue.push(message);
}
void ERTProcessor::scmplus_handler(
const baseband::Packet& packet
) {
const ERTPacketMessage message { ert::Packet::Type::SCMPLUS, packet };
shared_memory.application_queue.push(message);
}
void ERTProcessor::idm_handler(
const baseband::Packet& packet
) {
+15 -1
View File
@@ -44,10 +44,14 @@ constexpr uint64_t scm_preamble_and_sync_manchester { 0b101010101001011001100110
constexpr size_t scm_preamble_and_sync_length { 42 - 10 };
constexpr size_t scm_payload_length_max { 150 };
// ''.join(['%d%d' % (c, 1-c) for c in map(int, bin(0x16a3)[2:].zfill(16))])
constexpr uint64_t scmplus_preamble_and_sync_manchester { 0b01010110011010011001100101011010 };
constexpr size_t scmplus_preamble_and_sync_length { 32 - 0 };
constexpr size_t scmplus_payload_length_max { 224 };
// ''.join(['%d%d' % (c, 1-c) for c in map(int, bin(0x555516a3)[2:].zfill(32))])
constexpr uint64_t idm_preamble_and_sync_manchester { 0b0110011001100110011001100110011001010110011010011001100101011010 };
constexpr size_t idm_preamble_and_sync_length { 64 - 16 };
constexpr size_t idm_payload_length_max { 1408 };
class ERTProcessor : public BasebandProcessor {
@@ -80,6 +84,15 @@ private:
}
};
PacketBuilder<BitPattern, NeverMatch, FixedLength> scmplus_builder {
{ scmplus_preamble_and_sync_manchester, scmplus_preamble_and_sync_length, 1 },
{ },
{ scmplus_payload_length_max },
[this](const baseband::Packet& packet) {
this->scmplus_handler(packet);
}
};
PacketBuilder<BitPattern, NeverMatch, FixedLength> idm_builder {
{ idm_preamble_and_sync_manchester, idm_preamble_and_sync_length, 1 },
{ },
@@ -91,6 +104,7 @@ private:
void consume_symbol(const float symbol);
void scm_handler(const baseband::Packet& packet);
void scmplus_handler(const baseband::Packet& packet);
void idm_handler(const baseband::Packet& packet);
float sum_half_period[2];
+12 -2
View File
@@ -47,6 +47,9 @@ ID Packet::id() const {
const auto lsb = reader_.read(35, 24);
return (msb << 24) | lsb;
}
if( type() == Type::SCMPLUS ) {
return reader_.read(2 * 8, 32);
}
if( type() == Type::IDM ) {
return reader_.read(5 * 8, 32);
}
@@ -57,6 +60,9 @@ Consumption Packet::consumption() const {
if( type() == Type::SCM ) {
return reader_.read(11, 24);
}
if( type() == Type::SCMPLUS ) {
return reader_.read(6 * 8, 32);
}
if( type() == Type::IDM ) {
return reader_.read(25 * 8, 32);
}
@@ -67,6 +73,9 @@ CommodityType Packet::commodity_type() const {
if( type() == Type::SCM ) {
return reader_.read(5, 4);
}
if( type() == Type::SCMPLUS ) {
return reader_.read(1 * 8 + 4, 4);
}
if( type() == Type::IDM ) {
return reader_.read(4 * 8 + 4, 4);
}
@@ -80,7 +89,8 @@ FormattedSymbols Packet::symbols_formatted() const {
bool Packet::crc_ok() const {
switch(type()) {
case Type::SCM: return crc_ok_scm();
case Type::IDM: return crc_ok_idm();
case Type::SCMPLUS:
case Type::IDM: return crc_ok_ccitt();
default: return false;
}
}
@@ -95,7 +105,7 @@ bool Packet::crc_ok_scm() const {
return ert_bch.checksum() == 0x0000;
}
bool Packet::crc_ok_idm() const {
bool Packet::crc_ok_ccitt() const {
CRC<16> ert_crc_ccitt { 0x1021, 0xffff, 0x1d0f };
for(size_t i=0; i<length(); i+=8) {
ert_crc_ccitt.process_byte(reader_.read(i, 8));
+2 -1
View File
@@ -45,6 +45,7 @@ public:
Unknown = 0,
IDM = 1,
SCM = 2,
SCMPLUS = 3,
};
Packet(
@@ -80,7 +81,7 @@ private:
const Reader reader_;
const Type type_;
bool crc_ok_idm() const;
bool crc_ok_ccitt() const;
bool crc_ok_scm() const;
};
+57
View File
@@ -0,0 +1,57 @@
/*
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "performance_counter.hpp"
#include "ch.h"
uint8_t get_cpu_utilisation_in_percent() {
static systime_t last_time = 0;
static systime_t last_idle_ticks = 0;
auto now = chTimeNow();
auto idle_ticks = chThdGetTicks(chSysGetIdleThread());
if (last_time == 0) {
last_time = now;
last_idle_ticks = idle_ticks;
return 0;
}
int32_t time_elapsed = now - last_time;
int32_t idle_elapsed = idle_ticks - last_idle_ticks;
int32_t working_ticks = time_elapsed - idle_elapsed;
if (working_ticks < 0)
working_ticks = 0;
auto utilisation = working_ticks * 100 / time_elapsed;
last_time = now;
last_idle_ticks = idle_ticks;
if (utilisation > 100) {
return 100;
}
return (uint8_t) utilisation;
}
+29
View File
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __PERFORMANCE_COUNTER_H__
#define __PERFORMANCE_COUNTER_H__
#include <stdint.h>
uint8_t get_cpu_utilisation_in_percent();
#endif /* __PERFORMANCE_COUNTER_H__ */
@@ -69,6 +69,7 @@ struct SharedMemory {
uint8_t volatile m4_cpu_usage{ 0 };
uint16_t volatile m4_stack_usage{ 0 };
uint16_t volatile m4_heap_usage{ 0 };
uint16_t volatile m4_buffer_missed{ 0 };
};
extern SharedMemory& shared_memory;
+2
View File
@@ -12,4 +12,6 @@ pause
echo.
hackrf_update.exe portapack-h1_h2-mayhem.bin
echo.
echo If your device never boot after flashing, please refer to https://github.com/eried/portapack-mayhem/wiki/Won't-boot
echo.
pause
+62
View File
@@ -0,0 +1,62 @@
f=88200000,m=WFM,bw=200k,d=RMF Polkowice
f=88200000,m=WFM,bw=200k,d=RMF Kielce
f=89200000,m=WFM,bw=200k,d=RMF Bielsko-Biala
f=89300000,m=WFM,bw=200k,d=RMF Lublin
f=89300000,m=WFM,bw=200k,d=RMF Koszalin
f=90600000,m=WFM,bw=200k,d=RMF Warsaw
f=91000000,m=WFM,bw=200k,d=RMF Warsaw
f=91300000,m=WFM,bw=200k,d=RMF Łobez
f=91500000,m=WFM,bw=200k,d=RMF Ostroleka
f=91700000,m=WFM,bw=200k,d=RMF Wagrowiec
f=91900000,m=WFM,bw=200k,d=RMF Siedlce
f=92500000,m=WFM,bw=200k,d=NRK Oslo
f=92600000,m=WFM,bw=200k,d=RMF Elbląg
f=92900000,m=WFM,bw=200k,d=RMF Wroclaw
f=93000000,m=WFM,bw=200k,d=RMF Katowice
f=93300000,m=WFM,bw=200k,d=RMF Bydgoszcz
f=93500000,m=WFM,bw=200k,d=RMF Lodz
f=93600000,m=WFM,bw=200k,d=RMF Ryki
f=93800000,m=WFM,bw=200k,d=RMF Luban
f=94300000,m=WFM,bw=200k,d=RMF Płock
f=94600000,m=WFM,bw=200k,d=RMF Poznan
f=94800000,m=WFM,bw=200k,d=NRK Bergen
f=94800000,m=WFM,bw=200k,d=RMF Zagan
f=95100000,m=WFM,bw=200k,d=RMF Suwałki
f=95300000,m=WFM,bw=200k,d=RMF Olsztyn
f=95400000,m=WFM,bw=200k,d=RMF Tarnow
f=96000000,m=WFM,bw=200k,d=RMF Krakow
f=96100000,m=WFM,bw=200k,d=RMF Legnica
f=96100000,m=WFM,bw=200k,d=RMF Gorzow Wielkopolski
f=96400000,m=WFM,bw=200k,d=RMF Bialogard
f=96600000,m=WFM,bw=200k,d=RMF Walcz
f=97100000,m=WFM,bw=200k,d=RMF Włoszczowa
f=97200000,m=WFM,bw=200k,d=NRK Melhus
f=98000000,m=WFM,bw=200k,d=RMF Kalisz
f=98400000,m=WFM,bw=200k,d=RMF Gdansk
f=98600000,m=WFM,bw=200k,d=NRK Arendal
f=98900000,m=WFM,bw=200k,d=RMF Konin
f=99300000,m=WFM,bw=200k,d=RMF Opole
f=99500000,m=WFM,bw=200k,d=RMF Kluczbork
f=100100000,m=WFM,bw=200k,d=RMF Rzeszow
f=100200000,m=WFM,bw=200k,d=RMF Bialystok
f=100800000,m=WFM,bw=200k,d=RMF Jelenia Gora
f=100900000,m=WFM,bw=200k,d=RMF Slupsk
f=101100000,m=WFM,bw=200k,d=RMF Solina
f=101200000,m=WFM,bw=200k,d=RMF Swinoujscie
f=101600000,m=WFM,bw=200k,d=RMF Klodzko
f=101800000,m=WFM,bw=200k,d=RMF Zakopane
f=101800000,m=WFM,bw=200k,d=RMF Leżajsk
f=102000000,m=WFM,bw=200k,d=RMF Gizycko
f=102900000,m=WFM,bw=200k,d=RMF Walbrzych
f=103200000,m=WFM,bw=200k,d=RMF Szczawnica
f=103400000,m=WFM,bw=200k,d=RMF Przemyśl
f=103400000,m=WFM,bw=200k,d=RMF Lebork
f=104700000,m=WFM,bw=200k,d=RMF Rabka
f=104900000,m=WFM,bw=200k,d=RMF Koszalin
f=105900000,m=WFM,bw=200k,d=RMF Krynica
f=105900000,m=WFM,bw=200k,d=RMF Czestochowa
f=106400000,m=WFM,bw=200k,d=RMF Zielona Gora
f=106500000,m=WFM,bw=200k,d=RMF Elk
f=106700000,m=WFM,bw=200k,d=RMF Szczecin
f=107400000,m=WFM,bw=200k,d=RMF Iława
f=107700000,m=WFM,bw=200k,d=RMF Zamosc
+5
View File
@@ -0,0 +1,5 @@
f=863000000,d=WaterMeter
f=868000000,d=WaterMeter: ETW-ECO, Zenner
f=868600000,d=WaterMeter: Ecomess
f=868950000,d=WaterMeter: Apator/Santech/Techem
f=874400000,d=WaterMeter
+17 -13
View File
@@ -1,18 +1,22 @@
# INI,END,DESCRIPTION
# (Freq range in MHz, min separation 240MHz)
# INI,END,DESCRIPTION
# (Freq range in MHz, min separation 3MHz)
# (Description up to 20 char)
# (fields comma delimiter)
260,500,315/433 MHz KEYFOBS
2320,2560,BL / WIFI 2.4GHz
5160,5900,WIFI 5GHz
10,7250,FULL RANGE
140,380,VHF MICS AND MARINE
260,500,315/433 MHz KEYFOBS
390,420,RADIOSONDES
420,660,UHF MICS
# https://www.fcc.gov/wireless/bureau-divisions/mobility-division/paging
35,36,USA PAGERS 35
43,44,USA PAGERS 44
152,159,USA PAGERS 152
454,460,USA PAGERS 454
929,932,USA PAGERS 930
# WATER METERS
850,900,Water meters
902,928,ISM 900MHz
# PAGERS https://www.fcc.gov/wireless/bureau-divisions/mobility-division/paging
34,36,USA PAGERS 35
43,45,USA PAGERS 44
151,153,USA PAGERS 152
453,454,USA PAGERS 454
929,931,USA PAGERS 930
# WIFI
2320,2560,BL / WIFI 2.4GHz
5160,5900,WIFI 5GHz
# FULL
10,7250,FULL RANGE