mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 22:13:34 +08:00
posix: workqueue uses TICK scaling from px4_defines.h
px4_defines.h defines USEC2TICK(x) and TICKS_PER_USEC. These are now used and allow tick scaling. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -113,7 +113,7 @@ static void work_process(FAR struct wqueue_s *wqueue)
|
|||||||
* zero. Therefore a delay of zero will always execute immediately.
|
* zero. Therefore a delay of zero will always execute immediately.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
elapsed = USEC_TO_TICKS(clock_systimer() - work->qtime);
|
elapsed = USEC2TICK(clock_systimer() - work->qtime);
|
||||||
//printf("work_process: in ticks elapsed=%lu delay=%u\n", elapsed, work->delay);
|
//printf("work_process: in ticks elapsed=%lu delay=%u\n", elapsed, work->delay);
|
||||||
if (elapsed >= work->delay)
|
if (elapsed >= work->delay)
|
||||||
{
|
{
|
||||||
@@ -158,7 +158,7 @@ static void work_process(FAR struct wqueue_s *wqueue)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Here: elapsed < work->delay */
|
/* Here: elapsed < work->delay */
|
||||||
remaining = TICKS_TO_USEC(work->delay - elapsed);
|
remaining = USEC_PER_TICK*(work->delay - elapsed);
|
||||||
if (remaining < next)
|
if (remaining < next)
|
||||||
{
|
{
|
||||||
/* Yes.. Then schedule to wake up when the work is ready */
|
/* Yes.. Then schedule to wake up when the work is ready */
|
||||||
|
|||||||
Reference in New Issue
Block a user