Improved close call precision

This commit is contained in:
furrtek
2016-05-13 01:18:04 +02:00
parent 7d193c3445
commit 9149508c83
23 changed files with 184 additions and 44 deletions
+4 -4
View File
@@ -85,7 +85,7 @@ void BasebandThread::run() {
const auto baseband_buffer = std::make_unique<std::array<baseband::sample_t, 8192>>();
baseband::dma::configure(
baseband_buffer->data(),
direction()
baseband::Direction::Transmit
);
//baseband::dma::allocate(4, 2048);
@@ -98,7 +98,7 @@ void BasebandThread::run() {
while(true) {
// TODO: Place correct sampling rate into buffer returned here:
const auto buffer_tmp = baseband::dma::wait_for_rx_buffer();
const auto buffer_tmp = baseband::dma::wait_for_tx_buffer();
if( buffer_tmp ) {
buffer_c8_t buffer {
buffer_tmp.p, buffer_tmp.count, baseband_configuration.sampling_rate
@@ -139,8 +139,8 @@ void BasebandThread::disable() {
void BasebandThread::enable() {
if( baseband_processor ) {
baseband_sgpio.configure(direction());
baseband::dma::enable(direction());
baseband_sgpio.configure(baseband::Direction::Transmit);
baseband::dma::enable(baseband::Direction::Transmit);
baseband_sgpio.streaming_enable();
}
}
-6
View File
@@ -33,12 +33,6 @@ public:
Thread* start(const tprio_t priority);
void on_message(const Message* const message);
// This getter should die, it's just here to leak information to code that
// isn't in the right place to begin with.
baseband::Direction direction() const {
return baseband::Direction::Transmit;
}
void wait_for_switch(void);
+5 -10
View File
@@ -30,16 +30,11 @@
#include <cstdint>
// 1990 1131 1201 1275 1357 ...
// 14 13 12 11:
// 2108 989 2259 931
void XylosProcessor::execute(const buffer_c8_t& buffer) {
// This is called at 1536000/2048 = 750Hz
ai = 0;
// ai = 0;
for (size_t i = 0; i<buffer.count; i++) {
@@ -65,7 +60,7 @@ void XylosProcessor::execute(const buffer_c8_t& buffer) {
sample_count++;
}
aphase += ccir_phases[digit];
aphase += ccir_phases[digit]; // DEBUG
} else {
s++;
}
@@ -73,15 +68,15 @@ void XylosProcessor::execute(const buffer_c8_t& buffer) {
sample = (sine_table_f32[(aphase & 0x03FF0000)>>18]*255);
// Audio preview sample generation: 1536000/48000 = 32
if (as >= 31) {
/*if (as >= 31) {
as = 0;
audio[ai++] = sample * 128;
} else {
as++;
}
}*/
//FM
frq = sample * 300; // ~10kHz wide
frq = sample * 1000; // ~10kHz wide
phase = (phase + frq);
sphase = phase + (256<<16);
+3 -3
View File
@@ -39,10 +39,10 @@ public:
void execute(const buffer_c8_t& buffer) override;
private:
int16_t audio_data[64];
/*int16_t audio_data[64];
std::array<int16_t, 64> audio;
/*const buffer_s16_t audio_buffer {
const buffer_s16_t audio_buffer {
audio.data(),
audio.size()
};*/
@@ -75,7 +75,7 @@ private:
int32_t sample, frq;
TXDoneMessage message;
AudioOutput audio_output;
//AudioOutput audio_output;
};
#endif