From 8aaaac42cb03936cf5f8f7220f5e195be4556434 Mon Sep 17 00:00:00 2001 From: Chris Esposito Date: Wed, 1 Nov 2023 13:22:49 +1100 Subject: [PATCH] Waveform generation clock settings #255 --- Desktop_Interface/genericusbdriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Desktop_Interface/genericusbdriver.cpp b/Desktop_Interface/genericusbdriver.cpp index 98643ccb..b14d2ca9 100644 --- a/Desktop_Interface/genericusbdriver.cpp +++ b/Desktop_Interface/genericusbdriver.cpp @@ -216,7 +216,7 @@ void genericUsbDriver::sendFunctionGenData(functionGen::ChannelID channelID) int validClockDivs[7] = {1, 2, 4, 8, 64, 256, 1024}; auto period = [&](int division) -> int { - return CLOCK_FREQ / (division * channelData.samples.size() * channelData.freq); + return CLOCK_FREQ / (division * channelData.samples.size() * channelData.freq) - 0.5; }; int* clkSettingIt = std::find_if(std::begin(validClockDivs), std::end(validClockDivs),