mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-03 20:24:13 -04:00
Fixed freeze in TouchTunes scan
Made adsb_map.py compatible with Python 3
This commit is contained in:
parent
d517bc31ec
commit
196518457f
8 changed files with 80 additions and 37 deletions
|
@ -27,6 +27,7 @@
|
|||
//TEST: Check AFSK transmit end, skips last bits ?
|
||||
//TEST: Imperial in whipcalc
|
||||
|
||||
//BUG: Auto backlight off doesn't work anymore
|
||||
//BUG: CPLD-related rx ok, tx bad, see portapack.cpp lines 214+ to disable CPLD overlay
|
||||
//BUG: REPLAY See what's wrong with quality (format, or need for interpolation filter ?)
|
||||
//BUG: SCANNER Lock on frequency, if frequency jump, still locked on first one
|
||||
|
@ -59,24 +60,7 @@ Continuous (Fox-oring)
|
|||
60s transmit, 240s space (Classic 1/5 min)
|
||||
60s transmit, 360s space (Classic 1/7 min)
|
||||
*/
|
||||
<<<<<<< ./firmware/application/main_LOCAL_5232.cpp
|
||||
||||||| ./firmware/application/main_BASE_5232.cpp
|
||||
//TODO: Use TransmitterView in TEDI/LCR, Numbers, ...
|
||||
=======
|
||||
//TODO: Use TransmitterView in TEDI/LCR, Numbers, ...
|
||||
//TODO: Use TransmitterView in TEDI/LCR, Numbers, ...
|
||||
>>>>>>> ./firmware/application/main_REMOTE_5232.cpp
|
||||
//TODO: FreqMan: Remove and rename categories
|
||||
<<<<<<< ./firmware/application/main_LOCAL_5232.cpp
|
||||
||||||| ./firmware/application/main_BASE_5232.cpp
|
||||
//TODO: Wav visualizer
|
||||
//TODO: File browser view ?
|
||||
=======
|
||||
//TODO: Wav visualizer
|
||||
//TODO: File browser view ?
|
||||
//TODO: Wav visualizer
|
||||
//TODO: File browser view ?
|
||||
>>>>>>> ./firmware/application/main_REMOTE_5232.cpp
|
||||
//TODO: Mousejack ?
|
||||
//TODO: Move frequencykeypad from ui_receiver to ui_widget (used everywhere)
|
||||
//TODO: ADS-B draw trajectory + GPS coordinates + scale, and playback
|
||||
|
|
|
@ -204,10 +204,10 @@ SoundBoardView::SoundBoardView(
|
|||
sounds[c].size = reader->data_size();
|
||||
sounds[c].sample_duration = reader->data_size(); // / (reader->bits_per_sample() / 8);
|
||||
sounds[c].sample_rate = reader->sample_rate();
|
||||
/*if (reader->bits_per_sample() > 8)
|
||||
sounds[c].sixteenbit = true;
|
||||
else
|
||||
sounds[c].sixteenbit = false;*/
|
||||
//if (reader->bits_per_sample() > 8)
|
||||
// sounds[c].sixteenbit = true;
|
||||
//else
|
||||
// sounds[c].sixteenbit = false;
|
||||
sounds[c].ms_duration = reader->ms_duration();
|
||||
sounds[c].path = u"WAV/" + path.native();
|
||||
title = reader->title().substr(0, 20);
|
||||
|
|
|
@ -28,6 +28,16 @@ using namespace portapack;
|
|||
|
||||
#include "string_format.hpp"
|
||||
|
||||
void TestLogger::log_raw_data(const testapp::Packet& packet, const int32_t alt) {
|
||||
std::string entry = to_string_dec_uint(packet.value()) + " " + to_string_dec_int(alt);
|
||||
|
||||
// Raw hex dump
|
||||
//for (size_t c = 0; c < 10; c++)
|
||||
// entry += to_string_hex(packet[c], 8) + " ";
|
||||
|
||||
log_file.write_entry(packet.received_at(), entry);
|
||||
}
|
||||
|
||||
namespace ui {
|
||||
|
||||
TestView::TestView(NavigationView& nav) {
|
||||
|
@ -41,7 +51,9 @@ TestView::TestView(NavigationView& nav) {
|
|||
&field_vga,
|
||||
&rssi,
|
||||
&text_debug_a,
|
||||
&text_debug_b
|
||||
&text_debug_b,
|
||||
&button_cal,
|
||||
&check_log
|
||||
});
|
||||
|
||||
field_frequency.set_value(target_frequency_);
|
||||
|
@ -59,6 +71,19 @@ TestView::TestView(NavigationView& nav) {
|
|||
};
|
||||
};
|
||||
|
||||
check_log.on_select = [this](Checkbox&, bool v) {
|
||||
logging = v;
|
||||
};
|
||||
|
||||
button_cal.on_select = [this](Button&) {
|
||||
cal_value = raw_alt - 0x80;
|
||||
};
|
||||
|
||||
|
||||
logger = std::make_unique<TestLogger>();
|
||||
if (logger)
|
||||
logger->append("saucepan.txt");
|
||||
|
||||
radio::enable({
|
||||
tuning_frequency(),
|
||||
sampling_rate,
|
||||
|
@ -85,7 +110,7 @@ void TestView::on_packet(const testapp::Packet& packet) {
|
|||
|
||||
packet_count++;
|
||||
uint32_t diff = ((v - 1) - prev_v);
|
||||
if (diff < 20)
|
||||
if (diff < 50)
|
||||
packets_lost += diff;
|
||||
prev_v = v;
|
||||
|
||||
|
@ -93,14 +118,18 @@ void TestView::on_packet(const testapp::Packet& packet) {
|
|||
|
||||
text_debug_b.set(to_string_dec_uint((packets_lost * 1000) / packet_count) + " per 1000");
|
||||
|
||||
display.draw_pixel(Point(cur_x, 4 * 16 + (256 - packet.alt())), Color::white());
|
||||
raw_alt = packet.alt();
|
||||
display.draw_pixel(Point(cur_x, 4 * 16 + (256 - ((raw_alt - cal_value) / 4))), Color::white());
|
||||
|
||||
cur_x++;
|
||||
if (cur_x >= 240) {
|
||||
display.fill_rectangle(Rect(0, 4 * 16, 240, 256), Color::black());
|
||||
display.fill_rectangle(Rect(0, 5 * 16, 240, 256), Color::black());
|
||||
cur_x = 0;
|
||||
}
|
||||
|
||||
if (logger && logging)
|
||||
logger->log_raw_data(packet, raw_alt - cal_value);
|
||||
|
||||
//radio::disable();
|
||||
|
||||
/*text_serial.set(packet.serial_number());
|
||||
|
|
|
@ -30,15 +30,28 @@
|
|||
#include "event_m0.hpp"
|
||||
|
||||
#include "test_packet.hpp"
|
||||
#include "log_file.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
class TestLogger {
|
||||
public:
|
||||
Optional<File::Error> append(const std::string& filename) {
|
||||
return log_file.append(filename);
|
||||
}
|
||||
|
||||
void log_raw_data(const testapp::Packet& packet, const int32_t alt);
|
||||
|
||||
private:
|
||||
LogFile log_file { };
|
||||
};
|
||||
|
||||
namespace ui {
|
||||
|
||||
class TestView : public View {
|
||||
public:
|
||||
static constexpr uint32_t sampling_rate = 2457600;
|
||||
static constexpr uint32_t sampling_rate = 2457600*2;
|
||||
static constexpr uint32_t baseband_bandwidth = 1750000;
|
||||
|
||||
TestView(NavigationView& nav);
|
||||
|
@ -49,11 +62,14 @@ public:
|
|||
std::string title() const override { return "Test app"; };
|
||||
|
||||
private:
|
||||
uint32_t target_frequency_ { 439255000 };
|
||||
uint32_t target_frequency_ { 439206000 };
|
||||
Coord cur_x { 0 };
|
||||
uint32_t packet_count { 0 };
|
||||
uint32_t packets_lost { 0 };
|
||||
uint32_t prev_v { 0 };
|
||||
uint32_t raw_alt { 0 };
|
||||
uint32_t cal_value { 0 };
|
||||
bool logging { false };
|
||||
|
||||
Labels labels {
|
||||
{ { 0 * 8, 1 * 16 }, "Data:", Color::light_grey() }
|
||||
|
@ -79,13 +95,25 @@ private:
|
|||
};
|
||||
|
||||
Text text_debug_a {
|
||||
{ 0 * 8, 2 * 16, 30 * 8, 16 },
|
||||
{ 0 * 8, 4 * 16, 30 * 8, 16 },
|
||||
"..."
|
||||
};
|
||||
Text text_debug_b {
|
||||
{ 0 * 8, 3 * 16, 30 * 8, 16 },
|
||||
{ 0 * 8, 5 * 16, 30 * 8, 16 },
|
||||
"..."
|
||||
};
|
||||
|
||||
Button button_cal {
|
||||
{ 17 * 8, 2 * 16, 5 * 8, 2 * 16 },
|
||||
"CAL"
|
||||
};
|
||||
Checkbox check_log {
|
||||
{ 23 * 8, 2 * 16 },
|
||||
3,
|
||||
"LOG"
|
||||
};
|
||||
|
||||
std::unique_ptr<TestLogger> logger { };
|
||||
|
||||
MessageHandlerRegistration message_handler_packet {
|
||||
Message::ID::TestAppPacket,
|
||||
|
|
|
@ -62,6 +62,7 @@ void TouchTunesView::on_tx_progress(const uint32_t progress, const bool done) {
|
|||
if (pin == TOUCHTUNES_MAX_PIN) {
|
||||
stop_tx();
|
||||
} else {
|
||||
transmitter_model.disable();
|
||||
pin++;
|
||||
field_pin.set_value(pin);
|
||||
start_tx(scan_button_index);
|
||||
|
@ -71,9 +72,9 @@ void TouchTunesView::on_tx_progress(const uint32_t progress, const bool done) {
|
|||
}
|
||||
|
||||
void TouchTunesView::start_tx(const uint32_t button_index) {
|
||||
std::string fragments;
|
||||
std::string fragments = { "" };
|
||||
size_t bit;
|
||||
uint64_t frame_data { 0 };
|
||||
uint64_t frame_data;
|
||||
|
||||
if (check_scan.value()) {
|
||||
scan_button_index = button_index;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue