This hack is activated by preloading libusb-driver-trenz.so.
-CFLAGS=-Wall
+CFLAGS=-Wall -fPIC
-all: libusb-driver.so libusb-driver-DEBUG.so
+SOBJECTS=libusb-driver.so libusb-driver-DEBUG.so libusb-driver-trenz.so
+
+all: $(SOBJECTS)
libusb-driver.so: usb-driver.c usb-driver.h
- gcc -fPIC $(CFLAGS) $< -o $@ -ldl -lusb -lpthread -shared
+ gcc $(CFLAGS) $< -o $@ -ldl -lusb -lpthread -shared
+
+libusb-driver-trenz.so: usb-driver.c usb-driver.h
+ gcc -DTRENZ $(CFLAGS) $< -o $@ -ldl -lusb -lpthread -shared
libusb-driver-DEBUG.so: usb-driver.c usb-driver.h
- gcc -fPIC -DDEBUG $(CFLAGS) $< -o $@ -ldl -lusb -lpthread -shared
+ gcc -DDEBUG $(CFLAGS) $< -o $@ -ldl -lusb -lpthread -shared
clean:
- rm -f libusb-driver.so libusb-driver-DEBUG.so
+ rm -f $(SOBJECTS)
.PHONY: clean all
To use the device as an ordinary user, put the user in the group 'lp'
+If you have an almost compatible cable which works with other software but not
+with Impact, try preloading libusb-driver-trenz.so instead of libusb-driver.so.
+It includes a hack by Stefan Ziegenbalg to force detection of a parallel cable.
+
+
Parallel Cable IV is currently only supported in 'compatibility mode', as no
attempt to configure the ECP registers is done by this library.
int ret = 0;
unsigned long port = (unsigned long)tr->dwPort;
unsigned char val;
+ static int last_pp_write = 0;
DPRINTF("dwPort: 0x%lx, cmdTrans: %lu, dwbytes: %ld, fautoinc: %ld, dwoptions: %ld\n",
(unsigned long)tr->dwPort, tr->cmdTrans, tr->dwBytes,
case PP_WRITE:
ret = ioctl(parportfd, PPWDATA, &val);
+ last_pp_write = val;
break;
default:
break;
}
} else if (port == ppbase + PP_STATUS) {
- DPRINTF("status port\n");
+ DPRINTF("status port (last write: %d)\n", last_pp_write);
switch(tr->cmdTrans) {
case PP_READ:
ret = ioctl(parportfd, PPRSTATUS, &val);
+#ifdef TRENZ
+ val &= 95;
+ if (last_pp_write & 64)
+ val |= 32;
+ else
+ val |= 128;
+#endif
break;
case PP_WRITE: