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:
Mark Charlebois
2015-04-27 13:48:54 -07:00
parent 3c957e57e7
commit 7fa33d0d2b
+2 -2
View File
@@ -113,7 +113,7 @@ static void work_process(FAR struct wqueue_s *wqueue)
* 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);
if (elapsed >= work->delay)
{
@@ -158,7 +158,7 @@ static void work_process(FAR struct wqueue_s *wqueue)
*/
/* Here: elapsed < work->delay */
remaining = TICKS_TO_USEC(work->delay - elapsed);
remaining = USEC_PER_TICK*(work->delay - elapsed);
if (remaining < next)
{
/* Yes.. Then schedule to wake up when the work is ready */