Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of football_project by
Diff: main.cpp
- Revision:
- 4:17b8edf264c3
- Parent:
- 3:388e441be8df
- Child:
- 5:1b9734e68327
diff -r 388e441be8df -r 17b8edf264c3 main.cpp
--- a/main.cpp Mon Apr 13 17:41:48 2015 +0000
+++ b/main.cpp Thu Apr 16 17:10:19 2015 +0000
@@ -31,6 +31,8 @@
#define NEED_CONSOLE_OUTPUT 0 /* Set this if you need debug messages on the console;
* it will have an impact on code-size and power consumption. */
+#define LOOPBACK_MODE // Loopback mode
+
#if NEED_CONSOLE_OUTPUT
#define DEBUG(...) { printf(__VA_ARGS__); }
#else
@@ -95,8 +97,10 @@
DEBUG( "received %u bytes\n\r", bytesRead );
+#ifdef LOOPBACK_MODE
// Loopback data from Central.
-// ble.updateCharacteristicValue( uartServicePtr->getRXCharacteristicHandle(), params->data, bytesRead ); // Notifies.
+ ble.updateCharacteristicValue( uartServicePtr->getRXCharacteristicHandle(), params->data, bytesRead ); // Notifies.
+#endif
// Also write to serial port...
ble.readCharacteristicValue( uartServicePtr->getTXCharacteristicHandle(), buf, &bytesRead );
@@ -157,6 +161,10 @@
pcfc.rxClear();
// pc.attach( uartCB, pc.RxIrq );
pcfc.printf( "\r\nNano nano!\r\n" );
+#ifdef LOOPBACK_MODE
+ pcfc.printf( "\r\nIn BLE Loopback mode.\r\n" );
+#endif
+
DEBUG( "Initialising the nRF51822\n\r" );
