uint8_t型とunsigned char型に対応した多バイトシリアル通信用ライブラリ
Dependents: multiserial_test serial_check_controller receiverA receiver_transmitter ... more
Revision 26:0b108faf5d5a, committed 2014-10-15
- Comitter:
- bousiya03
- Date:
- Wed Oct 15 11:10:00 2014 +0000
- Parent:
- 20:9e14b87bfdac
- Child:
- 27:6dcd6c2fba1a
- Commit message:
- ????????
Changed in this revision
MultiSerial.cpp | Show annotated file Show diff for this revision Revisions of this file |
MultiSerial.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MultiSerial.cpp Tue Oct 14 10:11:18 2014 +0000 +++ b/MultiSerial.cpp Wed Oct 15 11:10:00 2014 +0000 @@ -37,6 +37,12 @@ */ } + void MultiSerial::safety(){ + + *__readData = 0; + + } + void MultiSerial::start_write(){ __stop_write = 0; @@ -132,7 +138,9 @@ if(rx >= __readSize+2){ if(rxData[__readSize+1]==rx_checkcode){ - __check_rx = 1; + __check_rx = 1; + + xbee_check.attach(this,&MultiSerial::safety,0.5); for(int m=1;m<=__readSize;m++){ __readData[m-1] = rxData[m];
--- a/MultiSerial.h Tue Oct 14 10:11:18 2014 +0000 +++ b/MultiSerial.h Wed Oct 15 11:10:00 2014 +0000 @@ -105,10 +105,14 @@ uint8_t re_first_bit(); void check_rx_wait(); + + void safety(); protected: Serial __serial__; + + Timeout xbee_check; volatile uint8_t* __readData; volatile uint8_t __readSize;