1
Discussion - Software / Re: EVE code CPU usage - is it safe to sleep()?
« on: March 12, 2019, 12:57:45 pm »
Generally it will be running tight loops where it waits for the co processor to finish. It'll be easiest to just put a 1ms sleep in those loops. You may also put the 1ms wait in the "Idle" function of your app instead, since that gets called during tight loops (Create an Idle slot under App.main, double click to go to user code, and put in the sleep code).
The main loop builds a new display list for each frame, which is necessary for animating widgets. Ideally the render portion of the loop will be called at the same rate as the frame rate.
An alternative could be to do a blocking wait on the main thread, instead of spinning the thread, and make use of the interrupt output pin of the EVE chip to resume the thread, but that may involve some platform specific code.
The main loop builds a new display list for each frame, which is necessary for animating widgets. Ideally the render portion of the loop will be called at the same rate as the frame rate.
An alternative could be to do a blocking wait on the main thread, instead of spinning the thread, and make use of the interrupt output pin of the EVE chip to resume the thread, but that may involve some platform specific code.