summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2013-10-01 19:08:46 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2013-10-01 19:08:46 +0200
commit8f8ebcace5d6813c65afe57c5427a59239e792b3 (patch)
tree2d736b98b50899a19bb1fddafb81047a88dad129
parent665eca30c55cb410e8b6c5a1942118c89b6bae54 (diff)
Wait after bootup so the NFC chip have time to get ready.nfc_msc
-rw-r--r--main.cpp9
1 files 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.