mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-19 05:53:45 +00:00
chips/pn53x: PN532 now goes in LowVBat mode when setting idle mode from target mode.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user