mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
This is the changes made by Patrick Plenefisch converting the native code to use CMake and the CMake Maven Plugin, as opposed to the native Maven plugin. This is to allow for compatibility with newer versions of the GCC toolchain. All the cpp sources were moved from maven style directories to cpp style directories for CMake. Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
43 lines
1.5 KiB
C++
43 lines
1.5 KiB
C++
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
|
|
|
#ifndef __printFPGAVersion_h__
|
|
#define __printFPGAVersion_h__
|
|
|
|
namespace nFPGA
|
|
{
|
|
|
|
template<typename ttGlobal>
|
|
inline void printFPGAVersion(ttGlobal &global)
|
|
{
|
|
tRioStatusCode cleanStatus=0;
|
|
uint32_t hardwareGuid[4];
|
|
tSystemInterface &system = *global.getSystemInterface();
|
|
system.getHardwareFpgaSignature(hardwareGuid, &cleanStatus);
|
|
const uint32_t *softwareGuid = system.getExpectedFPGASignature();
|
|
printf("FPGA Hardware GUID: 0x");
|
|
for(int i=0; i<4; i++)
|
|
{
|
|
printf("%08X", hardwareGuid[i]);
|
|
}
|
|
printf("\n");
|
|
printf("FPGA Software GUID: 0x");
|
|
for(int i=0; i<4; i++)
|
|
{
|
|
printf("%08X", softwareGuid[i]);
|
|
}
|
|
printf("\n");
|
|
uint16_t fpgaHardwareVersion = global.readVersion(&cleanStatus);
|
|
uint16_t fpgaSoftwareVersion = system.getExpectedFPGAVersion();
|
|
printf("FPGA Hardware Version: %X\n", fpgaHardwareVersion);
|
|
printf("FPGA Software Version: %X\n", fpgaSoftwareVersion);
|
|
uint32_t fpgaHardwareRevision = global.readRevision(&cleanStatus);
|
|
uint32_t fpgaSoftwareRevision = system.getExpectedFPGARevision();
|
|
printf("FPGA Hardware Revision: %X.%X.%X\n", (fpgaHardwareRevision >> 20) & 0xFFF, (fpgaHardwareRevision >> 12) & 0xFF, fpgaHardwareRevision & 0xFFF);
|
|
printf("FPGA Software Revision: %X.%X.%X\n", (fpgaSoftwareRevision >> 20) & 0xFFF, (fpgaSoftwareRevision >> 12) & 0xFF, fpgaSoftwareRevision & 0xFFF);
|
|
}
|
|
|
|
}
|
|
|
|
#endif // __printFPGAVersion_h__
|
|
|