Complete mbed library/workspace for HelloWorld_NFC02A1
Dependencies: NDefLib X_NUCLEO_NFC02A1 mbed
Fork of HelloWorld_NFC02A1 by
X-NUCLEO-NFC02A1 Dynamic NFC Tag Expansion Board Firmware Package
Introduction
This firmware package includes Components Device Drivers, Board Support Package and example applications for STMicroelectronics X-NUCLEO-NFC02A1 Dynamic NFC Tag Expansion Board based on M24LR.
Example Application
This is just a simple "hello world" style program for the X-NUCLEO-NFC02A1 Dynamic NFC Tag Expansion Board. The program writes a URI link to the M24LR dynamic tag using the synchronous programming model. It then reads back the URI from the tag to display it on terminal. The URI can also be retrieved from an NFC enabled smartphone/tablet.
Diff: main.cpp
- Revision:
- 9:0bd2f0c13d3d
- Parent:
- 8:9bdd16ebccfb
- Child:
- 11:d0665d9c28a6
diff -r 9bdd16ebccfb -r 0bd2f0c13d3d main.cpp --- a/main.cpp Fri Sep 30 11:46:24 2016 +0000 +++ b/main.cpp Mon Oct 03 11:58:00 2016 +0000 @@ -43,8 +43,6 @@ #include "NDefLib/NDefNfcTag.h" #include "NDefLib/RecordType/RecordURI.h" -#if 0 -/*----------------------------------------------------------------------------*/ static volatile bool buttonPress=false; // true when the user press the message static void setButtonPress(){ @@ -83,8 +81,6 @@ printf("Error open read Session\n\r"); } } -/*----------------------------------------------------------------------------*/ -#endif /** * Write a Ndef URI message linking to st.com site. @@ -145,9 +141,8 @@ } else printf("Error opening the session\n\r"); - -#if 0 -/*----------------------------------------------------------------------------*/ + +#if defined(TARGET_STM) /* enable the button */ InterruptIn mybutton(USER_BUTTON); @@ -163,9 +158,9 @@ buttonPress=false; } } -/*----------------------------------------------------------------------------*/ +#else + readAndPrintNfcTag(tag); #endif - }