Compare commits

...

16 Commits

Author SHA1 Message Date
gullradriel 7e20cea6d7 Merge pull request #800 from gullradriel/next
Updated hackRF submodule
2023-02-07 14:00:54 +01:00
GullCode 65217856c0 Updated hackRF submodule 2023-02-07 13:59:00 +01:00
gullradriel 5117538b49 Merge pull request #799 from lujji/fix-ook-app
Fix OOK app
2023-02-04 16:41:06 +01:00
lujji 362c208078 fix ook app and 1527 encoder; add scan encoding 2023-02-02 17:54:36 +02:00
Erwin Ried 4f9e8e9642 Update README.md 2023-01-25 15:34:09 +01:00
Erwin Ried de53626a46 Update README.md 2023-01-25 15:33:00 +01:00
Erwin Ried 2cf6849985 Update README.md 2023-01-25 15:16:03 +01:00
Erwin Ried 1cde3ab189 Update README.md 2023-01-25 15:12:21 +01:00
Erwin Ried bdb70a3231 Update README.md 2023-01-25 15:04:43 +01:00
Erwin Ried 49e63e2728 Update README.md 2023-01-25 14:36:18 +01:00
Erwin Ried 1beca57e56 Update README.md 2023-01-25 14:33:27 +01:00
Erwin Ried 27632825a3 Update contributors list 2023-01-25 14:14:12 +01:00
gullradriel e02e58b366 Merge pull request #789 from formtapez/settings
Save and recall all receiver settings of the Audio RX app
2023-01-21 13:04:52 +01:00
formtapez 37912df085 tabs vs spaces 2023-01-21 11:46:43 +01:00
formtapez a20a08c630 save/recall all receiver settings 2023-01-21 11:36:06 +01:00
formtapez a8885282cd save and recall stepsize 2023-01-20 22:21:59 +01:00
12 changed files with 196 additions and 106 deletions
+15 -22
View File
@@ -6,7 +6,7 @@ This is a fork of the [Havoc](https://github.com/furrtek/portapack-havoc/) firmw
[<img src="https://raw.githubusercontent.com/wiki/eried/portapack-mayhem/img/hw_overview_h2_front.png" height="400">](https://github.com/eried/portapack-mayhem/wiki/Hardware-overview) [<img src="https://raw.githubusercontent.com/wiki/eried/portapack-mayhem/img/hw_overview_h2_inside.png" height="400">](https://github.com/eried/portapack-mayhem/wiki/Hardware-overview#portapack-internals)
*[PortaPack H2+HackRF+battery](https://s.click.aliexpress.com/e/_9zbXMk) (clone) with a custom [3d printed case](https://github.com/eried/portapack-mayhem/wiki/H2-Enclosure)*
*[PortaPack H2+HackRF+battery](https://s.click.aliexpress.com/e/_DmU7GQX) (clone) with a custom [3d printed case](https://github.com/eried/portapack-mayhem/wiki/H2-Enclosure)*
# Quick overview
@@ -18,31 +18,23 @@ If you are new to *HackRF+PortaPack+Mayhem*, there is an awesome introductory vi
This repository expands upon the previous work by many people and aims to constantly add new features, bugfixes and generate documentation to make further development easier. [Collaboration](https://github.com/eried/portapack-mayhem/wiki/How-to-collaborate) is always welcomed and appreciated.
## Does it work on H1/H2 PortaPack?
## What to buy?
Yes, both devices are the [same](https://github.com/eried/portapack-mayhem/wiki/First-steps). The one I am using to test all changes is this [PortaPack H2+HackRF+battery](https://s.click.aliexpress.com/e/_9zbXMk), which is a kit that includes everything you need. Sadly, the people making the H2 never made the updated schematics available, which is not ideal (and goes against the terms of the license). Most members of the community are using a clone of the [PortaPack H1+HackRF+metal case](https://s.click.aliexpress.com/e/_dS6liw4), which does not include any battery functionality, but it is a cheaper alternative.
:heavy_check_mark: A recommended one is this [PortaPack H2](https://s.click.aliexpress.com/e/_DmU7GQX) pack, that includes everything you need. Sadly, the people making the H2 never made the updated schematics available (against the terms of the license).
To support the people behind the hardware, please buy a genuine [HackRF](https://greatscottgadgets.com/hackrf/) and [PortaPack](https://store.sharebrained.com/products/portapack-for-hackrf-one-kit).
:heavy_check_mark: Another popular option is the clone of the [PortaPack H1](https://s.click.aliexpress.com/e/_Dkbqs2X).
## Where is the latest firmware?
:warning: Be cautious , *ask* the seller about compatibility with the latest releases. Look out for the description of the item, if they provide the firmware files for an older version or they have custom setup instructions, this means it might be **NOT compatible**, for example:
The **latest (nightly) release** can be found [here](https://github.com/eried/portapack-mayhem/releases/).
![image](https://user-images.githubusercontent.com/1091420/214579017-9ad970b9-0917-48f6-a550-588226d3f89b.png)
The current **stable release** is on the [![GitHub release (latest by date)](https://img.shields.io/github/v/release/eried/portapack-mayhem?label=Releases&style=social)](https://github.com/eried/portapack-mayhem/releases/latest) page. Follow the instructions you can find in the release description.
:warning: If it looks **too different**, this might mean that they are using their own recipe, check the [different models](https://github.com/eried/portapack-mayhem/wiki/PortaPack-Versions) in our wiki. For example all the H3 and clones of that version use their own version of the firmware. They do not contribute the changes back and eventually you will be left with a device that nobody maintains:
## Is this the newest firmware for my PortaPack?
Most probably: **YES**. *If you find new features somewhere else, please [suggest](https://github.com/eried/portapack-mayhem/issues/new/choose) them*.
![image](https://user-images.githubusercontent.com/1091420/214581333-424900ee-26f8-4e96-be2f-69d8dc995ba9.png)
## Which one is actually the newest?
There is a lot of confusion of which is the latest version because no old version used any actual "version number". Additionally, since the files were distributed on facebook groups, github issue links and similar temporal sources, then there was no central location for them.
## Where is the latest version?
This fork (**Mayhem**) uses *major.minor.release* [semantic versioning](https://en.wikipedia.org/wiki/Software_versioning), so you can always compare your current version with the latest from [Releases](https://github.com/eried/portapack-mayhem/releases/latest).
## What about Havoc/GridRF/jamesshao8/jboone's?
* jboone's PortaPack: the [vanilla](https://en.wikipedia.org/wiki/Vanilla_software) experience
* Havoc: It was the most popular fork of jboone's PortaPack, currrently, it is not being maintained nor updated
* jamesshao8: He keeps his own version of the fork, while not attached as a fork to anything. Latest functions do not follow the license and are not being published with source code, so keep this in mind
* GridRF: They sell PortaPack clones with their own firmware based on a old version, which has no sourcecode available
The current **stable release** is on the [![GitHub release (latest by date)](https://img.shields.io/github/v/release/eried/portapack-mayhem?label=Releases&style=social)](https://github.com/eried/portapack-mayhem/releases/latest) page. Follow the instructions you can find in the release description. The **latest (nightly) release** can be found [here](https://github.com/eried/portapack-mayhem/releases/).
## How can I collaborate
You can write [documentation](https://github.com/eried/portapack-mayhem/wiki), fix bugs and [answer issues](https://github.com/eried/portapack-mayhem/issues) or add new functionality. Please check the following [guide](https://github.com/eried/portapack-mayhem/wiki/How-to-collaborate) with details.
@@ -51,11 +43,15 @@ Consider that the hardware and firmware has been created and maintain by a [lot]
[![Contributors](https://contrib.rocks/image?repo=eried/portapack-mayhem)](https://github.com/eried/portapack-mayhem/graphs/contributors)
To support the people behind the hardware, please buy a genuine [HackRF](https://greatscottgadgets.com/hackrf/) and [PortaPack](https://store.sharebrained.com/products/portapack-for-hackrf-one-kit).
As a last option, if you want to send money directly to me for getting more boards, antennas and such:
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CBPQA4HRRPJQ6&source=url)
## What if I really want to pay for something?
## What if I really want something specific?
If what you need can be relevant in general, you can [request a feature](https://github.com/eried/portapack-mayhem/issues/new?labels=enhancement&template=feature_request.md).
You can create a bounty and invite people to your own bounty. This will incentivize coders to work on a new feature, solving a bug or even writting documentation. Start a bounty by [creating](https://github.com/eried/portapack-mayhem/issues/new/choose) or [choosing](https://github.com/eried/portapack-mayhem/issues/) an existing issue. Then, go to [Bountysource](https://www.bountysource.com/) and post a bounty using the link to that specific [issue](https://www.bountysource.com/teams/portapack-mayhem/issues).
Promote your bounty over our Discord by clicking the chat badge on [top](#portapack-mayhem).
@@ -64,6 +60,3 @@ Promote your bounty over our Discord by clicking the chat badge on [top](#portap
First, check the [documentation](https://github.com/eried/portapack-mayhem/wiki). If you find a bug or you think the problem is related to the current repository, please open an [issue](https://github.com/eried/portapack-mayhem/issues/new/choose).
You can reach the [official community](https://www.facebook.com/groups/177623356165819) in Facebook, and our Discord by clicking the chat badge on [top](#portapack-mayhem).
## What if I find incongruencies, or grammatical errors in the text?
If is on the [Wiki](https://github.com/eried/portapack-mayhem/wiki), you can modify it directly. If is on files of the repository, you can send corrections as [pull requests](https://github.com/eried/portapack-mayhem/wiki/How-to-collaborate#coding-new-stuff-or-fixing-bugs). As a last resource, open an [issue](https://github.com/eried/portapack-mayhem/issues/new/choose).
+14 -1
View File
@@ -51,6 +51,13 @@ int app_settings::load(std::string application, AppSettings* settings) {
settings->tx_amp=std::app_settings::read_long_long(file_content, "tx_amp=");
settings->tx_frequency=std::app_settings::read_long_long(file_content, "tx_frequency=");
settings->tx_gain=std::app_settings::read_long_long(file_content, "tx_gain=");
settings->step=std::app_settings::read_long_long(file_content, "step=");
settings->modulation=std::app_settings::read_long_long(file_content, "modulation=");
settings->am_config_index=std::app_settings::read_long_long(file_content, "am_config_index=");
settings->nbfm_config_index=std::app_settings::read_long_long(file_content, "nbfm_config_index=");
settings->wfm_config_index=std::app_settings::read_long_long(file_content, "wfm_config_index=");
settings->squelch=std::app_settings::read_long_long(file_content, "squelch=");
rc = SETTINGS_OK;
}
else rc = SETTINGS_UNABLE_TO_LOAD;
@@ -61,7 +68,7 @@ int app_settings::load(std::string application, AppSettings* settings) {
int app_settings::save(std::string application, AppSettings* settings) {
if (portapack::persistent_memory::save_app_settings()) {
if (portapack::persistent_memory::save_app_settings()) {
file_path = folder+"/"+application+".ini";
make_new_directory(folder);
@@ -79,6 +86,12 @@ int app_settings::save(std::string application, AppSettings* settings) {
// Save other settings from struct
settings_file.write_line("rx_frequency="+to_string_dec_uint(settings->rx_frequency));
settings_file.write_line("tx_frequency="+to_string_dec_uint(settings->tx_frequency));
settings_file.write_line("step="+to_string_dec_uint(settings->step));
settings_file.write_line("modulation="+to_string_dec_uint(settings->modulation));
settings_file.write_line("am_config_index="+to_string_dec_uint(settings->am_config_index));
settings_file.write_line("nbfm_config_index="+to_string_dec_uint(settings->nbfm_config_index));
settings_file.write_line("wfm_config_index="+to_string_dec_uint(settings->wfm_config_index));
settings_file.write_line("squelch="+to_string_dec_uint(settings->squelch));
rc = SETTINGS_OK;
}
+5
View File
@@ -59,6 +59,11 @@ public:
uint32_t tx_frequency;
uint8_t tx_gain;
uint8_t vga;
uint32_t step;
uint8_t am_config_index;
uint8_t nbfm_config_index;
uint8_t wfm_config_index;
uint8_t squelch;
};
int load(std::string application, AppSettings* settings);
+20 -10
View File
@@ -136,6 +136,7 @@ AnalogAudioView::AnalogAudioView(
field_vga.set_value(app_settings.vga);
receiver_model.set_rf_amp(app_settings.rx_amp);
field_frequency.set_value(app_settings.rx_frequency);
receiver_model.set_configuration_without_init(static_cast<ReceiverModel::Mode>(app_settings.modulation), app_settings.step, app_settings.am_config_index, app_settings.nbfm_config_index, app_settings.wfm_config_index, app_settings.squelch);
}
else field_frequency.set_value(receiver_model.tuning_frequency());
@@ -193,36 +194,45 @@ AnalogAudioView::AnalogAudioView(
audio::output::start();
update_modulation(static_cast<ReceiverModel::Mode>(modulation));
on_modulation_changed(static_cast<ReceiverModel::Mode>(modulation));
on_modulation_changed(static_cast<ReceiverModel::Mode>(modulation));
}
size_t AnalogAudioView::get_spec_bw_index() {
return spec_bw_index;
return spec_bw_index;
}
void AnalogAudioView::set_spec_bw(size_t index, uint32_t bw) {
spec_bw_index = index;
spec_bw = bw;
spec_bw_index = index;
spec_bw = bw;
baseband::set_spectrum(bw, spec_trigger);
receiver_model.set_sampling_rate(bw);
receiver_model.set_baseband_bandwidth(bw/2);
baseband::set_spectrum(bw, spec_trigger);
receiver_model.set_sampling_rate(bw);
receiver_model.set_baseband_bandwidth(bw/2);
}
uint16_t AnalogAudioView::get_spec_trigger() {
return spec_trigger;
return spec_trigger;
}
void AnalogAudioView::set_spec_trigger(uint16_t trigger) {
spec_trigger = trigger;
spec_trigger = trigger;
baseband::set_spectrum(spec_bw, spec_trigger);
baseband::set_spectrum(spec_bw, spec_trigger);
}
AnalogAudioView::~AnalogAudioView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
app_settings.lna = receiver_model.lna();
app_settings.vga = receiver_model.vga();
app_settings.rx_amp = receiver_model.rf_amp();
app_settings.step = receiver_model.frequency_step();
app_settings.modulation = (uint8_t)receiver_model.modulation();
app_settings.am_config_index = receiver_model.am_configuration();
app_settings.nbfm_config_index = receiver_model.nbfm_configuration();
app_settings.wfm_config_index = receiver_model.wfm_configuration();
app_settings.squelch = receiver_model.squelch_level();
settings.save("rx_audio", &app_settings);
// TODO: Manipulating audio codec here, and in ui_receiver.cpp. Good to do
@@ -38,7 +38,7 @@ namespace ui
console.writeln("Brumi-2021,texasyojimbo");
console.writeln("heurist1,intoxsick,ckuethe");
console.writeln("notpike,jLynx,zigad");
console.writeln("MichalLeonBorsuk");
console.writeln("MichalLeonBorsuk,jimilinuxguy");
console.writeln("");
break;
+4 -1
View File
@@ -156,6 +156,8 @@ void EncodersConfigView::generate_frame() {
for (auto c : encoder_def->word_format) {
if (c == 'S')
frame_fragments += encoder_def->sync;
else if (!c)
break;
else
frame_fragments += encoder_def->bit_format[symfield_word.get_sym(i++)];
}
@@ -252,7 +254,8 @@ void EncodersView::start_tx(const bool scan) {
scan_width = view_scan.field_length.value();
samples_per_bit =
((view_scan.bit_length_10.value() * 10 + view_scan.bit_length.value()) * OOK_SAMPLERATE) / 1000000UL;
const uint32_t seq_len = ((1 << (scan_width - 1)) * 2) * ((uint64_t) samples_per_bit) / 2048UL;
constexpr auto sym_len = 4;
const uint32_t seq_len = ((1 << (scan_width - 1)) * 2) * ((uint64_t) samples_per_bit) * sym_len / 2048UL;
progressbar.set_max(seq_len);
repeat_min = seq_len;
} else {
+17 -17
View File
@@ -28,12 +28,12 @@
#define __ENCODERS_H__
namespace encoders {
#define ENC_TYPES_COUNT 14
#define OOK_SAMPLERATE 2280000U
#define ENCODER_UM3750 8
size_t make_bitstream(std::string& fragments);
void bitstream_append(size_t& bitstream_length, uint32_t bit_count, uint32_t bits);
@@ -65,7 +65,7 @@ namespace encoders {
150000, 2,
0
},
// PT2260-R4
{
"2260-R4",
@@ -77,7 +77,7 @@ namespace encoders {
150000, 2,
0
},
// PT2262
{
"2262 ",
@@ -89,7 +89,7 @@ namespace encoders {
20000, 4,
0
},
// 16-bit ?
{
"16-bit ",
@@ -101,7 +101,7 @@ namespace encoders {
25000, 50,
0 // ?
},
// RT1527
{
"1527 ",
@@ -111,9 +111,9 @@ namespace encoders {
24, "SAAAAAAAAAAAAAAAAAAAADDDD",
"10000000000000000000000000000000",
100000, 4,
10 // ?
0
},
// HK526E
{
"526E ",
@@ -125,7 +125,7 @@ namespace encoders {
20000, 4,
10 // ?
},
// HT12E
{
"12E ",
@@ -137,7 +137,7 @@ namespace encoders {
3000, 4,
10 // ?
},
// VD5026 13 bits ?
{
"5026 ",
@@ -149,7 +149,7 @@ namespace encoders {
100000, 4,
10 // ?
},
// UM3750
{
"UM3750 ",
@@ -161,7 +161,7 @@ namespace encoders {
100000, 4,
(3 * 12) - 6 // Compensates for pause delay bug in proc_ook
},
// UM3758
{
"UM3758 ",
@@ -173,7 +173,7 @@ namespace encoders {
160000, 4,
10 // ?
},
// BA5104
{
"BA5104 ",
@@ -185,7 +185,7 @@ namespace encoders {
455000, 4,
10 // ?
},
// MC145026
{
"145026 ",
@@ -197,7 +197,7 @@ namespace encoders {
455000, 2,
2
},
// HT6*** TODO: Add individual variations
{
"HT6*** ",
@@ -209,7 +209,7 @@ namespace encoders {
80000, 3,
10 // ?
},
// TC9148
{
"TC9148 ",
+9
View File
@@ -313,3 +313,12 @@ size_t ReceiverModel::wfm_configuration() const {
void ReceiverModel::update_wfm_configuration() {
wfm_configs[wfm_config_index].apply();
}
void ReceiverModel::set_configuration_without_init(const Mode new_mode, const rf::Frequency new_frequency_step, const size_t new_am_config_index, const size_t new_nbfm_config_index, const size_t new_wfm_config_index, uint8_t new_squelch_level) {
mode_ = new_mode;
frequency_step_ = new_frequency_step;
am_config_index = new_am_config_index;
nbfm_config_index = new_nbfm_config_index;
wfm_config_index = new_wfm_config_index;
squelch_level_ = new_squelch_level;
}
+2
View File
@@ -87,6 +87,8 @@ public:
size_t wfm_configuration() const;
void set_wfm_configuration(const size_t n);
void set_configuration_without_init(const Mode new_mode, const rf::Frequency new_frequency_step, const size_t new_am_config_index, const size_t new_nbfm_config_index, const size_t new_wfm_config_index, uint8_t new_squelch_level);
private:
rf::Frequency frequency_step_ { 25000 };
bool enabled_ { false };
+95 -48
View File
@@ -44,57 +44,118 @@ inline void OOKProcessor::write_sample(const buffer_c8_t& buffer, uint8_t bit_va
buffer.p[i] = {re, im};
}
inline void OOKProcessor::duval_algo(const buffer_c8_t& buffer) {
bool OOKProcessor::scan_init(unsigned int order) {
if (order > MAX_DE_BRUIJN_ORDER)
return false;
scan_done = false;
scan_progress = 0;
k = 0;
idx = 1;
duval_symbols = 2; // 2 for binary, 3 for ternary encoders
duval_length = 0;
duval_bit = 0;
duval_sample_bit = 0;
duval_symbol = 0;
memset(v, 0, sizeof(v));
return true;
}
bool OOKProcessor::scan_encode(const buffer_c8_t& buffer, size_t& buf_ptr) {
// encode data: 0 = 1000, 1 = 1110
// @TODO: make this user-configurable
const uint8_t sym[] = { 0b0001, 0b0111 };
constexpr auto symbol_length = 4;
// iterate over every symbol in the sequence and convert it to bits with required bitrate
for (; duval_bit < duval_length; duval_bit++) {
auto val = v_tmp[duval_bit];
for (; duval_symbol < symbol_length; duval_symbol++) {
auto s = sym[val] & (1 << duval_symbol);
for (; duval_sample_bit < samples_per_bit; duval_sample_bit++) {
if (buf_ptr >= buffer.count) {
// buffer is full - continue next time
txprogress_message.done = false;
txprogress_message.progress = scan_progress++;
shared_memory.application_queue.push(txprogress_message);
return false;
}
write_sample(buffer, s, buf_ptr++);
}
duval_sample_bit = 0;
}
duval_symbol = 0;
}
duval_bit = 0;
return true;
}
inline size_t OOKProcessor::duval_algo_step() {
size_t buf_ptr = 0;
const unsigned int w = de_bruijn_length;
// Duval's algorithm for generating de Bruijn sequence
while (idx) {
if (w % idx == 0) {
for (; k < idx; k++) {
size_t available_size = buffer.count - buf_ptr;
size_t len = (samples_per_bit > available_size) ? available_size : samples_per_bit;
for (; bit_ptr < len; bit_ptr++) {
write_sample(buffer, v[k], buf_ptr);
buf_ptr++;
}
if (buf_ptr == buffer.count) {
txprogress_message.done = false;
txprogress_message.progress = scan_progress++;
shared_memory.application_queue.push(txprogress_message);
return;
}
bit_ptr = 0;
}
for (unsigned int k = 0; k < idx; k++)
v_tmp[buf_ptr++] = v[k];
k = 0;
}
for (unsigned int j = 0; j < w - idx; j++)
v[idx + j] = v[j];
for (idx = w; idx > 0 && v[idx - 1]; idx--) ;
for (idx = w; (idx > 0) && (v[idx - 1] >= duval_symbols - 1); idx--) ;
if (idx)
v[idx - 1] = 1;
}
v[idx - 1]++;
// clear the buffer in case we have any bytes left
if (buf_ptr < buffer.count) {
for (size_t i = buf_ptr; i < buffer.count; i++) {
buffer.p[i] = {0, 0};
if (buf_ptr) {
// we fill at most de_bruijn_length number of elements
return buf_ptr;
}
}
if (!scan_done) {
txprogress_message.done = true;
shared_memory.application_queue.push(txprogress_message);
}
return 0;
}
scan_done = 1;
void OOKProcessor::scan_process(const buffer_c8_t& buffer) {
size_t buf_ptr = 0;
// transmit any leftover bits from previous step
if (!scan_encode(buffer, buf_ptr))
return;
while (1) {
// calculate next chunk of deBruijn sequence
duval_length = duval_algo_step();
if (duval_length == 0) {
// last chunk - done
if (!scan_done) {
txprogress_message.done = true;
shared_memory.application_queue.push(txprogress_message);
}
scan_done = 1;
// clear the remaining buffer in case we have any bytes left
for (size_t i = buf_ptr; i < buffer.count; i++)
buffer.p[i] = { 0, 0 };
break;
}
duval_bit = 0;
duval_sample_bit = 0;
duval_symbol = 0;
// encode the sequence into required format
if (!scan_encode(buffer, buf_ptr))
break;
}
}
void OOKProcessor::execute(const buffer_c8_t& buffer) {
@@ -103,7 +164,7 @@ void OOKProcessor::execute(const buffer_c8_t& buffer) {
if (!configured) return;
if (de_bruijn_length) {
duval_algo(buffer);
scan_process(buffer);
return;
}
@@ -175,22 +236,8 @@ void OOKProcessor::on_message(const Message* const p) {
}
if (de_bruijn_length) {
if (de_bruijn_length > sizeof(v)) {
if (!scan_init(de_bruijn_length))
return;
}
if (samples_per_bit > 2048) {
// can't handle more than dma::transfer_samples
return;
}
k = 0;
bit_ptr = 0;
idx = 1;
scan_done = false;
scan_progress = 0;
memset(v, 0, sizeof(v));
} else {
samples_per_bit /= 10;
}
+13 -5
View File
@@ -46,9 +46,9 @@ private:
uint32_t pause_counter { 0 };
uint8_t repeat_counter { 0 };
uint8_t s { 0 };
uint16_t bit_pos { 0 };
uint8_t cur_bit { 0 };
uint32_t sample_count { 0 };
uint16_t bit_pos { 0 };
uint8_t cur_bit { 0 };
uint32_t sample_count { 0 };
uint32_t tone_phase { 0 }, phase { 0 }, sphase { 0 };
int32_t tone_sample { 0 }, sig { 0 }, frq { 0 };
@@ -56,14 +56,22 @@ private:
static constexpr auto MAX_DE_BRUIJN_ORDER = 24;
uint8_t v[MAX_DE_BRUIJN_ORDER];
uint8_t v_tmp[MAX_DE_BRUIJN_ORDER];
unsigned int idx { 0 };
unsigned int k { 0 };
size_t bit_ptr{ 0 };
unsigned int duval_symbols { 0 };
unsigned int duval_length { 0 };
unsigned int duval_bit { 0 };
unsigned int duval_sample_bit { 0 };
unsigned int duval_symbol { 0 };
size_t scan_progress{ 0 };
uint8_t scan_done { true };
size_t duval_algo_step();
void scan_process(const buffer_c8_t& buffer);
bool scan_init(unsigned int order);
bool scan_encode(const buffer_c8_t& buffer, size_t& buf_ptr);
void write_sample(const buffer_c8_t& buffer, uint8_t bit_value, size_t i);
void duval_algo(const buffer_c8_t& buffer);
};
#endif
+1 -1
Submodule hackrf updated: eff4a20022...b42a185503