mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
18 lines
535 B
C
18 lines
535 B
C
#include "AntennaLevel.h"
|
|
#include "LEDHook.h"
|
|
#include "Application/Application.h"
|
|
|
|
#define FIELD_MIN_RSSI 500
|
|
|
|
void AntennaLevelTick(void) {
|
|
uint16_t rssi = AntennaLevelGet();
|
|
|
|
if (rssi < FIELD_MIN_RSSI) {
|
|
LEDHook(LED_FIELD_DETECTED, LED_OFF);
|
|
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);
|
|
}
|
|
}
|