Skip to content

Commit

Permalink
Ver 1.2.1 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sbazaz committed Mar 22, 2022
1 parent 24ba881 commit c7b9453
Show file tree
Hide file tree
Showing 16 changed files with 6,890 additions and 6,873 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changelog
All notable changes to the UL for Linux project will be documented in this file.

## [1.2.1] - March 21, 2022
### Added
- none

### Changed
- The FPGA image of the USB-2020 series upgraded to version 0.92. This update addresses the digital output update issue.
- Removed compile warnings.
- Updated the FPGA loader.

### Removed
- none

## [1.2.0] - May 11, 2020
### Added
* support for the following DAQ devices
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ Building the **uldaq** package requires C/C++ compilers, make tool, and the deve

```
Linux
    $ wget -N https://github.com/mccdaq/uldaq/releases/download/v1.2.0/libuldaq-1.2.0.tar.bz2
    $ wget -N https://github.com/mccdaq/uldaq/releases/download/v1.2.1/libuldaq-1.2.1.tar.bz2
macOS
    $ curl -L -O https://github.com/mccdaq/uldaq/releases/download/v1.2.0/libuldaq-1.2.0.tar.bz2
    $ curl -L -O https://github.com/mccdaq/uldaq/releases/download/v1.2.1/libuldaq-1.2.1.tar.bz2
```
2. Extract the tar file:

```
 $ tar -xvjf libuldaq-1.2.0.tar.bz2
 $ tar -xvjf libuldaq-1.2.1.tar.bz2
```

3. Run the following commands to build and install the library:

```
 $ cd libuldaq-1.2.0
 $ cd libuldaq-1.2.1
 $ ./configure && make
$ sudo make install
```
Expand Down
7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
m4_define([LIBUL_MAJOR], 1)
m4_define([LIBUL_MINOR], 2)
m4_define([LIBUL_MICRO], 0)
m4_define([LIBUL_MICRO], 1)
m4_define([LIBUL_RC],)

AC_INIT([libuldaq],[LIBUL_MAJOR[.]LIBUL_MINOR[.]LIBUL_MICRO[]LIBUL_RC],[[email protected]],[libuldaq],[http://www.mccdaq.com])
Expand All @@ -10,7 +10,7 @@ AC_INIT([libuldaq],[LIBUL_MAJOR[.]LIBUL_MINOR[.]LIBUL_MICRO[]LIBUL_RC],[info@mcc
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# http://sourceware.org/autobook/autobook/autobook_91.html
lt_current=3
lt_revision=0
lt_revision=1
lt_age=2
LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}"

Expand Down Expand Up @@ -99,6 +99,9 @@ fi

AC_SUBST(LTLDFLAGS)

# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])

AC_CONFIG_FILES([libuldaq.pc])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
Expand Down
2 changes: 1 addition & 1 deletion src/AiDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ void AiDevice::getCfg_CalDateStr(int calTableIndex, char* calDate, unsigned int*
{
mDaqDevice.checkConnection();

long int calDateSec = getCfg_CalDate(calTableIndex);
time_t calDateSec = getCfg_CalDate(calTableIndex);

// convert seconds to string
struct tm *timeinfo;
Expand Down
40 changes: 20 additions & 20 deletions src/usb/UsbFpgaDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@
#include "UsbFpgaDevice.h"
#include "../utility/UlLock.h"

extern unsigned char USB_1208HS_rbf[];
extern unsigned int USB_1208HS_rbf_len;
extern const unsigned char USB_1208HS_rbf[];
extern const unsigned int USB_1208HS_rbf_len;

extern unsigned char USB_1608G_rbf[];
extern unsigned int USB_1608G_rbf_len;
extern const unsigned char USB_1608G_rbf[];
extern const unsigned int USB_1608G_rbf_len;

extern unsigned char USB_1608G_2_rbf[];
extern unsigned int USB_1608G_2_rbf_len;
extern const unsigned char USB_1608G_2_rbf[];
extern const unsigned int USB_1608G_2_rbf_len;

extern unsigned char USB_1808_bin[];
extern unsigned int USB_1808_bin_len;
extern const unsigned char USB_1808_bin[];
extern const unsigned int USB_1808_bin_len;

extern unsigned char usb_2020_bin[];
extern unsigned int usb_2020_bin_len;
extern const unsigned char usb_2020_bin[];
extern const unsigned int usb_2020_bin_len;

extern unsigned char USB_26xx_rbf[];
extern unsigned int USB_26xx_rbf_len;
extern const unsigned char USB_26xx_rbf[];
extern const unsigned int USB_26xx_rbf_len;

extern unsigned char USB_CTR_bin[];
extern unsigned int USB_CTR_bin_len;
extern const unsigned char USB_CTR_bin[];
extern const unsigned int USB_CTR_bin_len;

extern unsigned char USB_DIO32HS_bin[];
extern unsigned int USB_DIO32HS_bin_len;
extern const unsigned char USB_DIO32HS_bin[];
extern const unsigned int USB_DIO32HS_bin_len;


//#define FPGA_FILES_PATH "/etc/uldaq/fpga/"
Expand Down Expand Up @@ -207,7 +207,7 @@ void UsbFpgaDevice::loadFpga() const
UlError __attribute__((unused)) error = ERR_NO_ERROR;

unsigned int size = 0;
unsigned char* fpgaImage = NULL;
const unsigned char* fpgaImage = NULL;
unsigned char* bitReverseBuffer = NULL;

getFpgaImage(&fpgaImage, &size, &bitReverseBuffer);
Expand All @@ -224,15 +224,15 @@ void UsbFpgaDevice::loadFpga() const

// transfer data
int remaining = size;
unsigned char* ptr = fpgaImage;
const unsigned char* ptr = fpgaImage;
do
{
if(remaining > 64)
num_bytes = 64;
else
num_bytes = remaining;

UsbDaqDevice::sendCmd(CMD_FPGA_DATA, 0, 0, ptr, num_bytes);
UsbDaqDevice::sendCmd(CMD_FPGA_DATA, 0, 0, const_cast<unsigned char*>(ptr), num_bytes);

ptr += num_bytes;
remaining -= num_bytes;
Expand Down Expand Up @@ -265,7 +265,7 @@ void UsbFpgaDevice::loadFpga() const
std::cout << "**** the fpga image not included" << std::endl;
}

void UsbFpgaDevice::getFpgaImage(unsigned char** fpgaImage, unsigned int* size, unsigned char** bitReverseBuffer) const
void UsbFpgaDevice::getFpgaImage(const unsigned char** fpgaImage, unsigned int* size, unsigned char** bitReverseBuffer) const
{
unsigned int devType = getDeviceType();
switch(devType)
Expand Down
2 changes: 1 addition & 1 deletion src/usb/UsbFpgaDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UL_LOCAL UsbFpgaDevice: public UsbDaqDevice
void loadFpga() const;
bool isSpartanFpga() const;
void reverseFpgaBits(unsigned char* fpgaImage, unsigned long size) const;
void getFpgaImage(unsigned char** fpgaImage, unsigned int* size, unsigned char** bitReverseBuffer) const;
void getFpgaImage(const unsigned char** fpgaImage, unsigned int* size, unsigned char** bitReverseBuffer) const;

unsigned short getRawFpgaVersion();

Expand Down
26 changes: 14 additions & 12 deletions src/usb/daqo/DaqOUsb1808.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,24 +179,26 @@ unsigned char DaqOUsb1808::getOptionsCode(FunctionType functionType, ScanOption

void DaqOUsb1808::loadScanConfigs(DaqOutChanDescriptor chanDescriptors[], int numChans) const
{
unsigned char scanQueue[3];
if(numChans <= 3)
{
unsigned char scanQueue[3];

memset(scanQueue, 0, sizeof(scanQueue));
memset(scanQueue, 0, sizeof(scanQueue));

int idx = 0;

int idx = 0;

for(idx = 0; idx < numChans; idx++)
{
if(chanDescriptors[idx].type == DAQO_ANALOG)
for(idx = 0; idx < numChans; idx++)
{
scanQueue[idx] = chanDescriptors[idx].channel;
if(chanDescriptors[idx].type == DAQO_ANALOG)
{
scanQueue[idx] = chanDescriptors[idx].channel;
}
else if (chanDescriptors[idx].type == DAQO_DIGITAL)
scanQueue[idx] = 2;
}
else if (chanDescriptors[idx].type == DAQO_DIGITAL)
scanQueue[idx] = 2;
}

daqDev().sendCmd(CMD_OUT_SCAN_CONFIG, 0, idx - 1, (unsigned char*) &scanQueue, sizeof(scanQueue));
daqDev().sendCmd(CMD_OUT_SCAN_CONFIG, 0, idx - 1, (unsigned char*) &scanQueue, sizeof(scanQueue));
}
}


Expand Down
2 changes: 1 addition & 1 deletion src/usb/fw/USBQuad06Fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
///////////////////////////////////////////////////////////////////

char USBQuad06Fpga[212488] =
const char USBQuad06Fpga[212488] =
{
0x00, 0x09, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x00, 0x00, 0x01, 0x61, 0x00, 0x23, // 0x00000000: .............a.#
0x6d, 0x63, 0x63, 0x51, 0x75, 0x61, 0x64, 0x30, 0x36, 0x54, 0x6f, 0x70, 0x2e, 0x6e, 0x63, 0x64, // 0x00000010: mccQuad06Top.ncd
Expand Down
4 changes: 2 additions & 2 deletions src/usb/fw/Usb1208hsFpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
///////////////////////////////////////////////////////////////////

unsigned char USB_1208HS_rbf[] = {
const unsigned char USB_1208HS_rbf[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x6a, 0xde, 0xff, 0x7f, 0x00, 0xe8, 0xd5, 0x08,
0x00, 0x6a, 0xde, 0xff, 0x7f, 0x00, 0xe8, 0xd5, 0x08, 0x00, 0x6a, 0xde,
Expand Down Expand Up @@ -6041,4 +6041,4 @@ unsigned char USB_1208HS_rbf[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
unsigned int USB_1208HS_rbf_len = 72381;
const unsigned int USB_1208HS_rbf_len = 72381;
4 changes: 2 additions & 2 deletions src/usb/fw/Usb1608g2Fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
///////////////////////////////////////////////////////////////////

unsigned char USB_1608G_2_rbf[] = {
const unsigned char USB_1608G_2_rbf[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x6a, 0xde, 0xff, 0x7f, 0x00, 0xd0, 0xff, 0x08,
0x00, 0x6a, 0xde, 0xff, 0x7f, 0x00, 0xd0, 0xff, 0x08, 0x00, 0x6a, 0xde,
Expand Down Expand Up @@ -6153,4 +6153,4 @@ unsigned char USB_1608G_2_rbf[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
unsigned int USB_1608G_2_rbf_len = 73722;
const unsigned int USB_1608G_2_rbf_len = 73722;
4 changes: 2 additions & 2 deletions src/usb/fw/Usb1608gFpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - xxd -i USB_1608G.rbf > Usb1608hsFpga.c
///////////////////////////////////////////////////////////////////

unsigned char USB_1608G_rbf[] = {
const unsigned char USB_1608G_rbf[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x6a, 0xde, 0xff, 0x7f, 0x00, 0x24, 0x03, 0x09,
0x00, 0x6a, 0xde, 0xff, 0x7f, 0x00, 0x24, 0x03, 0x09, 0x00, 0x6a, 0xde,
Expand Down Expand Up @@ -6161,4 +6161,4 @@ unsigned char USB_1608G_rbf[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff
};
unsigned int USB_1608G_rbf_len = 73829;
const unsigned int USB_1608G_rbf_len = 73829;
4 changes: 2 additions & 2 deletions src/usb/fw/Usb1808Fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - xxd -i USB_1808.bin > Usb1808Fpga.c
///////////////////////////////////////////////////////////////////

unsigned char USB_1808_bin[] = {
const unsigned char USB_1808_bin[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xaa, 0x99, 0x55, 0x66, 0x30, 0xa1, 0x00, 0x07,
0x20, 0x00, 0x31, 0xa1, 0x04, 0x30, 0x31, 0x41, 0x3d, 0x08, 0x31, 0x61,
Expand Down Expand Up @@ -38691,4 +38691,4 @@ unsigned char USB_1808_bin[] = {
0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00,
0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00
};
unsigned int USB_1808_bin_len = 464196;
const unsigned int USB_1808_bin_len = 464196;
Loading

0 comments on commit c7b9453

Please sign in to comment.