愛莉 結城 / Mbed 2 deprecated MARY_IRReceive

Dependencies:   mbed

Revision:
1:4e6dc3e5ab7c
Parent:
0:7c39876eb334
--- a/main.cpp	Sat Aug 09 07:24:12 2014 +0000
+++ b/main.cpp	Sun Aug 24 06:58:30 2014 +0000
@@ -8,7 +8,8 @@
 //TX dp16 = USBTX RX dp15 = USBRX
 Serial pc(USBTX, USBRX);
 
-int receive(RemoteIR::Format *format, uint8_t *buf, int bufsiz, int timeout = 100) {
+int receive(RemoteIR::Format *format, uint8_t *buf, int bufsiz, int timeout = 200)
+{
     int cnt = 0;
     while (ir_rx.getState() != ReceiverIR::Received) {
         cnt++;
@@ -19,15 +20,15 @@
     return ir_rx.getData(format, buf, bufsiz * 8);
 }
 
-int main() {
+int main()
+{
     pc.baud(9600);
     RemoteIR::Format format;
-    uint8_t buf[64];
+    uint8_t buf[512];
     int bufLength = 0;
     myled1 = myled2 = myled3 = 1;
     while(1) {
         myled1 = 0;
-        memset(buf, 0x00, sizeof(buf));
         bufLength = receive(&format, buf, sizeof(buf));
         if(bufLength < 0) continue;
         myled1 = 1;