Code cleanup.

This commit is contained in:
Romuald Conty 2009-09-08 08:14:36 +00:00
parent 30c2fc4c93
commit 67aa84ad76
5 changed files with 28 additions and 34 deletions

View file

@ -118,9 +118,7 @@ dev_info* dev_pn533_connect(const nfc_device_desc_t* device_desc)
uiDevIndex--; uiDevIndex--;
continue; continue;
} }
#ifdef DEBUG DBG("Found PN533 device.");
printf("Found PN533 device\n");
#endif
// Open the PN533 USB device // Open the PN533 USB device
dsp.pudh = usb_open(dev); dsp.pudh = usb_open(dev);
@ -128,18 +126,14 @@ dev_info* dev_pn533_connect(const nfc_device_desc_t* device_desc)
get_end_points(dev,&dsp); get_end_points(dev,&dsp);
if(usb_set_configuration(dsp.pudh,1) < 0) if(usb_set_configuration(dsp.pudh,1) < 0)
{ {
#ifdef DEBUG DBG("Setting config failed");
printf("Setting config failed\n");
#endif
usb_close(dsp.pudh); usb_close(dsp.pudh);
return INVALID_DEVICE_INFO; return INVALID_DEVICE_INFO;
} }
if(usb_claim_interface(dsp.pudh,0) < 0) if(usb_claim_interface(dsp.pudh,0) < 0)
{ {
#ifdef DEBUG DBG("Can't claim interface");
printf("Can't claim interface\n");
#endif
usb_close(dsp.pudh); usb_close(dsp.pudh);
return INVALID_DEVICE_INFO; return INVALID_DEVICE_INFO;
} }
@ -195,7 +189,7 @@ bool dev_pn533_transceive(const dev_spec ds, const byte_t* pbtTx, const uint32_t
buffer[uiTxLen+6] = 0; buffer[uiTxLen+6] = 0;
#ifdef DEBUG #ifdef DEBUG
printf("Tx: "); printf(" TX: ");
print_hex((byte_t*)buffer,uiTxLen+7); print_hex((byte_t*)buffer,uiTxLen+7);
#endif #endif
@ -218,7 +212,7 @@ bool dev_pn533_transceive(const dev_spec ds, const byte_t* pbtTx, const uint32_t
} }
#ifdef DEBUG #ifdef DEBUG
printf("Rx: "); printf(" RX: ");
print_hex((byte_t*)buf,ret); print_hex((byte_t*)buf,ret);
#endif #endif
@ -234,7 +228,7 @@ bool dev_pn533_transceive(const dev_spec ds, const byte_t* pbtTx, const uint32_t
} }
#ifdef DEBUG #ifdef DEBUG
printf("Rx: "); printf(" RX: ");
print_hex((byte_t*)buf,ret); print_hex((byte_t*)buf,ret);
#endif #endif
} }

View file

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "dev_arygon.h" #include "dev_arygon.h"
const static struct dev_callbacks dev_callbacks_list[] = { const static struct dev_callbacks dev_callbacks_list[] = {
// Driver Name Connect Transceive Disconect // Driver Name Connect Transceive Disconnect
#ifdef HAVE_PCSC_LITE #ifdef HAVE_PCSC_LITE
{ "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect }, { "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect },
#endif #endif