Skip to content

Commit

Permalink
Reverted delays
Browse files Browse the repository at this point in the history
  • Loading branch information
markondej committed Jan 4, 2022
1 parent cec3dad commit 67fd5ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions transmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void Transmitter::TransmitViaDma(WaveReader &reader, ClockOutput &output, unsign

DMAController dma(allocated.GetPhysicalAddress(dmaCb), dmaChannel);

std::this_thread::sleep_for(std::chrono::microseconds(BUFFER_TIME / 100));
std::this_thread::sleep_for(std::chrono::microseconds(BUFFER_TIME / 4));

auto finally = [&]() {
dmaCb[(cbOffset < 2 * bufferSize) ? cbOffset : 0].nextCbAddress = 0x00000000;
Expand All @@ -522,7 +522,7 @@ void Transmitter::TransmitViaDma(WaveReader &reader, ClockOutput &output, unsign
for (i = 0; i < samples.size(); i++) {
float value = samples[i].GetMonoValue();
while (i == ((dma.GetControllBlockAddress() - allocated.GetPhysicalAddress(dmaCb)) / (2 * sizeof(DMAControllBlock)))) {
std::this_thread::sleep_for(std::chrono::microseconds(BUFFER_TIME / 100));
std::this_thread::sleep_for(std::chrono::microseconds(1));
}
clkDiv[i] = CLK_PASSWORD | (0xffffff & (clockDivisor - static_cast<int>(round(value * divisorRange))));
cbOffset += 2;
Expand Down

0 comments on commit 67fd5ac

Please sign in to comment.