more pedantic cleanup of extraneous tabs, and add a description to LightsDriver_SystemMessage.

This commit is contained in:
AJ Kelly
2011-08-31 12:38:10 -05:00
parent dd2aeb82f6
commit 80ec025588
7 changed files with 17 additions and 20 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ public:
LightsDriver_Export(); LightsDriver_Export();
virtual void Set( const LightsState *ls ); virtual void Set( const LightsState *ls );
/* Get the current lights state. This can be called from a thread. */ // Get the current lights state. This can be called from a thread.
static LightsState GetState(); static LightsState GetState();
private: private:
@@ -1,9 +1,6 @@
// /* LightsDriver_LinuxParallel - Parallel Port Based Lights Driver for Linux
// LightsDriver_LinuxParallel - Parallel Port Based Lights Driver for Linux * This requires root permissions to work! (run as root or suid)
// * This code was written using SystemMessage Driver as template. */
// This requires root permissions to work! (run as root or suid)
// This code was written using SystemMessage Driver as template.
//
#include "global.h" #include "global.h"
#include <sys/io.h> #include <sys/io.h>
@@ -12,6 +9,7 @@
#include "InputMapper.h" #include "InputMapper.h"
#include "Game.h" #include "Game.h"
// xxx: don't hardcode the port address. -aj
static const int PORT_ADDRESS = 0x378; static const int PORT_ADDRESS = 0x378;
static const bool SCREEN_DEBUG = false; static const bool SCREEN_DEBUG = false;
@@ -19,7 +17,7 @@ REGISTER_SOUND_DRIVER_CLASS(LinuxParallel);
LightsDriver_LinuxParallel::LightsDriver_LinuxParallel() LightsDriver_LinuxParallel::LightsDriver_LinuxParallel()
{ {
// Give port's permissions and reset all bits to zero // Give ports permissions and reset all bits to zero
ioperm( PORT_ADDRESS, 1, 1 ); ioperm( PORT_ADDRESS, 1, 1 );
outb( 0, PORT_ADDRESS ); outb( 0, PORT_ADDRESS );
} }
@@ -36,7 +34,7 @@ void LightsDriver_LinuxParallel::Set( const LightsState *ls )
// Set LightState to port // Set LightState to port
RString s; RString s;
// Prepare Screen Output too for debugging // Prepare screen output too for debugging
s += "LinuxParallel Lights Driver Debug\n"; s += "LinuxParallel Lights Driver Debug\n";
s += "Lights Mode: " + LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n"; s += "Lights Mode: " + LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n";
@@ -75,7 +73,6 @@ void LightsDriver_LinuxParallel::Set( const LightsState *ls )
/* /*
* (c) 2004 Hugo Hromic M. <[email protected]> * (c) 2004 Hugo Hromic M. <[email protected]>
*
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
@@ -1,3 +1,4 @@
/* LightsDriver_SystemMessage: Outputs light state as a system message. */
#ifndef LightsDriver_SystemMessage_H #ifndef LightsDriver_SystemMessage_H
#define LightsDriver_SystemMessage_H #define LightsDriver_SystemMessage_H
@@ -13,6 +13,7 @@ typedef short int (WINAPI ISDRIVERINSTALLED)();
ISDRIVERINSTALLED* IsDriverInstalled = NULL; ISDRIVERINSTALLED* IsDriverInstalled = NULL;
const int LIGHTS_PER_PARALLEL_PORT = 8; const int LIGHTS_PER_PARALLEL_PORT = 8;
// xxx: don't hardcode the port addresses. -aj
const int MAX_PARALLEL_PORTS = 3; const int MAX_PARALLEL_PORTS = 3;
short LPT_ADDRESS[MAX_PARALLEL_PORTS] = short LPT_ADDRESS[MAX_PARALLEL_PORTS] =
{ {
+2 -4
View File
@@ -1,7 +1,5 @@
/* /* LightsDriver_Win32Parallel - Control lights with Kit 74:
* LightsDriver_Win32Parallel - Control lights with Kit 74: * http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=kit+74+relay */
* http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=kit+74+relay
*/
#ifndef LightsDriver_Win32Parallel_H #ifndef LightsDriver_Win32Parallel_H
#define LightsDriver_Win32Parallel_H #define LightsDriver_Win32Parallel_H