summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/acecad.c8
-rw-r--r--src/acecad.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/acecad.c b/src/acecad.c
index 783b2f1..f5d4f25 100644
--- a/src/acecad.c
+++ b/src/acecad.c
@@ -367,12 +367,12 @@ AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
xf86OptionListReport(local->options);
priv->acecadInc = xf86SetIntOption(local->options, "Increment", 0 );
- priv->acecadAutoDev = FALSE;
+ priv->flags &= ~ AUTODEV_FLAG;
s = xf86FindOptionValue(local->options, "Device");
if (!s || (s && (xf86NameCmp(s, "auto-dev") == 0))) {
#ifdef LINUX_INPUT
- priv->acecadAutoDev = TRUE;
+ priv->flags |= AUTODEV_FLAG;
if (!AceCadAutoDevProbe(local, 0))
{
xf86Msg(X_ERROR, "%s: unable to find device\n", local->name);
@@ -541,7 +541,7 @@ DeviceOn (DeviceIntPtr dev)
{
xf86Msg(X_WARNING, "%s: cannot open input device %s\n", local->name, xf86FindOptionValue(local->options, "Device"));
#ifdef LINUX_INPUT
- if (priv->acecadAutoDev && AceCadAutoDevProbe(local, 4))
+ if ((priv->flags & AUTODEV_FLAG) && AceCadAutoDevProbe(local, 4))
local->fd = xf86OpenSerial(local->options);
if (local->fd == -1)
#endif
@@ -830,7 +830,7 @@ USBReadInput (LocalDevicePtr local)
if (len <= 0) {
xf86Msg(X_ERROR, "%s: error reading device: %s\n", local->name, strerror(errno));
- if ((errno == ENODEV) && priv->acecadAutoDev && AceCadAutoDevProbe(local, 4)) {
+ if ((errno == ENODEV) && (priv->flags & AUTODEV_FLAG) && AceCadAutoDevProbe(local, 4)) {
DeviceOff(local->dev);
DeviceOn(local->dev);
}
diff --git a/src/acecad.h b/src/acecad.h
index acba153..79618ae 100644
--- a/src/acecad.h
+++ b/src/acecad.h
@@ -58,6 +58,7 @@
#define ABSOLUTE_FLAG 1
#define USB_FLAG 2
+#define AUTODEV_FLAG 4
#define milisleep(ms) xf86usleep (ms * 1000)
@@ -78,7 +79,6 @@ typedef struct
int acecadMaxY; /* max Y value */
int acecadMaxZ; /* max Y value */
char acecadReportSpeed; /* report speed */
- BOOL acecadAutoDev; /* are using auto-dev */
int flags; /* various flags */
int packeti; /* number of bytes read */
int PacketSize; /* number of bytes read */