Skip to content

Commit e3977a1

Browse files
committed
move function to public to improve tests
1 parent b27db4c commit e3977a1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

utility/EncoderFirmata.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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+

utility/EncoderFirmata.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
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
9999
public:
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

0 commit comments

Comments
 (0)