From 814ccad1e30f0bff0eda5ecef64a40970b8222d2 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Thu, 7 Oct 2010 09:46:21 +0000 Subject: [PATCH] Only send WriteRegister command if register sent value is different from actual one. --- libnfc/chips/pn53x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 4598a0c..2310d7a 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -222,7 +222,7 @@ pn53x_set_reg (nfc_device_t * pnd, uint16_t ui16Reg, uint8_t ui8SymbolMask, uint return false; abtCmd[4] = ui8Value | (ui8Current & (~ui8SymbolMask)); - return pn53x_transceive (pnd, abtCmd, sizeof (pncmd_set_register), NULL, NULL); + return (abtCmd[4] != ui8Current) ? pn53x_transceive (pnd, abtCmd, sizeof (pncmd_set_register), NULL, NULL) : true; } bool