I have a Simulink model containing Stateflow which I am generating code from, using Stateflow Coder 7.2 (R2009a).
I have the following logic in my Stateflow chart that accounts for a state transition from STATE1 to STATE2:
if (In1 >= In2 + In3){ /*State goes into STATE2*/}else{ /*Remains in the STATE1*/}
where:
In1 is of type U32 (unsigned int – 32 bit), with resolution 0.001
In2 is of type U32, with resolution 0.01
In3 is of type U32, with resolution 0.01
However, the generated code for this transition condition is as follows:
if ((int32_T)mul_u32_u32_u32_sr35(In1, 3435973837U) >= In2 + In3){ /*State goes into STATE2*/}else{ /*Remains in the STATE1*/}
The Real-Time Workshop>Hardware Implementation pane has the following settings:
ProdHWDeviceType = "32-bit Generic" Bits per int = 32
I would like to know what the significance of the number 3435973837U here is, and why there is a typecast to int32_T.
Best Answer