Skip to content

Commit 32c7893

Browse files
committed
added retein of last knowb position value
1 parent 36bb2e9 commit 32c7893

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Modulino.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ class ModulinoKnob : public Module {
342342
}
343343
}
344344
_pressed = (buf[2] != 0);
345-
int16_t ret = buf[0] | (buf[1] << 8);
346-
return ret;
345+
int16_t _last_pox = buf[0] | (buf[1] << 8);
346+
return _last_pox;
347347
}
348348
void set(int16_t value) {
349349
if (_bug_on_set) {
@@ -366,8 +366,10 @@ class ModulinoKnob : public Module {
366366
return 0xFF;
367367
}
368368
private:
369+
int16_t _last_pox = 0;
369370
bool _pressed = false;
370371
bool _bug_on_set = false;
372+
371373
protected:
372374
uint8_t match[2] = { 0x74, 0x76 };
373375
};

0 commit comments

Comments
 (0)