Skip to content

Commit

Permalink
chips/pn53x: PN532 now goes in LowVBat mode when setting idle mode fr…
Browse files Browse the repository at this point in the history
…om target mode.
  • Loading branch information
neomilium committed May 9, 2011
1 parent be0f0b0 commit 468027b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions libnfc/chips/pn53x.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,18 @@ pn53x_idle (nfc_device_t *pnd)
{
switch (CHIP_DATA (pnd)->operating_mode) {
case TARGET:
return pn53x_InRelease (pnd, 0);
// InRelease used in target mode stops the target emulation and no more
// tag are seen from external initiator
if (!pn53x_InRelease (pnd, 0)) {
return false;
}
if (CHIP_DATA (pnd)->type == PN532) {
// Use PowerDown to go in "Low VBat" power mode
if (!pn53x_PowerDown (pnd)) {
return false;
}
CHIP_DATA (pnd)->power_mode = LOWVBAT;
}
break;
case INITIATOR:
// Deselect all active communications
Expand All @@ -680,7 +691,7 @@ pn53x_idle (nfc_device_t *pnd)
return false;
}
if (CHIP_DATA (pnd)->type == PN532) {
// Use InPowerDown to go in "Low VBat"
// Use PowerDown to go in "Low VBat" power mode
if (!pn53x_PowerDown (pnd)) {
return false;
}
Expand Down

0 comments on commit 468027b

Please sign in to comment.