Skip to content

Typo for fractional part of lposc_freq_khz? #2449

@tommy-gilligan

Description

@tommy-gilligan

Currently:

uint32_t lposc_freq_khz_frac16 = (lposc_freq_khz % 1000) * 65536 / 1000;

I think this line should be referencing lposc_freq_hz instead of lposc_freq_khz

Given an input value of lposc_freq_hz = 32768
lposc_freq_khz will be 32768 / 1000 = 32
This is the integer part
Fractional part cannot be derived from this

I am not sure if the rest of the maths makes sense either.

edit: The maths is correct but it does seem the wrong variable is being referenced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions