MCPcopy Create free account
hub / github.com/PaulStoffregen/Encoder / readAndReset

Function readAndReset

Encoder.h:122–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 return ret;
121 }
122 inline int32_t readAndReset() {
123 if (interrupts_in_use < 2) {
124 noInterrupts();
125 update(&encoder);
126 } else {
127 noInterrupts();
128 }
129 int32_t ret = encoder.position;
130 encoder.position = 0;
131 interrupts();
132 return ret;
133 }
134 inline void write(int32_t p) {
135 noInterrupts();
136 encoder.position = p;

Callers

nothing calls this directly

Calls 1

updateFunction · 0.85

Tested by

no test coverage detected