mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-11-08 23:08:08 -05:00
Shameful commit. Fixed HackRF mode not working...
Sync'd with Sharebrained's repo, no more SIMD warnings
This commit is contained in:
commit
1e79be5555
11 changed files with 232 additions and 63 deletions
|
|
@ -42,18 +42,40 @@ BHTView::~BHTView() {
|
|||
}
|
||||
|
||||
void BHTView::generate_message() {
|
||||
uint8_t ccir_message[20];
|
||||
uint32_t c;
|
||||
|
||||
if (!_mode) {
|
||||
if (tx_mode == SINGLE) {
|
||||
text_message.set(
|
||||
gen_message_xy(header_code_a.value(), header_code_b.value(), city_code_xy.value(), family_code_xy.value(),
|
||||
checkbox_wcsubfamily.value(), subfamily_code.value(), checkbox_wcid.value(), receiver_code.value(),
|
||||
relay_states[0].selected_index(), relay_states[1].selected_index(),
|
||||
relay_states[2].selected_index(), relay_states[3].selected_index())
|
||||
);
|
||||
}/* else if (tx_mode == SEQUENCE) {
|
||||
// sequence_lille_matin
|
||||
for (c = 0; c < 20; c++) {
|
||||
if (sequence_lille_matin[seq_index].code[c] <= 9)
|
||||
ccir_message[c] = sequence_lille_matin[seq_index].code[c] - '0';
|
||||
else
|
||||
ccir_message[c] = sequence_lille_matin[seq_index].code[c] - 'A' + 10;
|
||||
}
|
||||
|
||||
// Copy for baseband
|
||||
memcpy(shared_memory.bb_data.tones_data.message, ccir_message, 20);
|
||||
|
||||
text_message.set(sequence_lille_matin[seq_index].code);
|
||||
text_message.set_dirty();
|
||||
}*/
|
||||
|
||||
} else {
|
||||
|
||||
/*else {
|
||||
text_message.set(
|
||||
gen_message_ep(city_code_ep.value(), family_code_ep.selected_index_value(),
|
||||
relay_states[0].selected_index(), relay_states[1].selected_index())
|
||||
);
|
||||
);*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +131,15 @@ void BHTView::on_tx_progress(const int progress, const bool done) {
|
|||
} else {
|
||||
progressbar.set_value(progress);
|
||||
}
|
||||
}
|
||||
}/* else if (tx_mode == SEQUENCE) {
|
||||
if (done) {
|
||||
transmitter_model.disable();
|
||||
chThdSleepMilliseconds(sequence_lille_matin[seq_index].delay * 1000);
|
||||
seq_index++;
|
||||
generate_message();
|
||||
start_tx();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
BHTView::BHTView(NavigationView& nav) {
|
||||
|
|
@ -135,6 +165,7 @@ BHTView::BHTView(NavigationView& nav) {
|
|||
&text_message,
|
||||
&checkbox_cligno,
|
||||
&tempo_cligno,
|
||||
&button_seq, // Sequence
|
||||
&tx_view
|
||||
});
|
||||
|
||||
|
|
@ -270,6 +301,15 @@ BHTView::BHTView(NavigationView& nav) {
|
|||
};
|
||||
};
|
||||
|
||||
button_seq.on_select = [this, &nav](Button&) {
|
||||
if ((tx_mode == IDLE) && (!_mode)) {
|
||||
seq_index = 0;
|
||||
tx_mode = SEQUENCE;
|
||||
tx_view.set_transmitting(true);
|
||||
start_tx();
|
||||
}
|
||||
};
|
||||
|
||||
tx_view.on_start = [this]() {
|
||||
if ((tx_mode == IDLE) && (!_mode)) {
|
||||
if (speaker_enabled && _mode)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,45 @@ public:
|
|||
std::string title() const override { return "BHT transmit"; };
|
||||
|
||||
private:
|
||||
uint32_t seq_index { 0 };
|
||||
|
||||
struct sequence_t {
|
||||
const std::string code;
|
||||
const uint32_t delay;
|
||||
};
|
||||
/*
|
||||
2017-03-03 07:11:04 0000189000B1002B0000 18:9:0:00 R1=OFF (1)
|
||||
2017-03-03 07:11:23 0000189200B2110B0000 18:9:2:00 R1=ON (4)
|
||||
2017-03-03 07:11:39 0000189200B1110B0000 18:9:2:00 R1=OFF (4)
|
||||
2017-03-03 07:12:31 0001189200B2110B0000 18:9:2:00 R1=ON (4)
|
||||
2017-03-03 07:12:48 0001189200B1110B0000 18:9:2:00 R1=OFF (4)
|
||||
2017-03-03 07:13:04 0000189000B0012B0000 18:9:0:00 R3=OFF (2)
|
||||
2017-03-03 07:13:26 0001189200B1120B0000 18:9:2:00 R3=ON (6)
|
||||
2017-03-03 07:13:43 0001189200B1110B0000 18:9:2:00 R3=OFF (6)
|
||||
2017-03-03 07:14:00 0001181AAAB1000B0000 18:1:A:AA R1=OFF (10)
|
||||
2017-03-03 07:14:17 0001189400B1000B0000 18:9:4:00 R1=OFF (7)
|
||||
2017-03-03 07:14:31 0001189200B1120B0000 18:9:2:00 R3=ON (6)
|
||||
2017-03-03 07:14:48 0001189200B1110B0000 18:9:2:00 R3=OFF (6)
|
||||
2017-03-03 07:15:05 0001181AAAB1000B0000 18:1:A:AA
|
||||
2017-03-03 07:15:22 0001189400B0100B0000 18:9:4:00 R2=OFF (8)
|
||||
*/
|
||||
const sequence_t sequence_lille_matin[14] = {
|
||||
{ "0000189000B1002B0000", 19 }, // 18:9:0:00 R1=OFF (1)
|
||||
{ "0000189200B2110B0000", 16 }, // 18:9:2:00 R1=ON (4)
|
||||
{ "0000189200B1110B0000", 52 }, // 18:9:2:00 R1=OFF (4)
|
||||
{ "0000189200B2110B0000", 17 }, // 18:9:2:00 R1=ON (4)
|
||||
{ "0000189200B1110B0000", 16 }, // 18:9:2:00 R1=OFF (4)
|
||||
{ "0000189000B0012B0000", 22 }, // 18:9:0:00 R3=OFF (2)
|
||||
{ "0000189200B1120B0000", 17 }, // 18:9:2:00 R3=ON (6)
|
||||
{ "0000189200B1110B0000", 17 }, // 18:9:2:00 R3=OFF (6)
|
||||
{ "0000181AAAB1000B0000", 17 }, // 18:1:A:AA R1=OFF (10)
|
||||
{ "0000189400B1000B0000", 17 }, // 18:9:4:00 R1=OFF (7)
|
||||
{ "0000189200B1120B0000", 14 }, // 18:9:2:00 R3=ON (6)
|
||||
{ "0000189200B1110B0000", 17 }, // 18:9:2:00 R3=OFF (6)
|
||||
{ "0000181AAAB1000B0000", 17 }, // 18:1:A:AA
|
||||
{ "0000189400B0100B0000", 17 } // 18:9:4:00 R2=OFF (8)
|
||||
};
|
||||
|
||||
enum tx_modes {
|
||||
IDLE = 0,
|
||||
SINGLE,
|
||||
|
|
@ -215,6 +254,11 @@ private:
|
|||
' '
|
||||
};
|
||||
|
||||
Button button_seq {
|
||||
{ 210, 210, 30, 30 },
|
||||
"SQ"
|
||||
};
|
||||
|
||||
TransmitterView tx_view {
|
||||
16 * 16,
|
||||
10000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue