Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fmod crashes teensy 4.1, fmodf does not #11

Open
Open
fmod crashes teensy 4.1, fmodf does not#11

Description

when compiling and flashing this library as-is, my teensy 4.1 would crash, at least I would fail to get any serial logs out of the device... after debugging, I found the fmod function is for doubles, but fmodf is for floats. Thus these changes are suggested:

void AD9833 :: SetPhase ( Registers phaseReg, float phaseInDeg ) {
// Sanity checks on input
- phaseInDeg = fmod(phaseInDeg,360);
- if ( phaseInDeg < 0 ) phaseInDeg += 360;
+ // fmod crashes the teensy, fmodf does not
+ phaseInDeg = fmodf(phaseInDeg, 360.);
+ if ( phaseInDeg < 0 ) phaseInDeg += 360.;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions