mirror of
https://github.com/akuker/RASCSI.git
synced 2025-08-15 08:27:34 +00:00
Updated to allow command handler to run on x86 systems for development purposes. Also fixed warning about using fprintf incorrectly
This commit is contained in:
@@ -144,6 +144,10 @@ GPIOBUS::~GPIOBUS()
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
BOOL FASTCALL GPIOBUS::Init(mode_e mode)
|
BOOL FASTCALL GPIOBUS::Init(mode_e mode)
|
||||||
{
|
{
|
||||||
|
#if defined(__x86_64__) || defined(__X86__)
|
||||||
|
// When we're running on x86, there is no hardware to talk to, so just return.
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
void *map;
|
void *map;
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
@@ -379,6 +383,8 @@ BOOL FASTCALL GPIOBUS::Init(mode_e mode)
|
|||||||
SetControl(PIN_ENB, ENB_ON);
|
SetControl(PIN_ENB, ENB_ON);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#endif // ifdef __x86_64__ || __X86__
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -388,6 +394,9 @@ BOOL FASTCALL GPIOBUS::Init(mode_e mode)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void FASTCALL GPIOBUS::Cleanup()
|
void FASTCALL GPIOBUS::Cleanup()
|
||||||
{
|
{
|
||||||
|
#if defined(__x86_64__) || defined(__X86__)
|
||||||
|
return;
|
||||||
|
#else
|
||||||
int i;
|
int i;
|
||||||
int pin;
|
int pin;
|
||||||
|
|
||||||
@@ -419,6 +428,7 @@ void FASTCALL GPIOBUS::Cleanup()
|
|||||||
|
|
||||||
// Set drive strength back to 8mA
|
// Set drive strength back to 8mA
|
||||||
DrvConfig(3);
|
DrvConfig(3);
|
||||||
|
#endif // ifdef __x86_64__ || __X86__
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -428,6 +438,9 @@ void FASTCALL GPIOBUS::Cleanup()
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void FASTCALL GPIOBUS::Reset()
|
void FASTCALL GPIOBUS::Reset()
|
||||||
{
|
{
|
||||||
|
#if defined(__x86_64__) || defined(__X86__)
|
||||||
|
return;
|
||||||
|
#else
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
@@ -506,6 +519,7 @@ void FASTCALL GPIOBUS::Reset()
|
|||||||
|
|
||||||
// Initialize all signals
|
// Initialize all signals
|
||||||
signals = 0;
|
signals = 0;
|
||||||
|
#endif // ifdef __x86_64__ || __X86__
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -515,6 +529,9 @@ void FASTCALL GPIOBUS::Reset()
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
DWORD FASTCALL GPIOBUS::Aquire()
|
DWORD FASTCALL GPIOBUS::Aquire()
|
||||||
{
|
{
|
||||||
|
#if defined(__x86_64__) || defined(__X86__)
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
signals = *level;
|
signals = *level;
|
||||||
|
|
||||||
#if SIGNAL_CONTROL_MODE < 2
|
#if SIGNAL_CONTROL_MODE < 2
|
||||||
@@ -523,6 +540,7 @@ DWORD FASTCALL GPIOBUS::Aquire()
|
|||||||
#endif // SIGNAL_CONTROL_MODE
|
#endif // SIGNAL_CONTROL_MODE
|
||||||
|
|
||||||
return signals;
|
return signals;
|
||||||
|
#endif // ifdef __x86_64__ || __X86__
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -39,7 +39,7 @@ BOOL SendCommand(char *buf)
|
|||||||
// Send the command
|
// Send the command
|
||||||
fp = fdopen(fd, "r+");
|
fp = fdopen(fd, "r+");
|
||||||
setvbuf(fp, NULL, _IONBF, 0);
|
setvbuf(fp, NULL, _IONBF, 0);
|
||||||
fprintf(fp, buf);
|
fputs(buf, fp);
|
||||||
|
|
||||||
// Receive the message
|
// Receive the message
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Reference in New Issue
Block a user