[FL-1424] NFC emulate CLI command (#514)

* nfc: move cli commands to separate file
* nfc: add nfc_emulate CLI command
* nfc: rework nfc emulate call from gui
* nfc: deactivate nfc state machine when exiting worker

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-06-10 15:01:48 +03:00
committed by GitHub
parent 4ad5245969
commit 3a2121bbb8
7 changed files with 87 additions and 138 deletions

View File

@@ -89,7 +89,6 @@ bool api_hal_nfc_detect(rfalNfcDevice **dev_list, uint8_t* dev_cnt, uint32_t cyc
bool api_hal_nfc_listen(uint32_t timeout) {
api_hal_nfc_exit_sleep();
rfalLowPowerModeStop();
rfalNfcState state = rfalNfcGetState();
if(state == RFAL_NFC_STATE_NOTINIT) {
@@ -130,6 +129,7 @@ bool api_hal_nfc_listen(uint32_t timeout) {
return false;
}
if(state == RFAL_NFC_STATE_LISTEN_ACTIVATION) {
start = DWT->CYCCNT;
continue;
}
taskYIELD();

View File

@@ -89,7 +89,6 @@ bool api_hal_nfc_detect(rfalNfcDevice **dev_list, uint8_t* dev_cnt, uint32_t cyc
bool api_hal_nfc_listen(uint32_t timeout) {
api_hal_nfc_exit_sleep();
rfalLowPowerModeStop();
rfalNfcState state = rfalNfcGetState();
if(state == RFAL_NFC_STATE_NOTINIT) {
@@ -130,6 +129,7 @@ bool api_hal_nfc_listen(uint32_t timeout) {
return false;
}
if(state == RFAL_NFC_STATE_LISTEN_ACTIVATION) {
start = DWT->CYCCNT;
continue;
}
taskYIELD();