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.
Dependencies: mbed-rtos mbed-src
Diff: I2CDriverTest01.h
- Revision:
- 6:5b98c902a659
- Parent:
- 4:eafa7efcd771
- Child:
- 8:5be85bd4c5ba
diff -r 8a418c89e515 -r 5b98c902a659 I2CDriverTest01.h
--- a/I2CDriverTest01.h Sat Apr 20 11:56:35 2013 +0000
+++ b/I2CDriverTest01.h Sat Apr 20 20:06:44 2013 +0000
@@ -33,7 +33,7 @@
i2c.read(adr, reg, result, g_len, 1);
uint32_t dt=us_ticker_read()-t1;
uint16_t tm=((static_cast<uint16_t>(result[0])<<8)|static_cast<uint16_t>(result[1]));
-
+
if(--g_disco>0) printf("tm=%4dus dt=%4dus\n",tm,dt);
}
}
@@ -46,11 +46,16 @@
Thread::wait(100);
highPrioTicker.start(1);
+#if defined(TARGET_LPC1768)
const int nTest=7;
- const int freq[nTest]= {4e5, 4e5, 4e5, 4e5, 4e5, 1e5, 1e5};
- const int len[nTest]= {1, 4, 9, 16, 25, 1, 6};
-
- for(int i=0; i<nTest; ++i){
+ const int freq[nTest]= {1e5, 1e5, 1e5, 4e5, 4e5, 4e5, 4e5};
+ const int len[nTest]= {1, 4, 6, 1, 6, 12, 25};
+#elif defined(TARGET_LPC11U24)
+ const int nTest=5;
+ const int freq[nTest]= {1e5, 1e5, 4e5, 4e5, 4e5 };
+ const int len[nTest]= {1, 4, 1, 6, 12};
+#endif
+ for(int i=0; i<nTest; ++i) {
g_freq = freq[i];
g_len = len[i];
printf("f=%d l=%d\n",g_freq,g_len);