-
Notifications
You must be signed in to change notification settings - Fork 167
Conversation
Adafruit_Thermal.cpp
Outdated
while (digitalRead(dtrPin) == HIGH) | ||
; | ||
while (digitalRead(dtrPin) == HIGH) { | ||
delay(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make these delay(1) or yield()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, can bump up value. Was avoiding yield()
based on this comment:
#26 (comment)
Idea being that ESP8266's delay()
calls yield()
under the hood. Hopefully using delay()
is more universal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield is most like delay(0), delay(1) of course delays. ill say i use yield() in libraries and never heard a complaint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may be old lore? all the BSPs have caught up now? yield
makes more sense than delay
, was just wanting to avoid preprocessor logic if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah all BSPs have caught up, that was 4 years ago :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works4me
A couple of fixes here.
delay(0)
in the loop to allow ESP8266's implementation to yield as needed. This way don't need any pre-processor logic.DC2 *
inbegin()
. Moved that configuration to a new functionsetPrintDensity()
and then don't call it by default. Resulting prints look fine without it.Here's an example WDT reset just for records:
![Screenshot from 2021-04-09 13-49-52](https://user-images.githubusercontent.com/8755041/114274236-4bdeb300-99d2-11eb-8b3a-88c9a04eda98.png)