From 415d0735d46ae852677b004d23fe0f26bff4f491 Mon Sep 17 00:00:00 2001 From: Mark Zakharyan Date: Tue, 24 Sep 2024 16:31:55 -0700 Subject: [PATCH] changed args slightly for LabRAD --- m4/.vscode/c_cpp_properties.json | 202 ++++++++--------- m4/.vscode/launch.json | 12 +- m4/src/Peripherals/God2D.h | 367 +++++++++++++++++++------------ 3 files changed, 337 insertions(+), 244 deletions(-) diff --git a/m4/.vscode/c_cpp_properties.json b/m4/.vscode/c_cpp_properties.json index 8b536ca..03bcffe 100644 --- a/m4/.vscode/c_cpp_properties.json +++ b/m4/.vscode/c_cpp_properties.json @@ -8,107 +8,107 @@ { "name": "PlatformIO", "includePath": [ - "/Users/space/Desktop/dual_firmware/m4/include", - "/Users/space/Desktop/dual_firmware/m4/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SPI", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDRAM/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/ea_malloc", - "/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino", - "/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated", - "/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated-avr-comp", - "/Users/space/.platformio/packages/framework-arduino-mbed/variants/GENERIC_STM32H747_M4", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Arduino_CAN/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Arduino_H7_Video/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Camera/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Ethernet/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/GC2145", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/GPS/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/GSM/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM01B0", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM0360", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/KernelDebug/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/MCUboot/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/MLC/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/MRI/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/NDP/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Nano33BLE_System/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Nicla_System/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/OV7670", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/PDM/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Portenta_Audio/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDCARD/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/RPC/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SE05X/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SFU/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/STM32H747_System/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Scheduler/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SocketWrapper/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/ThreadDebug/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBAudio", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBHID/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBHOST/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBMIDI", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBMSD/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/WiFi/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Wire", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/doom/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/mbed-memory-status", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/openamp_arduino/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/rpclib/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/syntiant_ilib/src", + "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/include", + "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SPI", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDRAM/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/ea_malloc", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated-avr-comp", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/variants/GENERIC_STM32H747_M4", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Arduino_CAN/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Arduino_H7_Video/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Camera/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Ethernet/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/GC2145", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/GPS/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/GSM/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM01B0", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM0360", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/KernelDebug/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/MCUboot/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/MLC/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/MRI/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/NDP/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Nano33BLE_System/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Nicla_System/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/OV7670", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/PDM/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Portenta_Audio/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDCARD/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/RPC/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SE05X/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SFU/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/STM32H747_System/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Scheduler/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SocketWrapper/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/ThreadDebug/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBAudio", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBHID/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBHOST/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBMIDI", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBMSD/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/WiFi/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Wire", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/doom/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/mbed-memory-status", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/openamp_arduino/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/rpclib/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/syntiant_ilib/src", "" ], "browse": { "limitSymbolsToIncludedHeaders": true, "path": [ - "/Users/space/Desktop/dual_firmware/m4/include", - "/Users/space/Desktop/dual_firmware/m4/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SPI", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDRAM/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/ea_malloc", - "/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino", - "/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated", - "/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated-avr-comp", - "/Users/space/.platformio/packages/framework-arduino-mbed/variants/GENERIC_STM32H747_M4", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Arduino_CAN/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Arduino_H7_Video/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Camera/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Ethernet/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/GC2145", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/GPS/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/GSM/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM01B0", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM0360", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/KernelDebug/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/MCUboot/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/MLC/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/MRI/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/NDP/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Nano33BLE_System/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Nicla_System/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/OV7670", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/PDM/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Portenta_Audio/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDCARD/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/RPC/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SE05X/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SFU/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/STM32H747_System/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Scheduler/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/SocketWrapper/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/ThreadDebug/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBAudio", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBHID/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBHOST/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBMIDI", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/USBMSD/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/WiFi/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/Wire", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/doom/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/mbed-memory-status", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/openamp_arduino/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/rpclib/src", - "/Users/space/.platformio/packages/framework-arduino-mbed/libraries/syntiant_ilib/src", + "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/include", + "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SPI", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDRAM/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/ea_malloc", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino/api/deprecated-avr-comp", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/variants/GENERIC_STM32H747_M4", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Arduino_CAN/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Arduino_H7_Video/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Camera/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Ethernet/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/GC2145", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/GPS/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/GSM/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM01B0", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Himax_HM0360", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/KernelDebug/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/MCUboot/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/MLC/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/MRI/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/NDP/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Nano33BLE_System/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Nicla_System/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/OV7670", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/PDM/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Portenta_Audio/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Portenta_SDCARD/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/RPC/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SE05X/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SFU/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/STM32H747_System/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Scheduler/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/SocketWrapper/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/ThreadDebug/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBAudio", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBHID/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBHOST/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBMIDI", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/USBMSD/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/WiFi/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/Wire", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/doom/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/mbed-memory-status", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/openamp_arduino/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/rpclib/src", + "C:/Users/lab/.platformio/packages/framework-arduino-mbed/libraries/syntiant_ilib/src", "" ] }, @@ -160,7 +160,7 @@ "FEATURE_BLE=1", "__FPU_PRESENT=1", "__MBED__=1", - "MBED_BUILD_TIMESTAMP=1714459159.841316", + "MBED_BUILD_TIMESTAMP=1720438822.17746", "__MBED_CMSIS_RTOS_CM", "MBED_MPU_CUSTOM", "MBED_TICKLESS", @@ -199,7 +199,7 @@ "MBED_NO_GLOBAL_USING_DIRECTIVE=1", "CORE_MAJOR=4", "CORE_MINOR=1", - "CORE_PATCH=3", + "CORE_PATCH=5", "USE_ARDUINO_PINOUT", "ARDUINO=10810", "ARDUINO_ARCH_MBED", @@ -209,14 +209,14 @@ ], "cStandard": "gnu11", "cppStandard": "gnu++14", - "compilerPath": "/Users/space/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc", + "compilerPath": "C:/Users/lab/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe", "compilerArgs": [ "-mcpu=cortex-m4", "-mfloat-abi=softfp", "-mfpu=fpv4-sp-d16", "-mthumb", - "-iprefix/Users/space/.platformio/packages/framework-arduino-mbed/cores/arduino", - "@/Users/space/.platformio/packages/framework-arduino-mbed/variants/GENERIC_STM32H747_M4/includes.txt", + "-iprefixC:/Users/lab/.platformio/packages/framework-arduino-mbed/cores/arduino", + "@C:/Users/lab/.platformio/packages/framework-arduino-mbed/variants/GENERIC_STM32H747_M4/includes.txt", "-mfloat-abi=soft", "-mfpu=fpv4-sp-d16", "" diff --git a/m4/.vscode/launch.json b/m4/.vscode/launch.json index 94b8f11..ddfa9eb 100644 --- a/m4/.vscode/launch.json +++ b/m4/.vscode/launch.json @@ -12,9 +12,9 @@ "type": "platformio-debug", "request": "launch", "name": "PIO Debug", - "executable": "/Users/space/Desktop/dual_firmware/m4/.pio/build/giga_r1_m4/firmware.elf", + "executable": "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/.pio/build/giga_r1_m4/firmware.elf", "projectEnvName": "giga_r1_m4", - "toolchainBinDir": "/Users/space/.platformio/packages/toolchain-gccarmnoneeabi/bin", + "toolchainBinDir": "C:/Users/lab/.platformio/packages/toolchain-gccarmnoneeabi/bin", "internalConsoleOptions": "openOnSessionStart", "preLaunchTask": { "type": "PlatformIO", @@ -25,18 +25,18 @@ "type": "platformio-debug", "request": "launch", "name": "PIO Debug (skip Pre-Debug)", - "executable": "/Users/space/Desktop/dual_firmware/m4/.pio/build/giga_r1_m4/firmware.elf", + "executable": "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/.pio/build/giga_r1_m4/firmware.elf", "projectEnvName": "giga_r1_m4", - "toolchainBinDir": "/Users/space/.platformio/packages/toolchain-gccarmnoneeabi/bin", + "toolchainBinDir": "C:/Users/lab/.platformio/packages/toolchain-gccarmnoneeabi/bin", "internalConsoleOptions": "openOnSessionStart" }, { "type": "platformio-debug", "request": "launch", "name": "PIO Debug (without uploading)", - "executable": "/Users/space/Desktop/dual_firmware/m4/.pio/build/giga_r1_m4/firmware.elf", + "executable": "c:/Users/lab/Desktop/dac-adc-firmware-dual-core/m4/.pio/build/giga_r1_m4/firmware.elf", "projectEnvName": "giga_r1_m4", - "toolchainBinDir": "/Users/space/.platformio/packages/toolchain-gccarmnoneeabi/bin", + "toolchainBinDir": "C:/Users/lab/.platformio/packages/toolchain-gccarmnoneeabi/bin", "internalConsoleOptions": "openOnSessionStart", "loadMode": "manual" } diff --git a/m4/src/Peripherals/God2D.h b/m4/src/Peripherals/God2D.h index 936bf3b..e5a0e3f 100644 --- a/m4/src/Peripherals/God2D.h +++ b/m4/src/Peripherals/God2D.h @@ -9,11 +9,13 @@ #include "Utils/shared_memory.h" #include "unordered_set" -class God2D { - public: +class God2D +{ +public: static void setup() { initializeRegistry(); } - static void initializeRegistry() { + static void initializeRegistry() + { registerMemberFunctionVector(timeSeriesBufferRamp2D, "2D_TIME_SERIES_BUFFER_RAMP"); registerMemberFunctionVector(dacLedBufferRamp2D, "2D_DAC_LED_BUFFER_RAMP"); } @@ -26,11 +28,13 @@ class God2D { // numFastDacChannels, numSlowDacChannels, [slowDacChannelID, slowDacV0, // slowDacVf] * numSlowDacChannels, [adcChannelID] * numAdcChannels static OperationResult timeSeriesBufferRamp2D( - const std::vector& args) { + const std::vector &args) + { // Minimum required arguments: // 7 initial params + at least 1 fast DAC channel + 1 slow DAC channel + ADC // channels - if (args.size() < 7 + 3 + 3 + 1) { + if (args.size() < 7 + 3 + 3 + 1) + { return OperationResult::Failure( "Not enough arguments provided for 2D ramp"); } @@ -45,31 +49,35 @@ class God2D { uint32_t dac_interval_us = static_cast(args[currentIndex++]); uint32_t adc_interval_us = static_cast(args[currentIndex++]); bool retrace = - static_cast(args[currentIndex++]); // 0.0f = false, 1.0f = true + static_cast(args[currentIndex++]); // 0.0f = false, 1.0f = true // Parse Fast DAC Channels - if (currentIndex >= args.size()) { + if (currentIndex >= args.size()) + { return OperationResult::Failure( "Unexpected end of arguments while parsing fast DAC channels"); } int numFastDacChannels = static_cast(args[currentIndex++]); - if (args.size() < currentIndex + numFastDacChannels * 3) { + if (args.size() < currentIndex + numFastDacChannels * 3) + { return OperationResult::Failure( "Not enough arguments for fast DAC channels"); } - int* fastDacChannels = new int[numFastDacChannels]; - float* fastDacV0s = new float[numFastDacChannels]; - float* fastDacVfs = new float[numFastDacChannels]; + int *fastDacChannels = new int[numFastDacChannels]; + float *fastDacV0s = new float[numFastDacChannels]; + float *fastDacVfs = new float[numFastDacChannels]; - for (int i = 0; i < numFastDacChannels; ++i) { + for (int i = 0; i < numFastDacChannels; ++i) + { fastDacChannels[i] = static_cast(args[currentIndex++]); fastDacV0s[i] = args[currentIndex++]; fastDacVfs[i] = args[currentIndex++]; } // Parse Slow DAC Channels - if (currentIndex >= args.size()) { + if (currentIndex >= args.size()) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -78,7 +86,8 @@ class God2D { "Unexpected end of arguments while parsing slow DAC channels"); } int numSlowDacChannels = static_cast(args[currentIndex++]); - if (args.size() < currentIndex + numSlowDacChannels * 3) { + if (args.size() < currentIndex + numSlowDacChannels * 3) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -87,18 +96,20 @@ class God2D { "Not enough arguments for slow DAC channels"); } - int* slowDacChannels = new int[numSlowDacChannels]; - float* slowDacV0s = new float[numSlowDacChannels]; - float* slowDacVfs = new float[numSlowDacChannels]; + int *slowDacChannels = new int[numSlowDacChannels]; + float *slowDacV0s = new float[numSlowDacChannels]; + float *slowDacVfs = new float[numSlowDacChannels]; - for (int i = 0; i < numSlowDacChannels; ++i) { + for (int i = 0; i < numSlowDacChannels; ++i) + { slowDacChannels[i] = static_cast(args[currentIndex++]); slowDacV0s[i] = args[currentIndex++]; slowDacVfs[i] = args[currentIndex++]; } // Parse ADC Channels - if (args.size() < currentIndex + numAdcChannels) { + if (args.size() < currentIndex + numAdcChannels) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -109,13 +120,15 @@ class God2D { return OperationResult::Failure("Not enough arguments for ADC channels"); } - int* adcChannels = new int[numAdcChannels]; - for (int i = 0; i < numAdcChannels; ++i) { + int *adcChannels = new int[numAdcChannels]; + for (int i = 0; i < numAdcChannels; ++i) + { adcChannels[i] = static_cast(args[currentIndex++]); } // Validate total number of DAC channels - if (numFastDacChannels + numSlowDacChannels != numDacChannels) { + if (numFastDacChannels + numSlowDacChannels != numDacChannels) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -129,10 +142,12 @@ class God2D { } // Allocate memory for slow DAC voltage setpoints - float** slowVoltSetpoints = new float*[numSlowDacChannels]; - for (int i = 0; i < numSlowDacChannels; ++i) { + float **slowVoltSetpoints = new float *[numSlowDacChannels]; + for (int i = 0; i < numSlowDacChannels; ++i) + { slowVoltSetpoints[i] = new float[numStepsSlow]; - for (int j = 0; j < numStepsSlow; ++j) { + for (int j = 0; j < numStepsSlow; ++j) + { slowVoltSetpoints[i][j] = slowDacV0s[i] + (slowDacVfs[i] - slowDacV0s[i]) * j / (numStepsSlow - 1); @@ -140,16 +155,19 @@ class God2D { } // Start continuous ADC conversions - for (int i = 0; i < numAdcChannels; i++) { + for (int i = 0; i < numAdcChannels; i++) + { ADCController::startContinuousConversion(adcChannels[i]); } // Iterate over slow steps with optional retrace for (int slowStep = 0; slowStep < numStepsSlow && !getStopFlag(); - ++slowStep) { + ++slowStep) + { // Set slow DAC channels to the current slow step voltages DACChannel::commsController.beginTransaction(); - for (int i = 0; i < numSlowDacChannels; ++i) { + for (int i = 0; i < numSlowDacChannels; ++i) + { DACController::setVoltageNoTransaction(slowDacChannels[i], slowVoltSetpoints[i][slowStep]); } @@ -158,18 +176,21 @@ class God2D { // Determine ramp direction based on retrace flag bool isReverse = false; - if (retrace) { - isReverse = (slowStep % 2 != 0); // Reverse on odd slow steps + if (retrace) + { + isReverse = (slowStep % 2 != 0); // Reverse on odd slow steps } // Prepare ramp voltages - float* currentV0s = fastDacV0s; - float* currentVfs = fastDacVfs; - if (isReverse) { + float *currentV0s = fastDacV0s; + float *currentVfs = fastDacVfs; + if (isReverse) + { // Swap V0 and Vf for reverse ramp currentV0s = new float[numFastDacChannels]; currentVfs = new float[numFastDacChannels]; - for (int i = 0; i < numFastDacChannels; ++i) { + for (int i = 0; i < numFastDacChannels; ++i) + { currentV0s[i] = fastDacVfs[i]; currentVfs[i] = fastDacV0s[i]; } @@ -182,14 +203,17 @@ class God2D { adcChannels); // If reverse ramp was performed, clean up the temporary arrays - if (isReverse) { + if (isReverse) + { delete[] currentV0s; delete[] currentVfs; } - if (!rampResult.isSuccess()) { + if (!rampResult.isSuccess()) + { // Clean up allocated memory before returning - for (int i = 0; i < numSlowDacChannels; ++i) { + for (int i = 0; i < numSlowDacChannels; ++i) + { delete[] slowVoltSetpoints[i]; } delete[] slowVoltSetpoints; @@ -200,17 +224,19 @@ class God2D { delete[] slowDacV0s; delete[] slowDacVfs; delete[] adcChannels; - return rampResult; // Return the failure reason + return rampResult; // Return the failure reason } } // Set ADC channels to idle mode - for (int i = 0; i < numAdcChannels; i++) { + for (int i = 0; i < numAdcChannels; i++) + { ADCController::idleMode(adcChannels[i]); } // Clean up allocated memory - for (int i = 0; i < numSlowDacChannels; i++) { + for (int i = 0; i < numSlowDacChannels; i++) + { delete[] slowVoltSetpoints[i]; } delete[] slowVoltSetpoints; @@ -222,7 +248,8 @@ class God2D { delete[] slowDacVfs; delete[] adcChannels; - if (getStopFlag()) { + if (getStopFlag()) + { setStopFlag(false); return OperationResult::Failure("2D RAMPING_STOPPED"); } @@ -232,15 +259,19 @@ class God2D { static OperationResult timeSeriesBufferRampBaseNoConversionSetup( int numDacChannels, int numAdcChannels, int numSteps, - uint32_t dac_interval_us, uint32_t adc_interval_us, int* dacChannels, - float* dacV0s, float* dacVfs, int* adcChannels) { - if (adc_interval_us < 1 || dac_interval_us < 1) { + uint32_t dac_interval_us, uint32_t adc_interval_us, int *dacChannels, + float *dacV0s, float *dacVfs, int *adcChannels) + { + if (adc_interval_us < 1 || dac_interval_us < 1) + { return OperationResult::Failure("Invalid interval"); } - if (numSteps < 1) { + if (numSteps < 1) + { return OperationResult::Failure("Invalid number of steps"); } - if (numDacChannels < 1 || numAdcChannels < 1) { + if (numDacChannels < 1 || numAdcChannels < 1) + { return OperationResult::Failure("Invalid number of channels"); } // uint32_t adc_comms_period_us = (1.0/SPI_SPEED)*1e6*8*4; // 8 bits per @@ -259,11 +290,13 @@ class God2D { const int saved_data_size = numSteps * dac_interval_us / adc_interval_us; - float** voltSetpoints = new float*[numDacChannels]; + float **voltSetpoints = new float *[numDacChannels]; - for (int i = 0; i < numDacChannels; i++) { + for (int i = 0; i < numDacChannels; i++) + { voltSetpoints[i] = new float[numSteps]; - for (int j = 0; j < numSteps; j++) { + for (int j = 0; j < numSteps; j++) + { voltSetpoints[i][j] = dacV0s[i] + (dacVfs[i] - dacV0s[i]) * j / (numSteps - 1); } @@ -271,16 +304,23 @@ class God2D { TimingUtil::setupTimersTimeSeries(dac_interval_us, adc_interval_us); - while (x < saved_data_size && !getStopFlag()) { - if (TimingUtil::adcFlag) { + while (x < saved_data_size && !getStopFlag()) + { + if (TimingUtil::adcFlag) + { ADCBoard::commsController.beginTransaction(); - if (steps <= 1) { - for (int i = 0; i < numAdcChannels; i++) { + if (steps <= 1) + { + for (int i = 0; i < numAdcChannels; i++) + { ADCController::getVoltageDataNoTransaction(adcChannels[i]); } - } else { - VoltagePacket* packets = new VoltagePacket[numAdcChannels]; - for (int i = 0; i < numAdcChannels; i++) { + } + else + { + VoltagePacket *packets = new VoltagePacket[numAdcChannels]; + for (int i = 0; i < numAdcChannels; i++) + { float v = ADCController::getVoltageDataNoTransaction(adcChannels[i]); packets[i] = {static_cast(adcChannels[i]), @@ -293,15 +333,21 @@ class God2D { ADCBoard::commsController.endTransaction(); TimingUtil::adcFlag = false; } - if (TimingUtil::dacFlag && steps < numSteps + 1) { + if (TimingUtil::dacFlag && steps < numSteps + 1) + { DACChannel::commsController.beginTransaction(); - if (steps == 0) { - for (int i = 0; i < numDacChannels; i++) { + if (steps == 0) + { + for (int i = 0; i < numDacChannels; i++) + { DACController::setVoltageNoTransaction(dacChannels[i], voltSetpoints[i][0]); } - } else { - for (int i = 0; i < numDacChannels; i++) { + } + else + { + for (int i = 0; i < numDacChannels; i++) + { DACController::setVoltageNoTransaction(dacChannels[i], voltSetpoints[i][steps - 1]); } @@ -316,12 +362,14 @@ class God2D { TimingUtil::disableDacInterrupt(); TimingUtil::disableAdcInterrupt(); - for (int i = 0; i < numDacChannels; i++) { + for (int i = 0; i < numDacChannels; i++) + { delete[] voltSetpoints[i]; } delete[] voltSetpoints; - if (getStopFlag()) { + if (getStopFlag()) + { setStopFlag(false); return OperationResult::Failure("RAMPING_STOPPED"); } @@ -329,20 +377,21 @@ class God2D { return OperationResult::Success(); } - - // timeSeriesBufferRamp2D: + // dacLedBufferRamp2D: // Arguments (in order): // numDacChannels, numAdcChannels, numStepsFast, numStepsSlow, - // dacInterval_us, adcInterval_us, retrace (0.0f = false, 1.0f = true), + // dacInterval_us, dacSettlingTime_us, retrace (0.0f = false, 1.0f = true), numAdcAverages // numFastDacChannels, [fastDacChannelID, fastDacV0, fastDacVf] * // numFastDacChannels, numSlowDacChannels, [slowDacChannelID, slowDacV0, // slowDacVf] * numSlowDacChannels, [adcChannelID] * numAdcChannels static OperationResult dacLedBufferRamp2D( - const std::vector& args) { + const std::vector &args) + { // Minimum required arguments: // 7 initial params + at least 1 fast DAC channel + 1 slow DAC channel + ADC // channels - if (args.size() < 7 + 3 + 3 + 1) { + if (args.size() < 7 + 3 + 3 + 1) + { return OperationResult::Failure( "Not enough arguments provided for 2D ramp"); } @@ -354,35 +403,39 @@ class God2D { int numAdcChannels = static_cast(args[currentIndex++]); int numStepsFast = static_cast(args[currentIndex++]); int numStepsSlow = static_cast(args[currentIndex++]); - int numAdcAverages = static_cast(args[currentIndex++]); uint32_t dac_interval_us = static_cast(args[currentIndex++]); uint32_t dac_settling_time_us = static_cast(args[currentIndex++]); bool retrace = - static_cast(args[currentIndex++]); // 0.0f = false, 1.0f = true + static_cast(args[currentIndex++]); // 0.0f = false, 1.0f = true + int numAdcAverages = static_cast(args[currentIndex++]); // Parse Fast DAC Channels - if (currentIndex >= args.size()) { + if (currentIndex >= args.size()) + { return OperationResult::Failure( "Unexpected end of arguments while parsing fast DAC channels"); } int numFastDacChannels = static_cast(args[currentIndex++]); - if (args.size() < currentIndex + numFastDacChannels * 3) { + if (args.size() < currentIndex + numFastDacChannels * 3) + { return OperationResult::Failure( "Not enough arguments for fast DAC channels"); } - int* fastDacChannels = new int[numFastDacChannels]; - float* fastDacV0s = new float[numFastDacChannels]; - float* fastDacVfs = new float[numFastDacChannels]; + int *fastDacChannels = new int[numFastDacChannels]; + float *fastDacV0s = new float[numFastDacChannels]; + float *fastDacVfs = new float[numFastDacChannels]; - for (int i = 0; i < numFastDacChannels; ++i) { + for (int i = 0; i < numFastDacChannels; ++i) + { fastDacChannels[i] = static_cast(args[currentIndex++]); fastDacV0s[i] = args[currentIndex++]; fastDacVfs[i] = args[currentIndex++]; } // Parse Slow DAC Channels - if (currentIndex >= args.size()) { + if (currentIndex >= args.size()) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -391,7 +444,8 @@ class God2D { "Unexpected end of arguments while parsing slow DAC channels"); } int numSlowDacChannels = static_cast(args[currentIndex++]); - if (args.size() < currentIndex + numSlowDacChannels * 3) { + if (args.size() < currentIndex + numSlowDacChannels * 3) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -400,18 +454,20 @@ class God2D { "Not enough arguments for slow DAC channels"); } - int* slowDacChannels = new int[numSlowDacChannels]; - float* slowDacV0s = new float[numSlowDacChannels]; - float* slowDacVfs = new float[numSlowDacChannels]; + int *slowDacChannels = new int[numSlowDacChannels]; + float *slowDacV0s = new float[numSlowDacChannels]; + float *slowDacVfs = new float[numSlowDacChannels]; - for (int i = 0; i < numSlowDacChannels; ++i) { + for (int i = 0; i < numSlowDacChannels; ++i) + { slowDacChannels[i] = static_cast(args[currentIndex++]); slowDacV0s[i] = args[currentIndex++]; slowDacVfs[i] = args[currentIndex++]; } // Parse ADC Channels - if (args.size() < currentIndex + numAdcChannels) { + if (args.size() < currentIndex + numAdcChannels) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -422,13 +478,15 @@ class God2D { return OperationResult::Failure("Not enough arguments for ADC channels"); } - int* adcChannels = new int[numAdcChannels]; - for (int i = 0; i < numAdcChannels; ++i) { + int *adcChannels = new int[numAdcChannels]; + for (int i = 0; i < numAdcChannels; ++i) + { adcChannels[i] = static_cast(args[currentIndex++]); } // Validate total number of DAC channels - if (numFastDacChannels + numSlowDacChannels != numDacChannels) { + if (numFastDacChannels + numSlowDacChannels != numDacChannels) + { // Clean up allocated memory before returning delete[] fastDacChannels; delete[] fastDacV0s; @@ -442,10 +500,12 @@ class God2D { } // Allocate memory for slow DAC voltage setpoints - float** slowVoltSetpoints = new float*[numSlowDacChannels]; - for (int i = 0; i < numSlowDacChannels; ++i) { + float **slowVoltSetpoints = new float *[numSlowDacChannels]; + for (int i = 0; i < numSlowDacChannels; ++i) + { slowVoltSetpoints[i] = new float[numStepsSlow]; - for (int j = 0; j < numStepsSlow; ++j) { + for (int j = 0; j < numStepsSlow; ++j) + { slowVoltSetpoints[i][j] = slowDacV0s[i] + (slowDacVfs[i] - slowDacV0s[i]) * j / (numStepsSlow - 1); @@ -453,16 +513,19 @@ class God2D { } // Start continuous ADC conversions - for (int i = 0; i < numAdcChannels; i++) { + for (int i = 0; i < numAdcChannels; i++) + { ADCController::startContinuousConversion(adcChannels[i]); } // Iterate over slow steps with optional retrace for (int slowStep = 0; slowStep < numStepsSlow && !getStopFlag(); - ++slowStep) { + ++slowStep) + { // Set slow DAC channels to the current slow step voltages DACChannel::commsController.beginTransaction(); - for (int i = 0; i < numSlowDacChannels; ++i) { + for (int i = 0; i < numSlowDacChannels; ++i) + { DACController::setVoltageNoTransaction(slowDacChannels[i], slowVoltSetpoints[i][slowStep]); } @@ -471,18 +534,21 @@ class God2D { // Determine ramp direction based on retrace flag bool isReverse = false; - if (retrace) { - isReverse = (slowStep % 2 != 0); // Reverse on odd slow steps + if (retrace) + { + isReverse = (slowStep % 2 != 0); // Reverse on odd slow steps } // Prepare ramp voltages - float* currentV0s = fastDacV0s; - float* currentVfs = fastDacVfs; - if (isReverse) { + float *currentV0s = fastDacV0s; + float *currentVfs = fastDacVfs; + if (isReverse) + { // Swap V0 and Vf for reverse ramp currentV0s = new float[numFastDacChannels]; currentVfs = new float[numFastDacChannels]; - for (int i = 0; i < numFastDacChannels; ++i) { + for (int i = 0; i < numFastDacChannels; ++i) + { currentV0s[i] = fastDacVfs[i]; currentVfs[i] = fastDacV0s[i]; } @@ -495,14 +561,17 @@ class God2D { adcChannels); // If reverse ramp was performed, clean up the temporary arrays - if (isReverse) { + if (isReverse) + { delete[] currentV0s; delete[] currentVfs; } - if (!rampResult.isSuccess()) { + if (!rampResult.isSuccess()) + { // Clean up allocated memory before returning - for (int i = 0; i < numSlowDacChannels; ++i) { + for (int i = 0; i < numSlowDacChannels; ++i) + { delete[] slowVoltSetpoints[i]; } delete[] slowVoltSetpoints; @@ -513,18 +582,19 @@ class God2D { delete[] slowDacV0s; delete[] slowDacVfs; delete[] adcChannels; - return rampResult; // Return the failure reason + return rampResult; // Return the failure reason } } - // Set ADC channels to idle mode - for (int i = 0; i < numAdcChannels; i++) { + for (int i = 0; i < numAdcChannels; i++) + { ADCController::idleMode(adcChannels[i]); } // Clean up allocated memory - for (int i = 0; i < numSlowDacChannels; i++) { + for (int i = 0; i < numSlowDacChannels; i++) + { delete[] slowVoltSetpoints[i]; } delete[] slowVoltSetpoints; @@ -536,7 +606,8 @@ class God2D { delete[] slowDacVfs; delete[] adcChannels; - if (getStopFlag()) { + if (getStopFlag()) + { setStopFlag(false); return OperationResult::Failure("2D RAMPING_STOPPED"); } @@ -544,29 +615,33 @@ class God2D { return OperationResult::Success(); } - - - static OperationResult dacLedBufferRampBaseNoConversionSetup( int numDacChannels, int numAdcChannels, int numSteps, int numAdcAverages, - uint32_t dac_interval_us, uint32_t dac_settling_time_us, int* dacChannels, - float* dacV0s, float* dacVfs, int* adcChannels) { + uint32_t dac_interval_us, uint32_t dac_settling_time_us, int *dacChannels, + float *dacV0s, float *dacVfs, int *adcChannels) + { if (dac_settling_time_us < 1 || dac_interval_us < 1 || - dac_settling_time_us >= dac_interval_us) { + dac_settling_time_us >= dac_interval_us) + { return OperationResult::Failure("Invalid interval or settling time"); } - if (numAdcAverages < 1) { + if (numAdcAverages < 1) + { return OperationResult::Failure("Invalid number of ADC averages"); } - if (numSteps < 1) { + if (numSteps < 1) + { return OperationResult::Failure("Invalid number of steps"); } - if (numDacChannels < 1 || numAdcChannels < 1) { + if (numDacChannels < 1 || numAdcChannels < 1) + { return OperationResult::Failure("Invalid number of channels"); } - for (int i = 0; i < numAdcChannels; i++) { + for (int i = 0; i < numAdcChannels; i++) + { if (dac_settling_time_us < - ADCController::getConversionTimeFloat(adcChannels[i])) { + ADCController::getConversionTimeFloat(adcChannels[i])) + { return OperationResult::Failure( "DAC settling time too short for ADC conversion time"); } @@ -582,11 +657,13 @@ class God2D { int steps = 0; int x = 0; - float** voltSetpoints = new float*[numDacChannels]; + float **voltSetpoints = new float *[numDacChannels]; - for (int i = 0; i < numDacChannels; i++) { + for (int i = 0; i < numDacChannels; i++) + { voltSetpoints[i] = new float[numSteps]; - for (int j = 0; j < numSteps; j++) { + for (int j = 0; j < numSteps; j++) + { voltSetpoints[i][j] = dacV0s[i] + (dacVfs[i] - dacV0s[i]) * j / (numSteps - 1); } @@ -595,20 +672,29 @@ class God2D { // Set up timers with the same period but phase shifted TimingUtil::setupTimersDacLed(dac_interval_us, dac_settling_time_us); - while (x < numSteps && !getStopFlag()) { - if (TimingUtil::adcFlag) { + while (x < numSteps && !getStopFlag()) + { + if (TimingUtil::adcFlag) + { ADCBoard::commsController.beginTransaction(); - if (steps <= 1) { - for (int i = 0; i < numAdcChannels; i++) { - for (int j = 0; j < numAdcAverages; j++) { + if (steps <= 1) + { + for (int i = 0; i < numAdcChannels; i++) + { + for (int j = 0; j < numAdcAverages; j++) + { ADCController::getVoltageDataNoTransaction(adcChannels[i]); } } - } else { - VoltagePacket* packets = new VoltagePacket[numAdcChannels]; - for (int i = 0; i < numAdcChannels; i++) { + } + else + { + VoltagePacket *packets = new VoltagePacket[numAdcChannels]; + for (int i = 0; i < numAdcChannels; i++) + { float total = 0.0; - for (int j = 0; j < numAdcAverages; j++) { + for (int j = 0; j < numAdcAverages; j++) + { total += ADCController::getVoltageDataNoTransaction(adcChannels[i]); } @@ -623,15 +709,21 @@ class God2D { ADCBoard::commsController.endTransaction(); TimingUtil::adcFlag = false; } - if (TimingUtil::dacFlag && steps < numSteps + 1) { + if (TimingUtil::dacFlag && steps < numSteps + 1) + { DACChannel::commsController.beginTransaction(); - if (steps == 0) { - for (int i = 0; i < numDacChannels; i++) { + if (steps == 0) + { + for (int i = 0; i < numDacChannels; i++) + { DACController::setVoltageNoTransaction(dacChannels[i], voltSetpoints[i][0]); } - } else { - for (int i = 0; i < numDacChannels; i++) { + } + else + { + for (int i = 0; i < numDacChannels; i++) + { DACController::setVoltageNoTransaction(dacChannels[i], voltSetpoints[i][steps - 1]); } @@ -646,17 +738,18 @@ class God2D { TimingUtil::disableDacInterrupt(); TimingUtil::disableAdcInterrupt(); - for (int i = 0; i < numDacChannels; i++) { + for (int i = 0; i < numDacChannels; i++) + { delete[] voltSetpoints[i]; } delete[] voltSetpoints; - if (getStopFlag()) { + if (getStopFlag()) + { setStopFlag(false); return OperationResult::Failure("RAMPING_STOPPED"); } return OperationResult::Success(); } - }; \ No newline at end of file