Closed alranel closed 3 years ago
Memory usage change @ afb02661530bb7479d9d9f462f7813948fe5dba8
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:megaavr:nona4809 | :green_heart: -92 - 0 | -0.19 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:megaavr:uno2018:mode=off | :green_heart: -92 - 0 | -0.19 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:megaavr:uno2018:mode=on | :green_heart: -92 - 0 | -0.19 - 0.0 | 0 - 0 | 0.0 - 0.0 |
This PR fixes #88.
Whenever the default baud rate was used, or a custom frequency being less than 800kHz or greater than 1,200kHz was set, the computed baud rate was incorrect due to an integer overflow.
F_CPU_CORRECTED
is auint32_t
set to 16000000 for Arduino Nano Every. It gets multiplied byt_rise
which is set to 1000, thus it overflows the numeric range for auint32_t
. When using the default baud rate,TWI0.MBAUD
was set to 73 instead of 67 which appears to be the right value.(How can we add a unit test for this?)