Skip to content

Timer Overflows #128

@AwesomeTornado

Description

@AwesomeTornado

Context

The delay timers in adc.c have the potential for overflow errors. If the cycle counter overflows while executing the delay, the code will not delay for long enough.

By my math, the cycle counter overflows every 21 seconds, while our delay is only 1.3us, so this issue is almost impossible to run into, but does exist.

Related Issues / PRs:

https://github.com/Severson-Group/AMDS/pull/102/changes#diff-05e9e0903c32c870e82e3d1636b3e1fc9d6406a5e6fdd06a5ea401380e1f4795R158

Approach

Use a new delay function which takes overflows into account.

Possibly write in ASM to remove compiler overhead?

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