mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 17:19:29 +00:00
RDS radiotext transmit (group 2A)
Keyboard/Unistroke text input method selection
This commit is contained in:
@@ -143,6 +143,7 @@ CPPSRC = main.cpp \
|
||||
proc_epar.cpp \
|
||||
proc_playaudio.cpp \
|
||||
proc_xylos.cpp \
|
||||
proc_rds.cpp \
|
||||
dsp_squelch.cpp \
|
||||
clock_recovery.cpp \
|
||||
packet_builder.cpp \
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "proc_xylos.hpp"
|
||||
#include "proc_epar.hpp"
|
||||
#include "proc_fsk_lcr.hpp"
|
||||
#include "proc_rds.hpp"
|
||||
|
||||
#include "rssi.hpp"
|
||||
#include "i2s.hpp"
|
||||
@@ -126,6 +127,7 @@ BasebandProcessor* BasebandThread::create_processor(const int32_t mode) {
|
||||
case 2: return new XylosProcessor();
|
||||
case 3: return new LCRFSKProcessor();
|
||||
case 4: return new EPARProcessor();
|
||||
case 5: return new RDSProcessor();
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ void LCRFSKProcessor::execute(const buffer_c8_t& buffer) {
|
||||
|
||||
if (sample_count >= shared_memory.afsk_samples_per_bit) {
|
||||
if (shared_memory.afsk_transmit_done == false)
|
||||
cur_byte = shared_memory.lcrdata[byte_pos];
|
||||
cur_byte = shared_memory.radio_data[byte_pos];
|
||||
if (!cur_byte) {
|
||||
if (shared_memory.afsk_repeat) {
|
||||
shared_memory.afsk_repeat--;
|
||||
bit_pos = 0;
|
||||
byte_pos = 0;
|
||||
cur_byte = shared_memory.lcrdata[0];
|
||||
cur_byte = shared_memory.radio_data[0];
|
||||
message.n = shared_memory.afsk_repeat;
|
||||
shared_memory.application_queue.push(message);
|
||||
} else {
|
||||
|
||||
@@ -27,21 +27,24 @@
|
||||
#include <cstdint>
|
||||
|
||||
void RDSProcessor::execute(const buffer_c8_t& buffer) {
|
||||
uint32_t * rdsdata;
|
||||
|
||||
for (size_t i = 0; i<buffer.count; i++) {
|
||||
rdsdata = (uint32_t *)shared_memory.radio_data;
|
||||
|
||||
for (size_t i = 0; i < buffer.count; i++) {
|
||||
|
||||
//Sample generation 2.28M/10=228kHz
|
||||
if(s >= 9) {
|
||||
s = 0;
|
||||
if(sample_count >= SAMPLES_PER_BIT) {
|
||||
cur_bit = (shared_memory.rdsdata[(bit_pos / 26) & 15]>>(25-(bit_pos % 26))) & 1;
|
||||
cur_bit = (rdsdata[(bit_pos / 26) & 15] >> (25 - (bit_pos % 26))) & 1;
|
||||
prev_output = cur_output;
|
||||
cur_output = prev_output ^ cur_bit;
|
||||
|
||||
int32_t *src = waveform_biphase;
|
||||
const int32_t *src = waveform_biphase; // const ok ?
|
||||
int idx = in_sample_index;
|
||||
|
||||
for(int j=0; j<FILTER_SIZE; j++) {
|
||||
for(int j = 0; j < FILTER_SIZE; j++) {
|
||||
val = (*src++);
|
||||
if (cur_output) val = -val;
|
||||
sample_buffer[idx++] += val;
|
||||
@@ -51,7 +54,10 @@ void RDSProcessor::execute(const buffer_c8_t& buffer) {
|
||||
in_sample_index += SAMPLES_PER_BIT;
|
||||
if (in_sample_index >= SAMPLE_BUFFER_SIZE) in_sample_index -= SAMPLE_BUFFER_SIZE;
|
||||
|
||||
bit_pos++;
|
||||
if (bit_pos < shared_memory.bit_length)
|
||||
bit_pos++;
|
||||
else
|
||||
bit_pos = 0;
|
||||
sample_count = 0;
|
||||
}
|
||||
|
||||
@@ -60,7 +66,7 @@ void RDSProcessor::execute(const buffer_c8_t& buffer) {
|
||||
out_sample_index++;
|
||||
if (out_sample_index >= SAMPLE_BUFFER_SIZE) out_sample_index = 0;
|
||||
|
||||
//AM @ 228k/4=57kHz
|
||||
//AM @ 228k/4 = 57kHz
|
||||
switch (mphase) {
|
||||
case 0:
|
||||
case 2: sample = 0; break;
|
||||
@@ -80,11 +86,10 @@ void RDSProcessor::execute(const buffer_c8_t& buffer) {
|
||||
|
||||
phase = (phase + frq);
|
||||
sphase = phase + (256<<16);
|
||||
|
||||
//re = sintab[(sphase & 0x03FF0000)>>16];
|
||||
//im = sintab[(phase & 0x03FF0000)>>16];
|
||||
|
||||
re = (sine_table_f32[(sphase & 0x03FF0000)>>18]*127);
|
||||
im = (sine_table_f32[(phase & 0x03FF0000)>>18]*127);
|
||||
|
||||
buffer.p[i] = {(int8_t)re,(int8_t)im};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ private:
|
||||
int sample_count = SAMPLES_PER_BIT;
|
||||
int in_sample_index = 0;
|
||||
int32_t sample;
|
||||
int out_sample_index = SAMPLE_BUFFER_SIZE-1;
|
||||
int out_sample_index = SAMPLE_BUFFER_SIZE - 1;
|
||||
uint32_t phase, sphase;
|
||||
int32_t sig, frq, frq_im, rdsc;
|
||||
int32_t k;
|
||||
|
||||
int32_t waveform_biphase[576] = {
|
||||
const int32_t waveform_biphase[576] = {
|
||||
165,167,168,168,167,166,163,160,
|
||||
157,152,147,141,134,126,118,109,
|
||||
99,88,77,66,53,41,27,14,
|
||||
|
||||
Reference in New Issue
Block a user