Ferréol GAGEY / encoder

Dependents:   FlexV1

Files at this revision

API Documentation at this revision

Comitter:
fgagey
Date:
Sat Mar 27 00:00:32 2021 +0000
Parent:
0:5c2ad81551aa
Commit message:
NF

Changed in this revision

QEI.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/QEI.cpp	Thu Sep 02 16:48:55 2010 +0000
+++ b/QEI.cpp	Sat Mar 27 00:00:32 2021 +0000
@@ -127,6 +127,7 @@
  * Includes
  */
 #include "QEI.h"
+#include "mbed.h"
 
 QEI::QEI(PinName channelA,
          PinName channelB,
@@ -151,17 +152,17 @@
     //X2 encoding uses interrupts on only channel A.
     //X4 encoding uses interrupts on      channel A,
     //and on channel B.
-    channelA_.rise(this, &QEI::encode);
-    channelA_.fall(this, &QEI::encode);
+    channelA_.rise(callback(this, &QEI::encode));
+    channelA_.fall(callback(this, &QEI::encode));
 
     //If we're using X4 encoding, then attach interrupts to channel B too.
     if (encoding == X4_ENCODING) {
-        channelB_.rise(this, &QEI::encode);
-        channelB_.fall(this, &QEI::encode);
+        channelB_.rise(callback(this, &QEI::encode));
+        channelB_.fall(callback(this, &QEI::encode));
     }
     //Index is optional.
     if (index !=  NC) {
-        index_.rise(this, &QEI::index);
+        index_.rise(callback(this, &QEI::index));
     }
 
 }