+#endif\r
+\r
+/*\r
+OBJECTIVE\r
+Listen and detect an external reader. Determine the best location\r
+for the antenna.\r
+\r
+INSTRUCTIONS:\r
+Inside the ListenReaderField() function, there is two mode.\r
+By default, when you call the function, you will enter mode 1.\r
+If you press the PM3 button one time, you will enter mode 2.\r
+If you press the PM3 button a second time, you will exit the function.\r
+\r
+DESCRIPTION OF MODE 1:\r
+This mode just listens for an external reader field and lights up green\r
+for HF and/or red for LF. This is the original mode of the detectreader\r
+function.\r
+\r
+DESCRIPTION OF MODE 2:\r
+This mode will visually represent, using the LEDs, the actual strength of the\r
+current compared to the maximum current detected. Basically, once you know\r
+what kind of external reader is present, it will help you spot the best location to place\r
+your antenna. You will probably not get some good results if there is a LF and a HF reader\r
+at the same place! :-)\r
+\r
+LIGHT SCHEME USED:\r
+*/\r
+static const char LIGHT_SCHEME[] = {\r
+ 0x0, /* ---- | No field detected */\r
+ 0x1, /* X--- | 14% of maximum current detected */\r
+ 0x2, /* -X-- | 29% of maximum current detected */\r
+ 0x4, /* --X- | 43% of maximum current detected */\r
+ 0x8, /* ---X | 57% of maximum current detected */\r
+ 0xC, /* --XX | 71% of maximum current detected */\r
+ 0xE, /* -XXX | 86% of maximum current detected */\r
+ 0xF, /* XXXX | 100% of maximum current detected */\r
+};\r
+static const int LIGHT_LEN = sizeof(LIGHT_SCHEME)/sizeof(LIGHT_SCHEME[0]);\r
+\r
+void ListenReaderField(int limit)\r