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 eMPL_MPU6050 by
Revision 2:9f98336fa3cc, committed 2016-03-10
- Comitter:
- sclassen
- Date:
- Thu Mar 10 05:34:59 2016 +0000
- Parent:
- 1:6aedb937cb38
- Commit message:
- avoid prints to stdio
Changed in this revision
| mbed_i2c.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/mbed_i2c.c Thu Nov 05 01:38:50 2015 +0000
+++ b/mbed_i2c.c Thu Mar 10 05:34:59 2016 +0000
@@ -4,6 +4,9 @@
#include "gpio_api.h"
#include "nrf_delay.h"
+#define log_i(...)
+#define log_e(...)
+
static i2c_t mbed_i2c_object = {0,};
void mbed_i2c_init(PinName sda, PinName scl)
@@ -51,8 +54,8 @@
gpio_init_in(&sda_io, sda);
if (!gpio_read(&sda_io)) {
- printf("sda is always 0, i2c bus is not released\r\n");
- printf("try to clear i2c bus\r\n");
+ log_i("sda is always 0, i2c bus is not released\r\n");
+ log_i("try to clear i2c bus\r\n");
gpio_init_out(&scl_io, scl);
// Clock max 18 pulses worst case scenario(9 for master to send the rest of command and 9
@@ -65,7 +68,7 @@
}
if (!gpio_read(&sda_io)) {
- printf("warning! sda is still 0,, i2c bus is not released\r\n");
+ log_e("warning! sda is still 0, i2c bus is not released\r\n");
}
}
