Skip to content

Commit 7941541

Browse files
committed
avoid float division 2
1 parent eebc1ea commit 7941541

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cores/arduino/SERCOM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ void SERCOM::initMasterWIRE( uint32_t baudrate )
488488
sercom->I2CM.BAUD.bit.HSBAUD = freqRef / (2 * baudrate) - 1;
489489
else
490490
sercom->I2CM.BAUD.bit.BAUD = freqRef / (2 * baudrate) - 5 -
491-
(freqRef/2000000ul * WIRE_RISE_TIME_NANOSECONDS) / 1000;
491+
(freqRef/1000000ul * WIRE_RISE_TIME_NANOSECONDS) / 2000;
492492
}
493493

494494
void SERCOM::prepareNackBitWIRE( void )

0 commit comments

Comments
 (0)