IRremote

Files at this revision

API Documentation at this revision

Comitter:
leejong87
Date:
Tue Dec 31 03:57:56 2013 +0000
Parent:
3:1ec19fef8a30
Commit message:
add function : data clear

Changed in this revision

IRremote.cpp Show annotated file Show diff for this revision Revisions of this file
IRremote.h Show annotated file Show diff for this revision Revisions of this file
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;
+    }
+}
diff -r 1ec19fef8a30 -r 10a04fa41876 IRremote.h
--- a/IRremote.h	Thu Dec 26 01:47:05 2013 +0000
+++ b/IRremote.h	Tue Dec 31 03:57:56 2013 +0000
@@ -7,6 +7,8 @@
 public:
     IRremote(PinName pin);
     char read(int ir_i);
+    char readclear(int ir_i);
+    void clear();
     
 private:
     InterruptIn _pin;