Skip to content

Commit

Permalink
fix adafruit#23 with ifdef check
Browse files Browse the repository at this point in the history
  • Loading branch information
r734 committed Sep 29, 2018
1 parent cef439b commit 1590ec2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Adafruit_Thermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ void Adafruit_Thermal::timeoutSet(unsigned long x) {

// This function waits (if necessary) for the prior task to complete.
void Adafruit_Thermal::timeoutWait() {
#ifdef ESP8266
if(dtrEnabled) {
while(digitalRead(dtrPin) == HIGH){yield();};
} else {
while((long)(micros() - resumeTime) < 0L){yield();}; // (syntax is rollover-proof)
}
#else
if(dtrEnabled) {
while(digitalRead(dtrPin) == HIGH);
} else {
while((long)(micros() - resumeTime) < 0L); // (syntax is rollover-proof)
}
#endif
}

// Printer performance may vary based on the power supply voltage,
Expand Down

0 comments on commit 1590ec2

Please sign in to comment.