summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2016-08-19 00:02:05 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2016-08-19 00:02:05 +0200
commit858354638e68319e2380a2927353c1eb67657253 (patch)
tree1ac99ed3073970efd317551cc474ef08abf15f2b
parent338570827532f709702e080fa83581a1b7cd8be9 (diff)
Trigger soft reattach when card is detected.
-rw-r--r--main.cpp5
1 files 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 {