From 858354638e68319e2380a2927353c1eb67657253 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Fri, 19 Aug 2016 00:02:05 +0200 Subject: Trigger soft reattach when card is detected. --- main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 1632fa1..95626f2 100644 --- a/main.cpp +++ b/main.cpp @@ -480,7 +480,6 @@ int main() { Time::sleep(10); USB.reg.BCDR |= 1 << 15; - //usb_disc.off(); RCC.enable(RCC.SPI1); @@ -524,7 +523,7 @@ int main() { cmd_sent = false; if(buf[0] == 128 && buf[14] == 0) { - //usb_disc.on(); + USB.reg.BCDR &= ~(1 << 15); uint8_t* id_raw = &buf[11]; uint8_t* id_ascii = sectors[4]; for(uint32_t i = 0; i < 8; i++) { @@ -532,7 +531,7 @@ int main() { *id_ascii++ = "0123456789ABCDEF"[*id_raw-- & 0xf]; } Time::sleep(10); - //usb_disc.off(); + USB.reg.BCDR |= 1 << 15; nfc_delay_until = Time::time() + 5000; // Valid for five seconds. } else { -- cgit v1.2.3