chips/pn53x: PN532 now goes in LowVBat mode when setting idle mode from target mode.
This commit is contained in:
parent
be0f0b0828
commit
468027ba2b
1 changed files with 13 additions and 2 deletions
|
@ -668,7 +668,18 @@ pn53x_idle (nfc_device_t *pnd)
|
||||||
{
|
{
|
||||||
switch (CHIP_DATA (pnd)->operating_mode) {
|
switch (CHIP_DATA (pnd)->operating_mode) {
|
||||||
case TARGET:
|
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;
|
break;
|
||||||
case INITIATOR:
|
case INITIATOR:
|
||||||
// Deselect all active communications
|
// Deselect all active communications
|
||||||
|
@ -680,7 +691,7 @@ pn53x_idle (nfc_device_t *pnd)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (CHIP_DATA (pnd)->type == PN532) {
|
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)) {
|
if (!pn53x_PowerDown (pnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue