Add code that fix timeout problem while the triface tag is acquiring data.
authorqwert <qwert@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 25 Jul 2008 14:48:53 +0000 (14:48 +0000)
committerqwert <qwert@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 25 Jul 2008 14:48:53 +0000 (14:48 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1516 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/net/keytag.c

index 68b51997d1e1d1cd376dd555c14bfa9b4ab41905..de890de3dff6ae6e1f1684af7faba03b596262a0 100644 (file)
@@ -63,10 +63,9 @@ void keytag_init(struct TagPacket *pkt, struct KFile *comm, struct KFile *tag)
        keytag_clearPkt(pkt);
        pkt->host = comm;
        pkt->tag = tag;
-
 }
 
-       void keytag_poll(struct TagPacket *pkt)
+void keytag_poll(struct TagPacket *pkt)
 {
        int c;
 
@@ -112,4 +111,11 @@ void keytag_init(struct TagPacket *pkt, struct KFile *comm, struct KFile *tag)
                        }
                }
        }
+       if (kfile_error(pkt->tag) != 0)
+       {
+               if (kfile_error(pkt->tag) != SERRF_RXTIMEOUT)
+                       kprintf("Error %08x\n", kfile_error(pkt->tag));
+               kfile_clearerr(pkt->tag);
+       }
+
 }