Skip to content

Commit

Permalink
Use a #define instead of including a file
Browse files Browse the repository at this point in the history
  • Loading branch information
eflumerf committed Nov 20, 2023
1 parent fdb42e5 commit 0984bfe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cfoInterfaceLib/CFO_Registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace CFOLib {
// struct CFO_Register : public DTCLib::CFOandDTC_Register {
enum CFO_Register : uint16_t
{
#include "dtcInterfaceLib/CFOandDTC_Register.def"
DTCLIB_COMMON_REGISTERS,
CFO_Register_KernelDriverVersion = 0x9040,
CFO_Register_VivadoVersion = 0x9080,
CFO_Register_CFOControl = 0x9100,
Expand Down
14 changes: 0 additions & 14 deletions dtcInterfaceLib/CFOandDTC_Register.def

This file was deleted.

2 changes: 1 addition & 1 deletion dtcInterfaceLib/CFOandDTC_Registers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace DTCLib;
// struct CFOandDTC_Register {
enum CFOandDTC_Register : uint16_t
{
#include "CFOandDTC_Register.def"
DTCLIB_COMMON_REGISTERS
};

// }; //end CFOandDTC_Register enum
Expand Down
13 changes: 13 additions & 0 deletions dtcInterfaceLib/CFOandDTC_Registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@

#include "mu2edev.h"

#define DTCLIB_COMMON_REGISTERS \
CFOandDTC_Register_DesignVersion = 0x9000, \
CFOandDTC_Register_DesignDate = 0x9004, \
CFOandDTC_Register_DesignStatus = 0x9008, \
/* CFOandDTC_Register_VivadoVersion = 0x900C, */ \
CFOandDTC_Register_FPGA_Temperature = 0x9010, \
CFOandDTC_Register_FPGA_VCCINT = 0x9014, \
CFOandDTC_Register_FPGA_VCCAUX = 0x9018, \
CFOandDTC_Register_FPGA_VCCBRAM = 0x901C, \
/* CFOandDTC_Register_Scratch = 0x9030, */ \
/* CFOandDTC_Register_KernelDriverVersion = 0x9040 */ \
CFOandDTC_Register_FPGA_MonitorAlarm = 0x9020

namespace DTCLib {

typedef uint16_t CFOandDTC_Register; //defined enum in CFOandDTC_Registers.cpp
Expand Down
2 changes: 1 addition & 1 deletion dtcInterfaceLib/DTC_Registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace DTCLib {
// struct DTC_Register : public DTCLib::CFOandDTC_Register {
enum DTC_Register : uint16_t
{
#include "CFOandDTC_Register.def"
DTCLIB_COMMON_REGISTERS,
DTC_Register_VivadoVersion = 0x900C,

DTC_Register_Scratch = 0x9030,
Expand Down

0 comments on commit 0984bfe

Please sign in to comment.