| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /*
- * File: rtGetNaN.c
- *
- * Code generated for Simulink model 'PMSM_Controller'.
- *
- * Model version : 1.885
- * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020
- * C/C++ source code generated on : Sat Jan 8 15:44:11 2022
- *
- * Target selection: ert.tlc
- * Embedded hardware selection: ARM Compatible->ARM Cortex-M
- * Code generation objectives:
- * 1. Execution efficiency
- * 2. RAM efficiency
- * Validation result: Not run
- */
- /*
- * Abstract:
- * Function to initialize non-finite, NaN
- */
- #include "rtGetNaN.h"
- #define NumBitsPerChar 8U
- /*
- * Initialize rtNaN needed by the generated code.
- * NaN is initialized as non-signaling. Assumes IEEE.
- */
- real_T rtGetNaN(void)
- {
- size_t bitsPerReal = sizeof(real_T) * (NumBitsPerChar);
- real_T nan = 0.0;
- if (bitsPerReal == 32U) {
- nan = rtGetNaNF();
- } else {
- union {
- LittleEndianIEEEDouble bitVal;
- real_T fltVal;
- } tmpVal;
- tmpVal.bitVal.words.wordH = 0xFFF80000U;
- tmpVal.bitVal.words.wordL = 0x00000000U;
- nan = tmpVal.fltVal;
- }
- return nan;
- }
- /*
- * Initialize rtNaNF needed by the generated code.
- * NaN is initialized as non-signaling. Assumes IEEE.
- */
- real32_T rtGetNaNF(void)
- {
- IEEESingle nanF = { { 0 } };
- nanF.wordL.wordLuint = 0xFFC00000U;
- return nanF.wordL.wordLreal;
- }
- /*
- * File trailer for generated code.
- *
- * [EOF]
- */
|