X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=src%2Frfid_reader_openpcd.c;h=866bef44aad2f1b86cc44a4149e3953e7c200b92;hb=e76727a55961169ff14d799aaaf7f69f8ae8bfe9;hp=dc9db103acbffeb8c57594cda638e53965d71d66;hpb=6c4d6b5bb56d258e0de09da93f3e49502f7f623c;p=librfid diff --git a/src/rfid_reader_openpcd.c b/src/rfid_reader_openpcd.c index dc9db10..866bef4 100644 --- a/src/rfid_reader_openpcd.c +++ b/src/rfid_reader_openpcd.c @@ -32,7 +32,6 @@ #include #include -#include #include #include @@ -57,6 +56,12 @@ static struct openpcd_hdr *rcv_hdr; #ifndef LIBRFID_FIRMWARE +#ifdef __MINGW32__ +#include "libusb_dyn.h" +#else /*__MINGW32__*/ +#include +#endif/*__MINGW32__*/ + static struct usb_device *dev; static struct usb_dev_handle *hdl; @@ -95,7 +100,7 @@ static int openpcd_xcv(u_int8_t cmd, u_int8_t reg, u_int8_t val, ret = openpcd_send_command(cmd, reg, val, len, data); if (ret < 0) return ret; - if (ret < sizeof(sizeof(struct openpcd_hdr))) + if (ret < sizeof(struct openpcd_hdr)) return -EINVAL; return openpcd_recv_reply(); @@ -226,14 +231,14 @@ const struct rfid_asic_transport openpcd_rat = { static int openpcd_reg_write(struct rfid_asic_transport_handle *rath, unsigned char reg, unsigned char value) { - return rc632_reg_write(rath, reg, value); + return opcd_rc632_reg_write(rath, reg, value); } static int openpcd_reg_read(struct rfid_asic_transport_handle *rath, unsigned char reg, unsigned char *value) { - return rc632_reg_write(rath, reg, value); + return opcd_rc632_reg_read(rath, reg, value); } @@ -241,7 +246,7 @@ static int openpcd_fifo_read(struct rfid_asic_transport_handle *rath, unsigned char num_bytes, unsigned char *buf) { - return rc632_reg_write(rath, num_bytes, buf); + return opcd_rc632_fifo_read(rath, num_bytes, buf); } static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath, @@ -249,7 +254,7 @@ static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath, const unsigned char *bytes, unsigned char flags) { - return rc632_fifo_write(rath, len, bytes, flags); + return opcd_rc632_fifo_write(rath, len, bytes, flags); } const struct rfid_asic_transport openpcd_rat = {