fix encodeur update
This commit is contained in:
parent
d4396b4e2a
commit
213456b6ab
@ -45,6 +45,9 @@ SwitchableEncodeur* SwitchableEncodeur::getInstance() {
|
|||||||
bool SwitchableEncodeur::update() {
|
bool SwitchableEncodeur::update() {
|
||||||
bool sortie = false;
|
bool sortie = false;
|
||||||
long newPosition = this->read()/4;
|
long newPosition = this->read()/4;
|
||||||
|
if(newPosition <= 0){
|
||||||
|
newPosition = 0;
|
||||||
|
}
|
||||||
if (newPosition != this->oldPosition || this->menu != this->oldMenu) {
|
if (newPosition != this->oldPosition || this->menu != this->oldMenu) {
|
||||||
this->oldMenu = this->menu;
|
this->oldMenu = this->menu;
|
||||||
this->oldPosition = newPosition;
|
this->oldPosition = newPosition;
|
||||||
@ -62,4 +65,5 @@ int SwitchableEncodeur::getValue() {
|
|||||||
|
|
||||||
void SwitchableEncodeur::resetValue() {
|
void SwitchableEncodeur::resetValue() {
|
||||||
this->oldPosition = 0;
|
this->oldPosition = 0;
|
||||||
|
this->readAndReset();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user