MPC5744P LINFLEXD driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5744P LINFLEXD driver

389 Views
ykp3036
Contributor I

In MPC5477P LINFLEXD driver, when compute  fraction baudrate, why plus "0.5F" in the end?

ykp3036_0-1677464188408.png

 

0 Kudos
2 Replies

378 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the default float-to-integer conversion in C does not round to the nearest integer, but instead truncates fractional part. So rounding to the nearest integer can be achieved by adding 0.5 and then do a type cast.

BR, Petr

0 Kudos

373 Views
ykp3036
Contributor I

thanks, 66666666666666

0 Kudos