| 109 | |
| 110 | #ifdef ENCODER_USE_INTERRUPTS |
| 111 | inline int32_t read() { |
| 112 | if (interrupts_in_use < 2) { |
| 113 | noInterrupts(); |
| 114 | update(&encoder); |
| 115 | } else { |
| 116 | noInterrupts(); |
| 117 | } |
| 118 | int32_t ret = encoder.position; |
| 119 | interrupts(); |
| 120 | return ret; |
| 121 | } |
| 122 | inline int32_t readAndReset() { |
| 123 | if (interrupts_in_use < 2) { |
| 124 | noInterrupts(); |