fix orderarray initialization ascending

This commit is contained in:
interfisch 2023-02-13 19:02:11 +01:00
parent 5f2beca1d0
commit 940d3c18cc
2 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,7 @@ void Image::init()
flag_updating=false;
update_counter=0;
updateDelay=5;
updateDelay=10;
resetOrder(true);
}
@ -66,7 +66,11 @@ void Image::setBuffer_random(uint8_t randomness)
void Image::resetOrder(bool ascending) {
for (uint8_t i=0;i<getW();i++) { //fill with ascending numbers
orderArray[i]=(getW()-1)*!ascending - i;
if (ascending) {
orderArray[i]=i;
}else{
orderArray[i]=(getW()-1) - i;
}
}
}
@ -100,10 +104,6 @@ UpdateReturn Image::updateByColumn(bool clearFirst, bool optimizeClear, bool opt
}
unsigned long functionStartMillis=millis();
uint8_t x=update_counter/2;

View File

@ -42,7 +42,7 @@ void loop() {
}
UpdateReturn result=flip.updateByColumn(true,true,true,true); //0=not finished, 1=finished
UpdateReturn result=flip.updateByColumn(true,true,true); //0=not finished, 1=finished
if (result == finished) //just finished
{
unsigned long duration=millis()-last_change;