Implement LF RFID emulation (#208)
* migrate code from old repo, not work * fix emulation * disable irq handling while RFID emulating * add testcase
This commit is contained in:
@@ -48,6 +48,15 @@ struct Nfc {
|
||||
|
||||
#define EXAMPLE_NFCA_DEVICES 5
|
||||
|
||||
// TODO replace with pubsub
|
||||
static bool isr_enabled = false;
|
||||
|
||||
void nfc_isr() {
|
||||
if(isr_enabled) {
|
||||
st25r3916Isr();
|
||||
}
|
||||
}
|
||||
|
||||
void nfc_worker_task(void* context) {
|
||||
Nfc* nfc = context;
|
||||
ReturnCode err;
|
||||
@@ -61,6 +70,8 @@ void nfc_worker_task(void* context) {
|
||||
|
||||
nfc->ticker = 0;
|
||||
|
||||
isr_enabled = true;
|
||||
|
||||
while(widget_is_enabled(nfc->widget)) {
|
||||
rfalFieldOff();
|
||||
platformDelay(1000);
|
||||
@@ -132,6 +143,7 @@ void nfc_worker_task(void* context) {
|
||||
widget_update(nfc->widget);
|
||||
}
|
||||
|
||||
isr_enabled = false;
|
||||
rfalFieldOff();
|
||||
rfalLowPowerModeStart();
|
||||
nfc->ret = ERR_NONE;
|
||||
|
Reference in New Issue
Block a user