
Why is the limits.h header file included when there are fixed point data types in an AUTOSAR model?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 28 Jan 2022
Réponse apportée : MathWorks Support Team
le 31 Jan 2022
I have an AUTOSAR model that includes fixed point data types. When preprocessor directives for fixed point word size checks are enabled, in the generated file " modelName_private.h," I see the following line as part of the fixed point word size checks.
#include <limits.h>
In AUTOSAR, the data type definitions for the CRL are defined in "Mfx.h" header.
What is the difference between "limits.h" and "Mfx.h"? Why is the "limits.h" file included for AUTOSAR models with fixed point data types?
Réponse acceptée
MathWorks Support Team
le 20 Août 2024
From section 5.1 of the AUTOSAR standard, the "header file Mfx.h provides all public function prototypes and types defined by the Mfx library specification."
The “limits.h” header file is unrelated to the CRL or AUTOSAR at all – it determines the limits (max and min values that can be represented) for variable types.
This header file is included when there are fixed point data types in the model and fixed-point word size checks are enabled. Please note that "limits.h" is not generated by MathWorks Coder products but rather is a C header file that determines the limits for different variable types. The limit for each type is the max and min values that can be represented by the type.
The reason why we include this header file is to perform some checks on the target (e.g., because fixpoint slope/bias can cause overflow). These checks can be disabled with the setting
.

0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur AUTOSAR Blockset dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!