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: FastPWM GMD_template_lib mbed
Fork of NewMD2 by
Diff: main.cpp
- Revision:
- 13:7fac7b2f8fae
- Parent:
- 12:78fa1247aec4
- Child:
- 14:cc8d5686e57c
diff -r 78fa1247aec4 -r 7fac7b2f8fae main.cpp
--- a/main.cpp Thu Aug 25 00:39:37 2016 +0000
+++ b/main.cpp Mon Sep 05 01:46:26 2016 +0000
@@ -29,6 +29,11 @@
timer.start();
while (true){
+ if (timer.read_ms() > timeout_ms) {
+ // I2Cの通信がタイムアウトしたなら開放
+ md.release();
+ }
+
char buf;
switch (i2c.receive()){
case I2CSlave::ReadAddressed:
@@ -46,10 +51,6 @@
break;
case I2CSlave::NoData:
- if (timer.read_ms() > timeout_ms) {
- // I2Cの通信がタイムアウトしたなら開放
- md.release();
- }
break;
}
}
