serial_extend library for array data transmission and reception
Dependents: receives_robot_wheel
Diff: serial_extend.cpp
- Revision:
- 1:e808dd01f134
- Parent:
- 0:fbf5705f90cc
--- a/serial_extend.cpp Sat Oct 04 12:19:26 2014 +0000 +++ b/serial_extend.cpp Sun Oct 05 01:00:00 2014 +0000 @@ -83,7 +83,7 @@ } - void serial_extend::TX(void){//送信バッファ空き割り込み用関数 + void serial_extend::TX(void){ if(__stop_write==1){return;} @@ -97,16 +97,16 @@ txData[k] = __writeData[k-1]; } - //送るデータ = センサ等のデータ + for(i=KEY+1, tx_checkcode=0; i<__writeSize+1; i++){ tx_checkcode ^= txData[i]; - }//CHECKCODE作成 + } //CHECKCODE txData[__writeSize+1] = tx_checkcode; tx=0; } __serial__.putc(txData[tx]); tx++; - }//受信割り込み用関数 + } void serial_extend::RX(void){ @@ -125,7 +125,7 @@ if(rx==__readSize+1){ for(i=KEY+1, rx_checkcode=0; i<__readSize+1; i++){ rx_checkcode ^= rxData[i]; - }//CHECKCODE作成 + } //CHECKCODE } if(rx >= __readSize+2){ @@ -135,7 +135,7 @@ __readData[m-1] = rxData[m]; } - //使うデータ = 受け取ったデータ + } rx=0; }