From 0daa5822f5cd416e946462c0685b9583305ba58a Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Fri, 8 Apr 2011 14:42:29 +0000 Subject: [PATCH] add SCM SCL3711 led support: the led is now On/Off accordingly to field activation. --- libnfc/drivers/pn53x_usb.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/libnfc/drivers/pn53x_usb.c b/libnfc/drivers/pn53x_usb.c index 061b333..db1a15b 100644 --- a/libnfc/drivers/pn53x_usb.c +++ b/libnfc/drivers/pn53x_usb.c @@ -583,13 +583,23 @@ pn53x_usb_configure (nfc_device_t * pnd, const nfc_device_option_t ndo, const bo if (!pn53x_configure (pnd, ndo, bEnable)) return false; - if (ASK_LOGO == DRIVER_DATA (pnd)->model) { - if (NDO_ACTIVATE_FIELD == ndo) { - // Switch on/off progressive field according to ACTIVATE_FIELD option - DBG ("Switch progressive field %s", bEnable ? "On" : "Off"); - if (!pn53x_write_register (pnd, SFR_P3, _BV(P31) | _BV (P34), bEnable ? _BV (P34) : _BV (P31))) - return false; - } + switch (DRIVER_DATA (pnd)->model) { + case ASK_LOGO: + if (NDO_ACTIVATE_FIELD == ndo) { + // Switch on/off progressive field according to ACTIVATE_FIELD option + DBG ("Switch progressive field %s", bEnable ? "On" : "Off"); + if (!pn53x_write_register (pnd, SFR_P3, _BV(P31) | _BV (P34), bEnable ? _BV (P34) : _BV (P31))) + return false; + } + break; + case SCM_SCL3711: + if (NDO_ACTIVATE_FIELD == ndo) { + if (!pn53x_write_register (pnd, SFR_P3, _BV (P32), bEnable ? 0 : _BV (P32))) + return false; + } + break; + default: + break; } return true; }