mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-24 14:37:31 +00:00
Fixed LCR scan and alt format, console widget, text input autotrim
This commit is contained in:
@@ -43,7 +43,7 @@ void AFSKProcessor::execute(const buffer_c8_t& buffer) {
|
||||
if (configured == true) {
|
||||
cur_byte = message_data[byte_pos];
|
||||
ext_byte = message_data[byte_pos + 1];
|
||||
if (!cur_byte) {
|
||||
if (!(cur_byte | ext_byte)) {
|
||||
if (repeat_counter < afsk_repeat) {
|
||||
bit_pos = 0;
|
||||
byte_pos = 0;
|
||||
@@ -62,18 +62,18 @@ void AFSKProcessor::execute(const buffer_c8_t& buffer) {
|
||||
}
|
||||
}
|
||||
|
||||
if (afsk_alt_format) {
|
||||
// 0bbbbbbbbp
|
||||
// Start, 8-bit data, parity
|
||||
gbyte = 0;
|
||||
gbyte = cur_byte << 1;
|
||||
gbyte |= (ext_byte & 1);
|
||||
} else {
|
||||
if (!afsk_alt_format) {
|
||||
// 0bbbbbbbp1
|
||||
// Start, 7-bit data, parity, stop
|
||||
gbyte = 0;
|
||||
gbyte = cur_byte << 1;
|
||||
gbyte |= 1;
|
||||
} else {
|
||||
// 0bbbbbbbbp
|
||||
// Start, 8-bit data, parity
|
||||
gbyte = 0;
|
||||
gbyte = cur_byte << 1;
|
||||
gbyte |= (ext_byte & 1);
|
||||
}
|
||||
|
||||
cur_bit = (gbyte >> (9 - bit_pos)) & 1;
|
||||
@@ -120,7 +120,7 @@ void AFSKProcessor::execute(const buffer_c8_t& buffer) {
|
||||
void AFSKProcessor::on_message(const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const AFSKConfigureMessage*>(p);
|
||||
if (message.id == Message::ID::AFSKConfigure) {
|
||||
memcpy(message_data, message.message_data, 256);
|
||||
memcpy(message_data, message.message_data, 512);
|
||||
afsk_samples_per_bit = message.afsk_samples_per_bit;
|
||||
afsk_phase_inc_mark = message.afsk_phase_inc_mark;
|
||||
afsk_phase_inc_space = message.afsk_phase_inc_space;
|
||||
@@ -128,6 +128,7 @@ void AFSKProcessor::on_message(const Message* const p) {
|
||||
afsk_bw = message.afsk_bw;
|
||||
afsk_alt_format = message.afsk_alt_format;
|
||||
|
||||
sample_count = afsk_samples_per_bit;
|
||||
repeat_counter = 0;
|
||||
bit_pos = 0;
|
||||
byte_pos = 0;
|
||||
|
@@ -43,12 +43,13 @@ private:
|
||||
uint8_t afsk_repeat;
|
||||
uint32_t afsk_bw;
|
||||
bool afsk_alt_format;
|
||||
char message_data[256];
|
||||
char message_data[512];
|
||||
|
||||
uint8_t repeat_counter = 0;
|
||||
int8_t re, im;
|
||||
uint8_t s;
|
||||
uint8_t bit_pos = 0, byte_pos = 0;
|
||||
uint8_t bit_pos = 0;
|
||||
uint16_t byte_pos = 0;
|
||||
char cur_byte = 0;
|
||||
char ext_byte = 0;
|
||||
uint16_t gbyte;
|
||||
|
Reference in New Issue
Block a user