Suppress generation of default cases for Stateflow switch statements if unreachable
Specify whether to generate default cases for switch-case statements in the code for Stateflow® charts. This optimization works on a per-model basis. It applies to the code generated for a state that has multiple substates. For a list of the state functions in the generated code, see Inline State Functions in Generated Code.
Category: Code Generation > Code Style
Do not generate the default case when it is unreachable. This setting enables better code coverage because every branch in the generated code is falsifiable.
Generate a default case whether or not it is reachable. This setting supports MISRA C® compliance and provides a backup in case of RAM corruption.
For example, when the state has a nontrivial
entryfunction, the following default case appears in the generated code for the
default: entry_internal(); break;
In this case, the code marks the corresponding substate as active.
|Type: character vector|
|Efficiency||On (execution, ROM), Noimpact (RAM)|