This is a fairly minimal set of changes to switch the timeout value from the old value (hardcoded to be 120, or 2 minutes) to the newer "display.time_to_refresh" which is set to be 180 (3 minutes).
I don't just wait the exact amount of time. My experience with other operating systems is that "sleep" times are often modified: the OS might choose to wake either earlier or later. Later isn't a problem, but earlier is a very bad: presumably the developer is about to call refresh() and that will throw if the time is a little early. Since we have to wait for 180 seconds anyway, five extra seconds shouldn't be a deal breaker.
I also updated the code to have an infinite loop at the end -- otherwise the code will fully exit and the display might be reset (I've seen the display reset several times while doing my testing).
This is a fairly minimal set of changes to switch the timeout value from the old value (hardcoded to be 120, or 2 minutes) to the newer "display.time_to_refresh" which is set to be 180 (3 minutes).
I don't just wait the exact amount of time. My experience with other operating systems is that "sleep" times are often modified: the OS might choose to wake either earlier or later. Later isn't a problem, but earlier is a very bad: presumably the developer is about to call refresh() and that will throw if the time is a little early. Since we have to wait for 180 seconds anyway, five extra seconds shouldn't be a deal breaker.
I also updated the code to have an infinite loop at the end -- otherwise the code will fully exit and the display might be reset (I've seen the display reset several times while doing my testing).