#### File: D:\bobes\0 skola\_car4\my matlab\HIL - PID speed\firmware\Vejlupek_Car4_HIL_PIDSpeed_dspic\sources\rt_nonfinite.c
        1   /*
        2    * File: rt_nonfinite.c
        3    *
        4    * Real-Time Workshop code generated for Simulink model Vejlupek_Car4_HIL_PIDSpeed.
        5    *
        6    * Model version                        : 1.460
        7    * Real-Time Workshop file version      : 7.3  (R2009a)  15-Jan-2009
        8    * Real-Time Workshop file generated on : Fri Apr 30 16:12:44 2010
        9    * TLC version                          : 7.3 (Jan 18 2009)
       10    * C source code generated on           : Fri Apr 30 16:12:44 2010
       11    *--------------------------------------------------------------
       12    *   Embedded Coder for Microchip dsPIC family.                 |
       13    *   Generate .c and .h files from your Matlab/simulink model   |
       14    *   and compile the diagram to .hex and .coff file that can be |
       15    *   downloaded directly into the microcontroller               |
       16    *                                                              |
       17    * Licence Accorded to Ing. Robert Grepl, Ph.D.                 |
       18    *                     Technical University Brno                |
       19    *                                                              |
       20    *   Written by Lubin KERHUEL -  http://www.kerhuel.eu          |
       21    *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
       22    *   Version 3.1                               26-Nov-2009      |
       23    *   For Matlab 7.8             R2009a                          |
       24    *--------------------------------------------------------------
       25    */
       26
       27   /*
       28    * Abstract:
       29    *      Real-Time Workshop function to intialize non-finites,
       30    *      (Inf, NaN and -Inf).
       31    */
       32   #include "rt_nonfinite.h"
       33   #include "rtGetNaN.h"
       34   #include "rtGetInf.h"
       35   #define NumBitsPerChar                 8
       36
       37   real_T rtInf;
       38   real_T rtMinusInf;
       39   real_T rtNaN;
       40   real32_T rtInfF;
       41   real32_T rtMinusInfF;
       42   real32_T rtNaNF;
       43
       44   /* Function: rt_InitInfAndNaN ==================================================
       45    * Abstract:
       46    *	Initialize the rtInf, rtMinusInf, and rtNaN needed by the
       47    *	generated code. NaN is initialized as non-signaling. Assumes IEEE.
       48    */
       49   void rt_InitInfAndNaN(size_t realSize)
       50   {
       51     (void) (realSize);
       52     rtNaN = rtGetNaN();
       53     rtNaNF = rtGetNaNF();
       54     rtInf = rtGetInf();
       55     rtInfF = rtGetInfF();
       56     rtMinusInf = rtGetMinusInf();
       57     rtMinusInfF = rtGetMinusInfF();
       58   }
       59
       60   /* Function: rtIsInf ==================================================
       61    * Abstract:
       62    *	Test if value is infinite
       63    */
       64   boolean_T rtIsInf(real_T value)
       65   {
       66     return ((value==rtInf || value==rtMinusInf) ? 1U : 0U);
       67   }
       68
       69   /* Function: rtIsInfF =================================================
       70    * Abstract:
       71    *	Test if single-precision value is infinite
       72    */
       73   boolean_T rtIsInfF(real32_T value)
       74   {
       75     return(((value)==rtInfF || (value)==rtMinusInfF) ? 1U : 0U);
       76   }
       77
       78   /* Function: rtIsNaN ==================================================
       79    * Abstract:
       80    *	Test if value is not a number
       81    */
       82   boolean_T rtIsNaN(real_T value)
       83   {
       84     return((value!=value) ? 1U : 0U);
       85   }
       86
       87   /* Function: rtIsNaNF =================================================
       88    * Abstract:
       89    *	Test if single-precision value is not a number
       90    */
       91   boolean_T rtIsNaNF(real32_T value)
       92   {
       93     return((value!=value) ? 1U : 0U);
       94   }
       95
       96   #undef NumBitsPerChar
       97
       98   /* end rt_nonfinite.c */
       99
      100   /* File trailer for Real-Time Workshop generated code.
      101    *
      102    * [EOF]
      103    */