Unverified Commit a40389d2 authored by Martino Facchin's avatar Martino Facchin Committed by GitHub

Merge pull request #90 from arduino/88-wire-baud-overflow

Bugfix: wrong default I2C baud rate was set for Arduino Nano Every
parents a0f6beb5 afb02661
......@@ -201,7 +201,7 @@ void TWI_MasterSetBaud(uint32_t frequency){
t_rise = 1000;
}
uint32_t baud = ((F_CPU_CORRECTED/frequency) - (((F_CPU_CORRECTED*t_rise)/1000)/1000)/1000 - 10)/2;
uint32_t baud = (F_CPU_CORRECTED / frequency - F_CPU_CORRECTED / 1000 / 1000 * t_rise / 1000 - 10) / 2;
TWI0.MBAUD = (uint8_t)baud;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment