Hi Geert, > > - round = (ick + 500000) / 1000000 * 285; > > + sum = t->scl_fall_ns + t->scl_rise_ns + t->scl_int_delay_ns; > > + round = (ick + 500000) / 1000000 * sum; > > If you're sure it cannot overflow, doing the "* sum" before the division > improves accuracy. Thanks for the input. In this patch, however, I intentionally did not change the formula but only replaced the constants with the now user supplied values. Everything else should be a separate patch IMO.
Attachment:
signature.asc
Description: Digital signature