fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
|
Adaptive sleep time controller for frame rate control. More...
#include <stdint.h>
Go to the source code of this file.
Functions | |
int | Sleep_init (struct sleep_coll_s **coll) |
Allocates and initializes a new sleep collector with default values. | |
int64_t | Sleep_average (const struct sleep_coll_s *coll) |
Returns the average sleep time in nanoseconds from the given sleep collector. This is calculated by summing all sleep times in the collector and dividing by the number of samples. | |
void | Sleep_do (struct sleep_coll_s *coll, uint32_t ms) |
Sleeps for the given number of milliseconds using incremental sleep calls that estimate the time remaining to sleep using historical sleep data. The remaining sleep time is performed using a primitive spin lock to ensure the executed sleep time is accurate. | |
Adaptive sleep time controller for frame rate control.
int64_t Sleep_average | ( | const struct sleep_coll_s * | coll | ) |
Returns the average sleep time in nanoseconds from the given sleep collector. This is calculated by summing all sleep times in the collector and dividing by the number of samples.
coll | target sleep collector |
void Sleep_do | ( | struct sleep_coll_s * | coll, |
uint32_t | ms ) |
Sleeps for the given number of milliseconds using incremental sleep calls that estimate the time remaining to sleep using historical sleep data. The remaining sleep time is performed using a primitive spin lock to ensure the executed sleep time is accurate.
coll | target sleep collector for recording historical sleep data |
ms | number of milliseconds to sleep |
int Sleep_init | ( | struct sleep_coll_s ** | coll | ) |
Allocates and initializes a new sleep collector with default values.
coll | target sleep collector |