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 mbed-src by
Diff: vendor/NXP/LPC812/hal/i2c_api.c
- Revision:
- 13:bd9ff402dd42
- Parent:
- 10:3bc89ef62ce7
diff -r 5fa2273de5db -r bd9ff402dd42 vendor/NXP/LPC812/hal/i2c_api.c
--- a/vendor/NXP/LPC812/hal/i2c_api.c Wed Jul 24 11:11:21 2013 +0100
+++ b/vendor/NXP/LPC812/hal/i2c_api.c Mon Aug 05 02:27:27 2013 +0000
@@ -87,9 +87,13 @@
return status;
}
-inline void i2c_stop(i2c_t *obj) {
+inline int i2c_stop(i2c_t *obj) {
obj->i2c->MSTCTL = (1 << 2) | (1 << 0);
- while ((obj->i2c->STAT & ((1 << 0) | (7 << 1))) != ((1 << 0) | (0 << 1)));
+ while ((obj->i2c->STAT & ((1 << 0) | (7 << 1))) != ((1 << 0) | (0 << 1))){
+ timeout++;
+ if(timeout > 10000) return -1;
+ }
+ return 0;
}
