Skip to content

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented May 7, 2019

FrequencyIn was computing a float in an expression that included a uint64_t value. This causes software double precision floating arithmetic to be used, which brings a lot of extra code. The difference being calculated is between two closely spaced millisecond time values, so casting to 32 bits should be no problem.

Changing the arithmetic to used uint32_t only saves about 3000 bytes, which should improve the space squeeze we are seeing on M0 Express builds a lot.

Also fixed a minor issue that prevented disabling puleseio, discovered while I was turning features on and off to find the root cause of the issue.

@dhalbert dhalbert requested a review from sommersoft May 7, 2019 04:32
Copy link

@sommersoft sommersoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find @dhalbert!

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit 9ba8191 into adafruit:master May 8, 2019
@dhalbert dhalbert deleted the frequencyin-no-double-arith branch May 28, 2019 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants