Added Soundboard

file.cpp: scan_root_files
proc_audiotx.cpp: bandwidth setting
ui_widget.cpp: button on_focus
This commit is contained in:
furrtek 2016-08-26 08:11:24 +02:00
parent 5de6349199
commit f7e0f36bd9
19 changed files with 462 additions and 121 deletions

View file

@ -106,7 +106,8 @@ void AFSKProcessor::execute(const buffer_c8_t& buffer) {
// FM
// 1<<18 = 262144
// m = (262144 * BW) / 2280000 (* 115, see ui_lcr afsk_bw setting)
// m = (262144 * a) / 2280000
// a = 262144 / 2280000 (*1000 = 115, see ui_lcr afsk_bw setting)
frq = tone_sample * afsk_bw;
phase = (phase + frq);

View file

@ -38,8 +38,8 @@ void AudioTXProcessor::execute(const buffer_c8_t& buffer){
for (size_t i = 0; i<buffer.count; i++) {
// Audio preview sample generation: 1536000/48000 = 32
if (as >= 31) {
as = 0;
if (!as) {
as = 32;
audio_fifo.out(sample);
//preview_audio_buffer.p[ai++] = sample << 8;
@ -50,11 +50,11 @@ void AudioTXProcessor::execute(const buffer_c8_t& buffer){
asked = true;
}
} else {
as++;
as--;
}
// FM
frq = sample * 8000;
frq = sample * bw;
phase = (phase + frq);
sphase = phase + (64 << 18);
@ -69,9 +69,17 @@ void AudioTXProcessor::execute(const buffer_c8_t& buffer){
}
void AudioTXProcessor::on_message(const Message* const msg) {
const auto message = static_cast<const AudioTXConfigMessage*>(msg);
switch(msg->id) {
case Message::ID::AudioTXConfig:
//const auto message = static_cast<const AudioTXConfigMessage*>(msg);
// 1<<18 = 262144
// m = (262144 * a) / 1536000
// a = 262144 / 1536000 (*1000 = 171)
bw = 171 * (message->bw);
as = 0;
configured = true;
break;

View file

@ -41,6 +41,7 @@ private:
int8_t audio_fifo_data[2048];
FIFO<int8_t> audio_fifo = { audio_fifo_data, 11 }; // 43ms @ 48000Hz
uint32_t bw;
uint8_t as = 0, ai;
int8_t re, im;
int8_t sample;

View file

@ -94,7 +94,7 @@ void POCSAGProcessor::execute(const buffer_c8_t& buffer) {
last_rx_data = rx_data;
rx_state = SYNC;
} else if (rx_data == POCSAG_IDLE) {
//rx_state = WAITING;
rx_state = WAITING;
}
} else {
@ -106,6 +106,7 @@ void POCSAGProcessor::execute(const buffer_c8_t& buffer) {
if (msg_timeout < 600) {
msg_timeout++;
rx_bit++;
if (rx_bit >= 32) {
rx_bit = 0;