aboutsummaryrefslogtreecommitdiffstats
path: root/source/main.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2020-10-17 13:40:59 -0400
committerClyne Sullivan <clyne@bitgloo.com>2020-10-17 13:40:59 -0400
commit829c4b5dcbcb5383b8c1f7a32591cd03e08f6b37 (patch)
tree33457cb7782e850bbafe396ad8dd144ae0c4d340 /source/main.cpp
parent27060ea3c827c33a35c916e05efed63d1ca82b77 (diff)
Sampling rate done. 96kS/s
Diffstat (limited to 'source/main.cpp')
-rw-r--r--source/main.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/main.cpp b/source/main.cpp
index 9dcd72f..1e3c5fb 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -19,7 +19,7 @@
#include <array>
-constexpr unsigned int MAX_SAMPLE_BUFFER_SIZE = 8000;//2048;
+constexpr unsigned int MAX_SAMPLE_BUFFER_SIZE = 8000;
enum class RunStatus : char
{
@@ -240,25 +240,25 @@ THD_FUNCTION(conversionThread, arg)
std::copy(samples, samples + halfsize, &dac_samples[0]);
} else if (message == MSG_CONVSECOND) {
if (elf_entry)
- samples = elf_entry(&adc_samples[adc_samples.size() / 2], halfsize);
+ samples = elf_entry(&adc_samples[halfsize], halfsize);
if (!samples)
- samples = &adc_samples[adc_samples.size() / 2];
+ samples = &adc_samples[halfsize];
std::copy(samples, samples + halfsize, &dac_samples[dac_samples.size() / 2]);
} else if (message == MSG_CONVFIRST_MEASURE) {
chTMStartMeasurementX(&conversion_time_measurement);
if (elf_entry)
- samples = elf_entry(&adc_samples[adc_samples.size() / 2], halfsize);
+ samples = elf_entry(&adc_samples[0], halfsize);
chTMStopMeasurementX(&conversion_time_measurement);
if (!samples)
- samples = &adc_samples[adc_samples.size() / 2];
- std::copy(samples, samples + halfsize, &dac_samples[dac_samples.size() / 2]);
+ samples = &adc_samples[0];
+ std::copy(samples, samples + halfsize, &dac_samples[0]);
} else if (message == MSG_CONVSECOND_MEASURE) {
chTMStartMeasurementX(&conversion_time_measurement);
if (elf_entry)
- samples = elf_entry(&adc_samples[adc_samples.size() / 2], halfsize);
+ samples = elf_entry(&adc_samples[halfsize], halfsize);
chTMStopMeasurementX(&conversion_time_measurement);
if (!samples)
- samples = &adc_samples[adc_samples.size() / 2];
+ samples = &adc_samples[halfsize];
std::copy(samples, samples + halfsize, &dac_samples[dac_samples.size() / 2]);
}
}