mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
better handling of application reset in emulation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "AntennaLevel.h"
|
||||
#include "LEDHook.h"
|
||||
#include "Application/Application.h"
|
||||
|
||||
#define FIELD_MIN_RSSI 500
|
||||
|
||||
@@ -8,7 +9,11 @@ void AntennaLevelTick(void)
|
||||
uint16_t rssi = AntennaLevelGet();
|
||||
|
||||
if (rssi < FIELD_MIN_RSSI)
|
||||
{
|
||||
LEDHook(LED_FIELD_DETECTED, LED_OFF);
|
||||
else
|
||||
if (ActiveConfiguration.UidSize != 0) // this implies that we are emulating right now
|
||||
ApplicationReset(); // reset the application just like a real card gets reset when there is no field
|
||||
} else {
|
||||
LEDHook(LED_FIELD_DETECTED, LED_ON);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,6 @@ void MifareUltralightAppInit(void)
|
||||
void MifareUltralightAppReset(void)
|
||||
{
|
||||
State = STATE_IDLE;
|
||||
FromHalt = false;
|
||||
}
|
||||
|
||||
void MifareUltralightAppTask(void)
|
||||
|
||||
@@ -433,8 +433,6 @@ void ISO14443ACodecTask(void) {
|
||||
/* We have to generate the parity bits ourself */
|
||||
ParityBufferPtr = 0;
|
||||
}
|
||||
} else {
|
||||
ApplicationReset();
|
||||
}
|
||||
|
||||
if (AnswerBitCount != ISO14443A_APP_NO_RESPONSE) {
|
||||
|
||||
Reference in New Issue
Block a user