Small changes

Dependencies:   FATFileSystem

Dependents:   main_src

Fork of EALib by EmbeddedArtists AB

Files at this revision

API Documentation at this revision

Comitter:
embeddedartists
Date:
Fri Dec 19 15:22:22 2014 +0000
Parent:
18:9f1f1a8b4729
Commit message:
Fixed bug in AR1021 driver causing problems when aborting calibration

Changed in this revision

AR1021.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 9f1f1a8b4729 -r 74540582e639 AR1021.cpp
--- a/AR1021.cpp	Mon Oct 27 10:18:08 2014 +0000
+++ b/AR1021.cpp	Fri Dec 19 15:22:22 2014 +0000
@@ -121,10 +121,16 @@
         do {
             // disable touch
             result = cmd(AR1021_CMD_DISABLE_TOUCH, NULL, 0, NULL, 0);
+            if (result == -AR1021_RESP_STAT_CANCEL_CALIB) {
+                debug("calibration was cancelled, short delay and try again");
+                wait_us(50);
+                result = cmd(AR1021_CMD_DISABLE_TOUCH, NULL, 0, NULL, 0);
+            }
             if (result != 0) {
                 debug("disable touch failed (%d)\n", result);
                 break;
             }
+            wait_us(50);
 
             char regOffset = 0;
             int regOffLen = 1;