Hi,
Stateflow generates local variables as function arguments in different forms:e.g., uint32_T variableA in one function, and const uint32_T *variableA in another.This inconsistency can cause coding rule (e.g., MISRA) violations during code review, These can be the causes:
- Stateflow automatically determines function argument types based on data scope and usage:
- Inputs are often passed as const pointers.
- Local data may be passed by value.
- There is no direct setting to force all function arguments to use the same type.
Embedded Coder Options
- There is no built-in option to force consistent argument types for Stateflow-generated functions.
- Changing Data Scope/Storage Class (e.g., to ExportedGlobal) affects variable visibility, but not how arguments are passed.
Stateflow Block Parameters
- No parameter allows control over function argument types.