jlaitine commented on code in PR #8303:
URL: https://github.com/apache/nuttx/pull/8303#discussion_r1089342271
##########
arch/arm/src/stm32f7/stm32_i2c.c:
##########
@@ -784,11 +784,13 @@ static uint32_t stm32_i2c_toticks(int msgc, struct
i2c_msg_s *msgs)
bytecount += msgs[i].length;
}
- /* Then return a number of microseconds based on a user provided scaling
- * factor.
+ /* Then return a number of ticks based on a user provided scaling
+ * factor, rounded up.
*/
- return USEC2TICK(CONFIG_STM32F7_I2C_DYNTIMEO_USECPERBYTE * bytecount);
+ return USEC2TICK(CONFIG_STM32F7_I2C_DYNTIMEO_USECPERBYTE * bytecount +
Review Comment:
If it looks complex, we can simplify it a bit and keep it still exact;
instead of " -CONFIG_STM32F7_I2C_DYNTIMEO_USECPERBYTE" in the end, just -1
works the same. I'll make this fix to prettify it. Would that do, @davids5 ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]