Bugfix in using lasp_lib code in the C++ code of device in debug mode

This commit is contained in:
Anne de Jong 2022-01-02 21:24:08 +01:00
parent b570b4ba18
commit 8fee46a41f
4 changed files with 17 additions and 3 deletions

View File

@ -29,6 +29,7 @@ int getTracerLevel() {
int TRACERNAME;
static us ASCEE_FN_LEVEL = 0;
/* setTracerLevel and getTracerLevel are defined as macros in
* tracer.h */
#endif

View File

@ -13,6 +13,9 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
static inline void clearScreen() {
printf("\033c\n");
@ -228,5 +231,8 @@ void uvartrace_impl(const char* pos,int line,const char* varname,size_t var);
#endif // ######################################## TRACER ==1
#ifdef __cplusplus
}
#endif
#endif // LASP_TRACER_H
//////////////////////////////////////////////////////////////////////

View File

@ -28,7 +28,7 @@ foreach(cython_file lasp_daq lasp_deviceinfo lasp_daqconfig)
cython_add_module(${cython_file} ${cython_file}.pyx)
target_link_libraries(${cython_file} cpp_daq ${cpp_daq_linklibs})
target_link_libraries(${cython_file} cpp_daq ${cpp_daq_linklibs} lasp_lib)
endforeach()

View File

@ -1,4 +1,6 @@
#include "lasp_cppuldaq.h"
#include "lasp_config.h"
#include "lasp_tracer.h"
#include <atomic>
#include <cassert>
#include <chrono>
@ -526,6 +528,8 @@ Daq *createUlDaqDevice(const DeviceInfo &devinfo,
void fillUlDaqDeviceInfo(vector<DeviceInfo> &devinfolist) {
fsTRACE(15);
UlError err;
unsigned int numdevs = MAX_DEV_COUNT_PER_API;
@ -535,8 +539,9 @@ void fillUlDaqDeviceInfo(vector<DeviceInfo> &devinfolist) {
err = ulGetDaqDeviceInventory(interfaceType, devdescriptors,static_cast<unsigned*>(&numdevs));
if (err != ERR_NO_ERROR)
if (err != ERR_NO_ERROR) {
throw std::runtime_error("UlDaq device inventarization failed");
}
for (unsigned i = 0; i < numdevs; i++) {
@ -582,7 +587,7 @@ void fillUlDaqDeviceInfo(vector<DeviceInfo> &devinfolist) {
devinfo.availableSampleRates.push_back(51000);
devinfo.prefSampleRateIndex = 11;
devinfo.availableFramesPerBlock.push_back(512);
devinfo.availableFramesPerBlock.push_back(1024);
devinfo.availableFramesPerBlock.push_back(2048);
@ -604,4 +609,6 @@ void fillUlDaqDeviceInfo(vector<DeviceInfo> &devinfolist) {
devinfolist.push_back(devinfo);
}
}
feTRACE(15);
}