Skip to content

timing loop that fires too often? #116

@4var1

Description

@4var1

I was browsing the code - and spotted what I think is another buggy loop timer - is the same construct as was being used in the main loop that caused it to run a lot faster than expected as if the timer resolution is high enough - the mod test will be true for many cycles rather than just one. I'll take a closer look when I have more time...

static void main_timer_timeout(void *p_context)
{
UNUSED_PARAMETER(p_context);

main_ticks++;

if (main_ticks % (1000 / MSEC_PER_TICK) == 0)
ui32_seconds_since_startup++;

if ((main_ticks % (50 / MSEC_PER_TICK) == 0) && // every 50ms
m_rt_processing_stop == false)
rt_processing();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions