Compare commits

...

15 Commits

Author SHA1 Message Date
Erwin Ried 98ba332cda Version bump 2020-09-25 03:34:51 +02:00
Erwin Ried f3503e6844 Fix for the freezing when no on_touch_release function 2020-09-25 03:34:05 +02:00
Erwin Ried 883a62238d Version bump 2020-09-24 22:04:59 +02:00
Erwin Ried 9021e43041 Create FUNDING.yml 2020-09-24 11:06:30 +02:00
Erwin Ried e75dfdaf2d Merge pull request #196 from strijar/morse_tx
Bug fix
2020-09-24 10:33:06 +02:00
Белоусов Олег cafc4fdec4 Bug fix 2020-09-24 11:04:00 +03:00
Erwin Ried 99af859e13 Default null for on touch release and press
Fixes https://github.com/eried/portapack-mayhem/issues/194
2020-09-24 03:15:40 +02:00
Erwin Ried 4f2b306784 Merge pull request #195 from strijar/morse_tx
Morse TX - speed in WPS and repeat loop
2020-09-22 21:54:51 +02:00
Белоусов Олег 25ba2f1391 Morse TX loops 2020-09-22 16:12:46 +03:00
Белоусов Олег a5a3ba184a Morse TX speed in WPS 2020-09-22 11:46:44 +03:00
Erwin Ried 17cb092978 Merge pull request #191 from dqs105/siggen_fix
SigGen "Stop after" freeze fix & stronger CW signal
2020-09-20 15:08:26 +02:00
Erwin Ried 1ff027ed01 Merge pull request #192 from RobertoD91/next
Add VHF marine frequence on SD
2020-09-20 15:06:22 +02:00
dqs105 e89b7683ef Fixed "Stop After" freeze & stronger CW signal 2020-09-19 14:24:40 +08:00
dqs105 1029322405 Fix "Stop After" Freeze. 2020-09-19 14:22:28 +08:00
Roberto d280054093 Add VHF marine frequence on SD 2020-09-19 00:10:53 +02:00
8 changed files with 228 additions and 18 deletions
+12
View File
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://salt.bountysource.com/checkout/amount?team=portapack-mayhem
+63 -7
View File
@@ -69,6 +69,25 @@ static msg_t ookthread_fn(void * arg) {
return 0;
}
static msg_t loopthread_fn(void * arg) {
MorseView * arg_c = (MorseView*)arg;
uint32_t wait = arg_c->loop;
chRegSetThreadName("loopthread");
for (uint32_t i = 0; i < wait; i++) {
if (chThdShouldTerminate()) break;
arg_c->on_loop_progress(i, false);
chThdSleepMilliseconds(1000);
}
arg_c->on_loop_progress(0, true);
chThdExit(0);
return 0;
}
void MorseView::on_set_text(NavigationView& nav) {
text_prompt(nav, buffer, 28);
}
@@ -115,9 +134,9 @@ bool MorseView::start_tx() {
void MorseView::update_tx_duration() {
uint32_t duration_ms;
time_unit_ms = field_time_unit.value();
time_unit_ms = 1200 / field_speed.value();
symbol_count = morse_encode(message, time_unit_ms, field_tone.value(), &time_units);
if (symbol_count) {
duration_ms = time_units * time_unit_ms;
text_tx_duration.set(to_string_dec_uint(duration_ms / 1000) + "." + to_string_dec_uint((duration_ms / 100) % 10, 1) + "s ");
@@ -130,7 +149,28 @@ void MorseView::on_tx_progress(const uint32_t progress, const bool done) {
if (done) {
transmitter_model.disable();
progressbar.set_value(0);
tx_view.set_transmitting(false);
if (loop && run) {
text_tx_duration.set("wait");
progressbar.set_max(loop);
progressbar.set_value(0);
if (loopthread) {
chThdRelease(loopthread);
loopthread = nullptr;
}
loopthread = chThdCreateFromHeap(NULL, 1024, NORMALPRIO, loopthread_fn, this);
} else {
tx_view.set_transmitting(false);
}
} else
progressbar.set_value(progress);
}
void MorseView::on_loop_progress(const uint32_t progress, const bool done) {
if (done) {
start_tx();
} else
progressbar.set_value(progress);
}
@@ -152,9 +192,10 @@ MorseView::MorseView(
&labels,
&checkbox_foxhunt,
&options_foxhunt,
&field_time_unit,
&field_speed,
&field_tone,
&options_modulation,
&options_loop,
&text_tx_duration,
&text_message,
&button_message,
@@ -163,9 +204,10 @@ MorseView::MorseView(
});
// Default settings
field_time_unit.set_value(50); // 50ms unit
field_speed.set_value(15); // 15wps
field_tone.set_value(700); // 700Hz FM tone
options_modulation.set_selected_index(0); // CW mode
options_loop.set_selected_index(0); // Off
checkbox_foxhunt.on_select = [this](Checkbox&, bool value) {
foxhunt_mode = value;
@@ -182,8 +224,12 @@ MorseView::MorseView(
options_modulation.on_change = [this](size_t i, int32_t) {
modulation = (modulation_t)i;
};
options_loop.on_change = [this](size_t i, uint32_t n) {
loop = n;
};
field_time_unit.on_change = [this](int32_t) {
field_speed.on_change = [this](int32_t) {
update_tx_duration();
};
@@ -199,12 +245,22 @@ MorseView::MorseView(
};
tx_view.on_start = [this]() {
if (start_tx())
if (start_tx()) {
run = true;
tx_view.set_transmitting(true);
}
};
tx_view.on_stop = [this]() {
run = false;
if (ookthread) chThdTerminate(ookthread);
if (loopthread) {
chThdTerminate(loopthread);
chThdWait(loopthread);
loopthread = nullptr;
}
transmitter_model.disable();
baseband::kill_tone();
tx_view.set_transmitting(false);
+23 -4
View File
@@ -54,11 +54,13 @@ public:
void paint(Painter& painter) override;
void on_tx_progress(const uint32_t progress, const bool done);
void on_loop_progress(const uint32_t progress, const bool done);
std::string title() const override { return "Morse TX"; };
uint32_t time_unit_ms { 0 };
size_t symbol_count { 0 };
uint32_t loop { 0 };
private:
NavigationView& nav_;
std::string buffer { "PORTAPACK" };
@@ -77,12 +79,15 @@ private:
void set_foxhunt(size_t i);
Thread * ookthread { nullptr };
Thread * loopthread { nullptr };
bool foxhunt_mode { false };
bool run { false };
Labels labels {
{ { 4 * 8, 6 * 8 }, "Time unit: ms", Color::light_grey() },
{ { 4 * 8, 6 * 8 }, "Speed: wps", Color::light_grey() },
{ { 4 * 8, 8 * 8 }, "Tone: Hz", Color::light_grey() },
{ { 4 * 8, 10 * 8 }, "Modulation:", Color::light_grey() },
{ { 4 * 8, 12 * 8 }, "Loop:", Color::light_grey() },
{ { 1 * 8, 25 * 8 }, "TX will last", Color::light_grey() }
};
@@ -109,10 +114,10 @@ private:
}
};
NumberField field_time_unit {
{ 14 * 8, 6 * 8 },
NumberField field_speed {
{ 10 * 8, 6 * 8 },
3,
{ 10, 999 },
{ 10, 45 },
1,
' '
};
@@ -133,6 +138,20 @@ private:
{ "FM", 1 }
}
};
OptionsField options_loop {
{ 9 * 8, 12 * 8 },
6,
{
{ "Off", 0 },
{ "5 sec", 5 },
{ "10 sec", 10 },
{ "30 sec", 30 },
{ "1 min", 60 },
{ "3 min", 180 },
{ "5 min", 300 }
}
};
Text text_tx_duration {
{ 14 * 8, 25 * 8, 4 * 8, 16 },
+10 -2
View File
@@ -43,7 +43,11 @@ SigGenView::~SigGenView() {
}
void SigGenView::update_config() {
baseband::set_siggen_config(transmitter_model.channel_bandwidth(), options_shape.selected_index_value(), field_stop.value());
if(checkbox_stop.value())
baseband::set_siggen_config(transmitter_model.channel_bandwidth(), options_shape.selected_index_value(), field_stop.value());
else
baseband::set_siggen_config(transmitter_model.channel_bandwidth(), options_shape.selected_index_value(), 0);
}
void SigGenView::update_tone() {
@@ -68,8 +72,10 @@ void SigGenView::start_tx() {
void SigGenView::on_tx_progress(const uint32_t progress, const bool done) {
(void) progress;
if (done)
if (done) {
transmitter_model.disable();
tx_view.set_transmitting(false);
}
}
SigGenView::SigGenView(
@@ -98,6 +104,8 @@ SigGenView::SigGenView(
options_shape.set_selected_index(0);
text_shape.set(shape_strings[0]);
field_stop.set_value(1);
symfield_tone.set_sym(1, 1); // Default: 1000 Hz
symfield_tone.on_change = [this]() {
if (auto_update)
+1 -1
View File
@@ -213,7 +213,7 @@ public:
InformationView(NavigationView& nav);
private:
static constexpr auto version_string = "v1.2.1";
static constexpr auto version_string = "v1.2.3";
NavigationView& nav_;
Rectangle backdrop {
+2 -1
View File
@@ -33,6 +33,7 @@ void SigGenProcessor::execute(const buffer_c8_t& buffer) {
for (size_t i = 0; i < buffer.count; i++) {
if (!sample_count && auto_off) {
configured = false;
txprogress_message.done = true;
shared_memory.application_queue.push(txprogress_message);
} else
@@ -40,7 +41,7 @@ void SigGenProcessor::execute(const buffer_c8_t& buffer) {
if (tone_shape == 0) {
// CW
re = 0;
re = 127;
im = 0;
} else {
+3 -3
View File
@@ -913,12 +913,12 @@ bool Button::on_touch(const TouchEvent event) {
case TouchEvent::Type::End:
set_highlighted(false);
set_dirty();
if( on_select && !instant_exec_ ) {
on_select(*this);
}
if( on_touch_release) {
on_touch_release(*this);
}
if( on_select && !instant_exec_ ) {
on_select(*this);
}
return true;
default:
+114
View File
@@ -0,0 +1,114 @@
f=160650000,d=VHF CH01 RX
f=156050000,d=VHF CH01 TX
f=160700000,d=VHF CH02 RX
f=156100000,d=VHF CH02 TX
f=160750000,d=VHF CH03 RX
f=156150000,d=VHF CH03 TX
f=160800000,d=VHF CH04 RX
f=156200000,d=VHF CH04 TX
f=160850000,d=VHF CH05 RX
f=156250000,d=VHF CH05 TX
f=156300000,d=VHF CH06 RX
f=156300000,d=VHF CH06 TX
f=160950000,d=VHF CH07 RX
f=156350000,d=VHF CH07 TX
f=156400000,d=VHF CH08 RX
f=156400000,d=VHF CH08 TX
f=156450000,d=VHF CH09 RX
f=156450000,d=VHF CH09 TX
f=156500000,d=VHF CH10 RX
f=156500000,d=VHF CH10 TX
f=156550000,d=VHF CH11 RX
f=156550000,d=VHF CH11 TX
f=156600000,d=VHF CH12 RX
f=156600000,d=VHF CH12 TX
f=156650000,d=VHF CH13 RX
f=156650000,d=VHF CH13 TX
f=156700000,d=VHF CH14 RX
f=156700000,d=VHF CH14 TX
f=156750000,d=VHF CH15 RX
f=156750000,d=VHF CH15 TX
f=156800000,d=VHF CH16 RX
f=156800000,d=VHF CH16 TX
f=156850000,d=VHF CH17 RX
f=156850000,d=VHF CH17 TX
f=161500000,d=VHF CH18 RX
f=156900000,d=VHF CH18 TX
f=161550000,d=VHF CH19 RX
f=156950000,d=VHF CH19 TX
f=161600000,d=VHF CH20 RX
f=157000000,d=VHF CH20 TX
f=161650000,d=VHF CH21 RX
f=157050000,d=VHF CH21 TX
f=161700000,d=VHF CH22 RX
f=157100000,d=VHF CH22 TX
f=161750000,d=VHF CH23 RX
f=157150000,d=VHF CH23 TX
f=161800000,d=VHF CH24 RX
f=157200000,d=VHF CH24 TX
f=161850000,d=VHF CH25 RX
f=157250000,d=VHF CH25 TX
f=161900000,d=VHF CH26 RX
f=157300000,d=VHF CH26 TX
f=161950000,d=VHF CH27 RX
f=157350000,d=VHF CH27 TX
f=162000000,d=VHF CH28 RX
f=157400000,d=VHF CH28 TX
f=160625000,d=VHF CH60 RX
f=156025000,d=VHF CH60 TX
f=160675000,d=VHF CH61 RX
f=156075000,d=VHF CH61 TX
f=160725000,d=VHF CH62 RX
f=156125000,d=VHF CH62 TX
f=160775000,d=VHF CH63 RX
f=156175000,d=VHF CH63 TX
f=160825000,d=VHF CH64 RX
f=156225000,d=VHF CH64 TX
f=160875000,d=VHF CH65 RX
f=156275000,d=VHF CH65 TX
f=160925000,d=VHF CH66 RX
f=156325000,d=VHF CH66 TX
f=156375000,d=VHF CH67 RX
f=156375000,d=VHF CH67 TX
f=156425000,d=VHF CH68 RX
f=156425000,d=VHF CH68 TX
f=156475000,d=VHF CH69 RX
f=156475000,d=VHF CH69 TX
f=156525000,d=VHF CH70 RX
f=156525000,d=VHF CH70 TX
f=156575000,d=VHF CH71 RX
f=156575000,d=VHF CH71 TX
f=156625000,d=VHF CH72 RX
f=156625000,d=VHF CH72 TX
f=156675000,d=VHF CH73 RX
f=156675000,d=VHF CH73 TX
f=156725000,d=VHF CH74 RX
f=156725000,d=VHF CH74 TX
f=156775000,d=VHF CH75 RX
f=156775000,d=VHF CH75 TX
f=156825000,d=VHF CH76 RX
f=156825000,d=VHF CH76 TX
f=156875000,d=VHF CH77 RX
f=156875000,d=VHF CH77 TX
f=161525000,d=VHF CH78 RX
f=156925000,d=VHF CH78 TX
f=161575000,d=VHF CH79 RX
f=156975000,d=VHF CH79 TX
f=161625000,d=VHF CH80 RX
f=157025000,d=VHF CH80 TX
f=161675000,d=VHF CH81 RX
f=157075000,d=VHF CH81 TX
f=161725000,d=VHF CH82 RX
f=157125000,d=VHF CH82 TX
f=161775000,d=VHF CH83 RX
f=157175000,d=VHF CH83 TX
f=161825000,d=VHF CH84 RX
f=157225000,d=VHF CH84 TX
f=161875000,d=VHF CH85 RX
f=157275000,d=VHF CH85 TX
f=161925000,d=VHF CH86 RX
f=157325000,d=VHF CH86 TX
f=157375000,d=VHF CH87 RX
f=157375000,d=VHF CH87 TX
f=157425000,d=VHF CH88 RX
f=157425000,d=VHF CH88 TX