From 8f8ebcace5d6813c65afe57c5427a59239e792b3 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Tue, 1 Oct 2013 19:08:46 +0200 Subject: Wait after bootup so the NFC chip have time to get ready. --- main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 3722105..9e26ba1 100644 --- a/main.cpp +++ b/main.cpp @@ -452,7 +452,7 @@ int main() { RCC.enable(RCC.GPIOB); usb_disc.on(); - usb_disc.set_type(Pin::OpenDrain); + //usb_disc.set_type(Pin::OpenDrain); usb_disc.set_mode(Pin::Output); usb_dm.set_mode(Pin::AF); @@ -462,9 +462,6 @@ int main() { usb.init(); - Time::sleep(10); - usb_disc.off(); - RCC.enable(RCC.SPI1); nfc_irq_out.set_mode(Pin::Input); @@ -490,9 +487,13 @@ int main() { bool cmd_sent = false; uint32_t nfc_delay_until = 0; + Time::sleep(1000); + cr95hf.send_cmd(0x02, 2, (uint8_t*)"\x01\x05"); // Select ISO 15693 cr95hf.get_response(64, buf); + usb_disc.off(); + while(1) { if(Time::time() < nfc_delay_until) { // Just do nothing. -- cgit v1.2.3