Skip to content

m_sdhc_baudrate caculation wrong #5

Description

@manitou48

line 467 in sdhc.c (cosmetic?) is in error me thinks. it reads
m_sdhc_baudrate=F_CPU/((1<<minpresc)*(mindiv+1));

but minpresc is not a shift value, it should be minpresc << 1
BUT, that is not quite right either, because if minpresc is 0, you want the multiplier to be 1, so maybe
int tmp = minpresc << 1;
if (tmp == 0) tmp = 1;
m_sdhc_baudrate=F_CPU/(tmp*(mindiv+1));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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