File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -272,3 +272,9 @@ void EncoderFirmata::toggleAutoReport(bool report)
272272{
273273 autoReport = report;
274274}
275+
276+ bool EncoderFirmata::isReportingEnabled ()
277+ {
278+ return autoReport;
279+ }
280+
Original file line number Diff line number Diff line change 8181
8282// This optional setting causes Encoder to use more optimized code
8383// safe only if 'attachInterrupt' is never used in the same time
84- // #define ENCODER_OPTIMIZE_INTERRUPTS
84+ // #define ENCODER_OPTIMIZE_INTERRUPTS // => not compiling
8585#include " Encoder.h"
8686
8787#define MAX_ENCODERS 5 // arbitrary value, may need to adjust
@@ -99,22 +99,25 @@ class EncoderFirmata:public FirmataFeature
9999public:
100100 EncoderFirmata ();
101101 ~EncoderFirmata ();
102+ // FirmataFeature implementation
102103 boolean handlePinMode (byte pin, int mode);
103104 void handleCapability (byte pin);
104105 boolean handleSysex (byte command, byte argc, byte *argv);
105106 void reset ();
107+
106108 void report ();
107109 boolean isEncoderAttached (byte encoderNum);
108- volatile bool autoReport;
109-
110- private:
111110 void attachEncoder (byte encoderNum, byte pinANum, byte pinBNum);
112111 void detachEncoder (byte encoderNum);
113112 void reportEncoder (byte encoderNum);
114113 void reportEncodersPositions ();
115114 void resetEncoderPosition (byte encoderNum);
116115 void toggleAutoReport (bool report);
116+ bool isReportingEnabled ();
117+
118+ private:
117119 Encoder *encoders[MAX_ENCODERS];
120+ volatile bool autoReport;
118121};
119122
120123#endif
You can’t perform that action at this time.
0 commit comments