PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How to stop OnNextFrame

Hi,

Is it possible to stop EDGELIB calling into OnNextFrame? Since we may have power save consideration in the target device.

Thanks,
Mamahow
Hi,

You can't actually stop OnNextFrame, but you can do the following things to save power:
- Minimize the application
- Set the maximum fps to a low value, such as 10
- Add Sleep to OnNextFrame to pause the application
Hi,
I have more questions regarding to this.
-Can we change maximum fps dynamically?
-Can we set this value to 0? (which means no update?)
-Will the CPU usage be lower when OnNextFrame isn't called?

MJ
Hi,

Yes, you can change the FPS dynamically by changing the maxfps setting from ecd (it can also be changed from OnNextFrame and takes effect immediately):

Code:

ecd.maincfg->maxfps = 30;


If the maxfps is set to 0, the setting will be ignored and the application will take 100% CPU power. Calling OnNextFrame doesn't take much processing power if you disable the screen update (flip) and return without any action.

To disable flipping set the following flag:

Code:

ecd.maincfg->flags |= EFL_MANUALFLIP;


This setting requires you to call display->Flip yourself at the end of OnNextFrame().