Use #if defined() everywhere for consistency

Change-Id: Ie291a7cb155b0a2244bdb4d31e91d03d29006157
This commit is contained in:
David Banks 2019-10-16 20:44:36 +01:00
parent f4bff7757c
commit 12338bffc9
2 changed files with 15 additions and 15 deletions

View File

@ -38,7 +38,7 @@ char *cmdStrings[] = {
"help", "help",
"continue", "continue",
"step", "step",
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
"regs", "regs",
"dis", "dis",
"fill", "fill",
@ -81,7 +81,7 @@ void (*cmdFuncs[])(char *params) = {
doCmdHelp, doCmdHelp,
doCmdContinue, doCmdContinue,
doCmdStep, doCmdStep,
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
doCmdRegs, doCmdRegs,
doCmdDis, doCmdDis,
doCmdFill, doCmdFill,
@ -493,7 +493,7 @@ void shiftBreakpointRegister(unsigned int addr, unsigned int mask, unsigned int
shift(trigger, 4); shift(trigger, 4);
} }
#ifdef LCD #if defined(LCD)
// LCD support code (will be depricated soon) // LCD support code (will be depricated soon)
void lcdAddr(unsigned int addr) { void lcdAddr(unsigned int addr) {
int i; int i;
@ -516,7 +516,7 @@ void lcdAddr(unsigned int addr) {
* Host Memory/IO Access helpers * Host Memory/IO Access helpers
********************************************************/ ********************************************************/
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
void loadData(unsigned int data) { void loadData(unsigned int data) {
int i; int i;
for (i = 0; i <= 7; i++) { for (i = 0; i <= 7; i++) {
@ -697,7 +697,7 @@ int logDetails() {
} else { } else {
log0("\n"); log0("\n");
} }
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
if (mode & B_RDWR_MASK) { if (mode & B_RDWR_MASK) {
// It's only safe to do this for brkpts, as it makes memory accesses // It's only safe to do this for brkpts, as it makes memory accesses
logCycleCount(OFFSET_BW_CNTL, OFFSET_BW_CNTH); logCycleCount(OFFSET_BW_CNTL, OFFSET_BW_CNTH);
@ -710,12 +710,12 @@ int logDetails() {
void logAddr() { void logAddr() {
memAddr = hwRead16(OFFSET_IAL); memAddr = hwRead16(OFFSET_IAL);
// Update the LCD display // Update the LCD display
#ifdef LCD #if defined(LCD)
lcdAddr(memAddr); lcdAddr(memAddr);
#endif #endif
// Update the serial console // Update the serial console
logCycleCount(OFFSET_CNTL, OFFSET_CNTH); logCycleCount(OFFSET_CNTL, OFFSET_CNTH);
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
//log0("%04X\n", i_addr); //log0("%04X\n", i_addr);
disMem(memAddr); disMem(memAddr);
#else #else
@ -725,7 +725,7 @@ void logAddr() {
} }
void version() { void version() {
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
log0("%s In-Circuit Emulator version %s\n", NAME, VERSION); log0("%s In-Circuit Emulator version %s\n", NAME, VERSION);
#else #else
log0("%s Bus Monitor version %s\n", NAME, VERSION); log0("%s Bus Monitor version %s\n", NAME, VERSION);
@ -831,7 +831,7 @@ void genericBreakpoint(char *params, unsigned int mode) {
* Test Helpers * Test Helpers
********************************************************/ ********************************************************/
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
char *testNames[6] = { char *testNames[6] = {
"Fixed", "Fixed",
"Checkerboard", "Checkerboard",
@ -965,7 +965,7 @@ void doCmdReset(char *params) {
logAddr(); logAddr();
} }
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
// doCmdRegs is now in regs<cpu>.c // doCmdRegs is now in regs<cpu>.c
@ -1290,7 +1290,7 @@ void doCmdTrigger(char *params) {
void doCmdContinue(char *params) { void doCmdContinue(char *params) {
int i; int i;
int status; int status;
#ifdef LCD #if defined(LCD)
unsigned int i_addr; unsigned int i_addr;
#endif #endif
int reset = 0; int reset = 0;
@ -1329,7 +1329,7 @@ void doCmdContinue(char *params) {
int cont = 1; int cont = 1;
do { do {
// Update the LCD display // Update the LCD display
#ifdef LCD #if defined(LCD)
i_addr = hwRead16(OFFSET_IAL); i_addr = hwRead16(OFFSET_IAL);
lcdAddr(i_addr); lcdAddr(i_addr);
#endif #endif
@ -1368,7 +1368,7 @@ void initialize() {
MUX_DDR = 0; MUX_DDR = 0;
CTRL_PORT = 0; CTRL_PORT = 0;
Serial_Init(57600,57600); Serial_Init(57600,57600);
#ifdef LCD #if defined(LCD)
lcd_init(); lcd_init();
lcd_puts("Addr: xxxx"); lcd_puts("Addr: xxxx");
#endif #endif

View File

@ -4,7 +4,7 @@
#include "status.h" #include "status.h"
#include "dis.h" #include "dis.h"
#ifdef LCD #if defined(LCD)
#include "hd44780.h" #include "hd44780.h"
#endif #endif
@ -24,7 +24,7 @@
unsigned int hwRead8(unsigned int offset); unsigned int hwRead8(unsigned int offset);
unsigned int hwRead16(unsigned int offset); unsigned int hwRead16(unsigned int offset);
#ifdef CPU_EMBEDDED #if defined(CPU_EMBEDDED)
unsigned int disMem(unsigned int addr); unsigned int disMem(unsigned int addr);
void loadData(unsigned int data); void loadData(unsigned int data);
void loadAddr(unsigned int addr); void loadAddr(unsigned int addr);