Added a custom wait function to enable interrupts
Fork of m3pi by
Diff: m3pi.cpp
- Revision:
- 9:35c3c0fa2416
- Parent:
- 7:9b128cebb3c2
--- a/m3pi.cpp Thu May 12 13:26:37 2011 +0000 +++ b/m3pi.cpp Tue Apr 08 16:43:07 2014 +0000 @@ -27,11 +27,13 @@ m3pi::m3pi(PinName nrst, PinName tx, PinName rx) : Stream("m3pi"), _nrst(nrst), _ser(tx, rx) { _ser.baud(115200); reset(); + tail_flag = 0; } m3pi::m3pi() : Stream("m3pi"), _nrst(p23), _ser(p9, p10) { _ser.baud(115200); reset(); + tail_flag = 0; } @@ -194,7 +196,13 @@ return(_ser.getc()); } - +void m3pi::wait_10ms (int time){ + int i = 0; + while(tail_flag == 0 && i < time){ + wait(0.01); + i++; + } +}