IRremote
Diff: IRremote.cpp
- Revision:
- 4:10a04fa41876
- Parent:
- 3:1ec19fef8a30
diff -r 1ec19fef8a30 -r 10a04fa41876 IRremote.cpp --- a/IRremote.cpp Thu Dec 26 01:47:05 2013 +0000 +++ b/IRremote.cpp Tue Dec 31 03:57:56 2013 +0000 @@ -2,7 +2,7 @@ #include "mbed.h" int IR_cnt, IR_state, IR_bit_cnt, IR_temp; -char IR_buf[4]; +char IR_buf[4]={0xFF,0xFF,0xFF,0xFF}; //IR Timer void IR_check() { @@ -60,4 +60,17 @@ char IRremote::read(int ir_i) { return IR_buf[ir_i]; -} \ No newline at end of file +} +char IRremote::readclear(int ir_i) +{ + char IR_rx; + IR_rx = IR_buf[ir_i]; + IR_buf[ir_i]=0xFF; + return IR_rx; +} +void IRremote::clear() +{ + for(int i=0; i<4; i++) { + IR_buf[i]=0xFF; + } +}