#include "rt_logging_mmi.h"
#include "MotorController_FOC_capi.h"
#include <math.h>
#include "MotorController_FOC.h"
#include "MotorController_FOC_private.h"
#include "MotorController_FOC_dt.h"
#include "simstruc.h"
#include "fixedpoint.h"
#include "slsa_sim_engine.h"
extern void * CreateDiagnosticAsVoidPtr_wrapper ( const char * id , int nargs
, ... ) ; RTWExtModeInfo * gblRTWExtModeInfo = NULL ; void
raccelForceExtModeShutdown ( boolean_T extModeStartPktReceived ) { if ( !
extModeStartPktReceived ) { boolean_T stopRequested = false ;
rtExtModeWaitForStartPkt ( gblRTWExtModeInfo , 4 , & stopRequested ) ; }
rtExtModeShutdown ( 4 ) ; }
#include "slsv_diagnostic_codegen_c_api.h"
const int_T gblNumToFiles = 0 ; const int_T gblNumFrFiles = 0 ; const int_T
gblNumFrWksBlocks = 1 ;
#ifdef RSIM_WITH_SOLVER_MULTITASKING
boolean_T gbl_raccel_isMultitasking = 1 ;
#else
boolean_T gbl_raccel_isMultitasking = 0 ;
#endif
boolean_T gbl_raccel_tid01eq = 1 ; int_T gbl_raccel_NumST = 5 ; const char_T
* gbl_raccel_Version = "9.4 (R2020b) 29-Jul-2020" ; void
raccel_setup_MMIStateLog ( SimStruct * S ) {
#ifdef UseMMIDataLogging
rt_FillStateSigInfoFromMMI ( ssGetRTWLogInfo ( S ) , & ssGetErrorStatus ( S )
) ;
#else
UNUSED_PARAMETER ( S ) ;
#endif
} static DataMapInfo rt_dataMapInfo ; DataMapInfo * rt_dataMapInfoPtr = &
rt_dataMapInfo ; rtwCAPI_ModelMappingInfo * rt_modelMapInfoPtr = & (
rt_dataMapInfo . mmi ) ; const int_T gblNumRootInportBlks = 0 ; const int_T
gblNumModelInputs = 0 ; extern const char * gblInportFileName ; extern
rtInportTUtable * gblInportTUtables ; const int_T gblInportDataTypeIdx [ ] =
{ - 1 } ; const int_T gblInportDims [ ] = { - 1 } ; const int_T
gblInportComplex [ ] = { - 1 } ; const int_T gblInportInterpoFlag [ ] = { - 1
} ; const int_T gblInportContinuous [ ] = { - 1 } ; int_T enableFcnCallFlag [
] = { 1 , 1 , 1 , 1 , 1 } ; const char * raccelLoadInputsAndAperiodicHitTimes
( SimStruct * S , const char * inportFileName , int * matFileFormat ) {
return rt_RAccelReadInportsMatFile ( S , inportFileName , matFileFormat ) ; }
B rtB ; DW rtDW ; PrevZCX rtPrevZCX ; static SimStruct model_S ; SimStruct *
const rtS = & model_S ; real_T look1_binlxpw ( real_T u0 , const real_T bp0 [
] , const real_T table [ ] , uint32_T maxIndex ) { real_T frac ; real_T
yL_0d0 ; uint32_T bpIdx ; uint32_T iLeft ; uint32_T iRght ; if ( u0 <= bp0 [
0U ] ) { iLeft = 0U ; frac = ( u0 - bp0 [ 0U ] ) / ( bp0 [ 1U ] - bp0 [ 0U ]
) ; } else if ( u0 < bp0 [ maxIndex ] ) { bpIdx = maxIndex >> 1U ; iLeft = 0U
; iRght = maxIndex ; while ( iRght - iLeft > 1U ) { if ( u0 < bp0 [ bpIdx ] )
{ iRght = bpIdx ; } else { iLeft = bpIdx ; } bpIdx = ( iRght + iLeft ) >> 1U
; } frac = ( u0 - bp0 [ iLeft ] ) / ( bp0 [ iLeft + 1U ] - bp0 [ iLeft ] ) ;
} else { iLeft = maxIndex - 1U ; frac = ( u0 - bp0 [ maxIndex - 1U ] ) / (
bp0 [ maxIndex ] - bp0 [ maxIndex - 1U ] ) ; } yL_0d0 = table [ iLeft ] ;
return ( table [ iLeft + 1U ] - yL_0d0 ) * frac + yL_0d0 ; } uint16_T
plook_u16u16_evencka ( uint16_T u , uint16_T bp0 , uint16_T bpSpace ,
uint32_T maxIndex ) { uint16_T bpIndex ; if ( u <= bp0 ) { bpIndex = 0U ; }
else { bpIndex = ( uint16_T ) ( ( uint32_T ) ( uint16_T ) ( ( uint32_T ) u -
bp0 ) / bpSpace ) ; if ( bpIndex < maxIndex ) { } else { bpIndex = ( uint16_T
) maxIndex ; } } return bpIndex ; } uint8_T plook_u8u16_evencka ( uint16_T u
, uint16_T bp0 , uint16_T bpSpace , uint32_T maxIndex ) { uint16_T fbpIndex ;
uint8_T bpIndex ; if ( u <= bp0 ) { bpIndex = 0U ; } else { fbpIndex = (
uint16_T ) ( ( uint32_T ) ( uint16_T ) ( ( uint32_T ) u - bp0 ) / bpSpace ) ;
if ( fbpIndex < maxIndex ) { bpIndex = ( uint8_T ) fbpIndex ; } else {
bpIndex = ( uint8_T ) maxIndex ; } } return bpIndex ; } uint16_T
plook_u16s16_evencka ( int16_T u , int16_T bp0 , uint16_T bpSpace , uint32_T
maxIndex ) { uint16_T bpIndex ; if ( u <= bp0 ) { bpIndex = 0U ; } else {
bpIndex = ( uint16_T ) ( ( uint32_T ) ( uint16_T ) ( u - bp0 ) / bpSpace ) ;
if ( bpIndex < maxIndex ) { } else { bpIndex = ( uint16_T ) maxIndex ; } }
return bpIndex ; } int16_T div_s16u64 ( uint64_T numerator , uint64_T
denominator ) { int16_T quotient ; if ( denominator == 0ULL ) { quotient =
MAX_int16_T ; } else { quotient = ( int16_T ) ( numerator / denominator ) ; }
return quotient ; } int16_T div_s16s64_floor ( int64_T numerator , int64_T
denominator ) { uint64_T absDenominator ; uint64_T absNumerator ; uint64_T
tempAbsQuotient ; int16_T quotient ; boolean_T quotientNeedsNegation ; if (
denominator == 0LL ) { quotient = ( int16_T ) ( numerator >= 0LL ? 32767 : -
32768 ) ; } else { absNumerator = numerator < 0LL ? ~ ( uint64_T ) numerator
+ 1ULL : ( uint64_T ) numerator ; absDenominator = denominator < 0LL ? ~ (
uint64_T ) denominator + 1ULL : ( uint64_T ) denominator ;
quotientNeedsNegation = ( ( numerator < 0LL ) != ( denominator < 0LL ) ) ;
tempAbsQuotient = absNumerator / absDenominator ; if ( quotientNeedsNegation
) { absNumerator %= absDenominator ; if ( absNumerator > 0ULL ) {
tempAbsQuotient ++ ; } } quotient = ( int16_T ) ( quotientNeedsNegation ? (
int32_T ) ( int16_T ) - ( int64_T ) tempAbsQuotient : ( int32_T ) ( int16_T )
tempAbsQuotient ) ; } return quotient ; } int16_T div_s16s32_floor ( int32_T
numerator , int32_T denominator ) { uint32_T absDenominator ; uint32_T
absNumerator ; uint32_T tempAbsQuotient ; int16_T quotient ; boolean_T
quotientNeedsNegation ; if ( denominator == 0 ) { quotient = ( int16_T ) (
numerator >= 0 ? 32767 : - 32768 ) ; } else { absNumerator = numerator < 0 ?
~ ( uint32_T ) numerator + 1U : ( uint32_T ) numerator ; absDenominator =
denominator < 0 ? ~ ( uint32_T ) denominator + 1U : ( uint32_T ) denominator
; quotientNeedsNegation = ( ( numerator < 0 ) != ( denominator < 0 ) ) ;
tempAbsQuotient = absNumerator / absDenominator ; if ( quotientNeedsNegation
) { absNumerator %= absDenominator ; if ( absNumerator > 0U ) {
tempAbsQuotient ++ ; } } quotient = ( int16_T ) ( quotientNeedsNegation ? (
int32_T ) ( int16_T ) - ( int32_T ) tempAbsQuotient : ( int32_T ) ( int16_T )
tempAbsQuotient ) ; } return quotient ; } void ow4zjx1n21 ( real_T jgn4qiohpe
, real_T c3xmn5gv5v , real_T fo5oc00snc , uint8_T f10wg5twmj , gb0bg0wsfd *
localB ) { if ( ( f10wg5twmj == 4 ) || ( f10wg5twmj == 5 ) ) { localB ->
jh44athpdt = jgn4qiohpe ; localB -> cusnr13h0o = c3xmn5gv5v ; } else if ( (
f10wg5twmj == 1 ) || ( f10wg5twmj == 6 ) ) { localB -> cusnr13h0o =
c3xmn5gv5v ; localB -> jh44athpdt = - ( c3xmn5gv5v + fo5oc00snc ) ; } else {
localB -> jh44athpdt = jgn4qiohpe ; localB -> cusnr13h0o = - ( jgn4qiohpe +
fo5oc00snc ) ; } } void mhfpckhuco ( chxtqbwsax * localDW , j0myh2ax4s *
localP ) { localDW -> bdbhhwxoih [ 0 ] = localP ->
UnitDelay1_InitialCondition ; localDW -> bdbhhwxoih [ 1 ] = localP ->
UnitDelay1_InitialCondition ; } void cpoajd5uh0 ( int16_T ljqj1ih2lu ,
int16_T oyl21pewai , uint16_T k1p3y5bv2m , i4buatj1a5 * localB , chxtqbwsax *
localDW ) { int32_T tmp ; tmp = ljqj1ih2lu - localDW -> bdbhhwxoih [ 0 ] ; if
( tmp > 32767 ) { tmp = 32767 ; } else { if ( tmp < - 32768 ) { tmp = - 32768
; } } localB -> gx2jlq5q31 [ 0 ] = ( int16_T ) ( ( ( k1p3y5bv2m * tmp ) >> 16
) + localDW -> bdbhhwxoih [ 0 ] ) ; tmp = oyl21pewai - localDW -> bdbhhwxoih
[ 1 ] ; if ( tmp > 32767 ) { tmp = 32767 ; } else { if ( tmp < - 32768 ) {
tmp = - 32768 ; } } localB -> gx2jlq5q31 [ 1 ] = ( int16_T ) ( ( ( k1p3y5bv2m
* tmp ) >> 16 ) + localDW -> bdbhhwxoih [ 1 ] ) ; localB -> htqonzvdzb [ 0 ]
= localB -> gx2jlq5q31 [ 0 ] ; localB -> htqonzvdzb [ 1 ] = localB ->
gx2jlq5q31 [ 1 ] ; } void fzuldxxrcu ( i4buatj1a5 * localB , chxtqbwsax *
localDW ) { localDW -> bdbhhwxoih [ 0 ] = localB -> gx2jlq5q31 [ 0 ] ;
localDW -> bdbhhwxoih [ 1 ] = localB -> gx2jlq5q31 [ 1 ] ; } void dydxqoptgm
( hf5kk2nwcr * localDW , krsac5nzqr * localP ) { localDW -> ck2g4y21cg =
localP -> UnitDelay_InitialCondition_nx44oc1ciy ; localDW -> oqy0i3di0d =
localP -> UnitDelay_InitialCondition ; } void pubdfj1edp ( int16_T afk1kyk0mr
, int16_T aawbkupoqe , int16_T gkxngwyxh0 , int16_T gghr4xqvjp , int16_T
exvobtye0p , int16_T ievmrrf5tz , int16_T i24ycjg1bi , kppbsj2vev * localB ,
hf5kk2nwcr * localDW ) { int64_T q0 ; int64_T q1 ; int32_T ehxzaxw2eq ;
ehxzaxw2eq = ( afk1kyk0mr * aawbkupoqe ) >> 6 ; q0 = ( int64_T ) ehxzaxw2eq *
gkxngwyxh0 ; q1 = ( int64_T ) i24ycjg1bi << 14 ; if ( ( q0 < 0LL ) && ( q1 <
MIN_int64_T - q0 ) ) { q0 = MIN_int64_T ; } else if ( ( q0 > 0LL ) && ( q1 >
MAX_int64_T - q0 ) ) { q0 = MAX_int64_T ; } else { q0 += q1 ; } q1 = (
int64_T ) localDW -> ck2g4y21cg << 10 ; if ( ( q0 < 0LL ) && ( q1 <
MIN_int64_T - q0 ) ) { q0 = MIN_int64_T ; } else if ( ( q0 > 0LL ) && ( q1 >
MAX_int64_T - q0 ) ) { q0 = MAX_int64_T ; } else { q0 += q1 ; } localB ->
gefdxyy0g1 = q0 + localDW -> oqy0i3di0d ; q1 = localB -> gefdxyy0g1 >> 10 ;
if ( ( ehxzaxw2eq < 0LL ) && ( q1 < MIN_int64_T - ehxzaxw2eq ) ) { q0 =
MIN_int64_T ; } else if ( ( ehxzaxw2eq > 0LL ) && ( q1 > MAX_int64_T -
ehxzaxw2eq ) ) { q0 = MAX_int64_T ; } else { q0 = ehxzaxw2eq + q1 ; } if ( q0
> 2147483647LL ) { q0 = 2147483647LL ; } else { if ( q0 < - 2147483648LL ) {
q0 = - 2147483648LL ; } } if ( ( int32_T ) q0 > ( exvobtye0p << 4 ) ) {
localB -> fsq15efoh5 = ( int16_T ) ( exvobtye0p >> 2 ) ; } else if ( (
int32_T ) q0 < ( ievmrrf5tz << 4 ) ) { localB -> fsq15efoh5 = ( int16_T ) (
ievmrrf5tz >> 2 ) ; } else { localB -> fsq15efoh5 = ( int16_T ) ( ( int32_T )
q0 >> 6 ) ; } localB -> nz3zaaaraq = ( localB -> fsq15efoh5 << 6 ) - (
int32_T ) q0 ; localB -> py5uhmdfbm = ( int32_T ) ( ( ( int64_T ) localB ->
nz3zaaaraq * gghr4xqvjp ) >> 10 ) ; } void bpx04raylq ( kppbsj2vev * localB ,
hf5kk2nwcr * localDW ) { localDW -> ck2g4y21cg = localB -> py5uhmdfbm ;
localDW -> oqy0i3di0d = localB -> gefdxyy0g1 ; } void ngslrlcyim ( o3h5k4jeqj
* localDW , kp0i3ir4r2 * localP ) { localDW -> mp5vh0x33p = localP ->
UnitDelay_InitialCondition ; localDW -> mxzjvqfpt5 = localP ->
UnitDelay_InitialCondition_nofnsp1avs ; } void n30etil1yv ( int16_T
hdtf2xcqaa , int16_T h4n3b00roz , int16_T bz34wgjcb2 , int16_T p0s1mhjqok ,
int16_T ipdfmuzn4j , int16_T jhxss0jwju , int16_T ptkif5dyes , hqgtxnoyzn *
localB , o3h5k4jeqj * localDW ) { int64_T tmp ; int32_T eprbigkqsf ;
eprbigkqsf = ( hdtf2xcqaa * h4n3b00roz ) >> 6 ; tmp = ( ( int64_T )
eprbigkqsf * bz34wgjcb2 ) >> 13 ; if ( tmp > 2147483647LL ) { tmp =
2147483647LL ; } else { if ( tmp < - 2147483648LL ) { tmp = - 2147483648LL ;
} } tmp = ( ( ( ( int64_T ) ( int32_T ) tmp << 3 ) + ( ( int64_T ) ptkif5dyes
<< 3 ) ) + localDW -> mp5vh0x33p ) >> 3 ; if ( tmp > 2147483647LL ) { tmp =
2147483647LL ; } else { if ( tmp < - 2147483648LL ) { tmp = - 2147483648LL ;
} } localB -> lfmppyqz1u = ( int32_T ) tmp + localDW -> mxzjvqfpt5 ; tmp = (
( int64_T ) localB -> lfmppyqz1u << 3 ) + eprbigkqsf ; if ( tmp >
2147483647LL ) { tmp = 2147483647LL ; } else { if ( tmp < - 2147483648LL ) {
tmp = - 2147483648LL ; } } if ( ( int32_T ) tmp > ( ipdfmuzn4j << 4 ) ) {
localB -> n4j2qb3der = ( int16_T ) ( ipdfmuzn4j >> 2 ) ; } else if ( (
int32_T ) tmp < ( jhxss0jwju << 4 ) ) { localB -> n4j2qb3der = ( int16_T ) (
jhxss0jwju >> 2 ) ; } else { localB -> n4j2qb3der = ( int16_T ) ( ( int32_T )
tmp >> 6 ) ; } localB -> a5wchsyxl2 = ( int32_T ) ( ( ( int64_T ) ( ( localB
-> n4j2qb3der << 6 ) - ( int32_T ) tmp ) * p0s1mhjqok ) >> 10 ) ; } void
bbjrz03vll ( hqgtxnoyzn * localB , o3h5k4jeqj * localDW ) { localDW ->
mp5vh0x33p = localB -> a5wchsyxl2 ; localDW -> mxzjvqfpt5 = localB ->
lfmppyqz1u ; } void b1d41tupsk ( uint16_T g1dqnjn02r , uint16_T hfq3rzgjar ,
uint8_T ackk0imzd0 , uint16_T kljugs3oy4 , uint16_T cxzyjr5xc4 , uint16_T
b1014f3qc0 , uint16_T pirjnxlo5b , avsduhjsqq * localB ) { uint32_T qY ;
uint32_T qY_p ; uint32_T tmp ; uint16_T qY_e ; localB -> l1s3iblud2 =
ackk0imzd0 ; tmp = kljugs3oy4 + 1U ; if ( kljugs3oy4 + 1U > 65535U ) { tmp =
65535U ; } localB -> gwfhlmmysn = ( uint16_T ) tmp ; tmp = kljugs3oy4 + 1U ;
if ( kljugs3oy4 + 1U > 65535U ) { tmp = 65535U ; } localB -> n1ku1hlgib = (
uint16_T ) tmp ; tmp = ( uint32_T ) cxzyjr5xc4 + b1014f3qc0 ; if ( tmp >
65535U ) { tmp = 65535U ; } tmp += pirjnxlo5b ; if ( tmp > 65535U ) { tmp =
65535U ; } qY_p = ( uint32_T ) kljugs3oy4 - g1dqnjn02r ; if ( qY_p >
kljugs3oy4 ) { qY_p = 0U ; } qY = ( uint32_T ) kljugs3oy4 - hfq3rzgjar ; if (
qY > kljugs3oy4 ) { qY = 0U ; } if ( ( uint16_T ) qY_p > 32767 ) { qY_e =
MAX_uint16_T ; } else { qY_e = ( uint16_T ) ( ( uint16_T ) qY_p << 1 ) ; } if
( qY_e >= ( uint16_T ) tmp ) { tmp = ( uint32_T ) cxzyjr5xc4 + b1014f3qc0 ;
if ( tmp > 65535U ) { tmp = 65535U ; } if ( ( uint16_T ) qY_p >= ( int32_T )
tmp ) { qY_p = kljugs3oy4 - 1U ; if ( kljugs3oy4 - 1U > kljugs3oy4 ) { qY_p =
0U ; } localB -> gwfhlmmysn = ( uint16_T ) qY_p ; localB -> l1s3iblud2 = 1U ;
} else { tmp = ( uint32_T ) g1dqnjn02r + pirjnxlo5b ; if ( tmp > 65535U ) {
tmp = 65535U ; } if ( ( uint16_T ) tmp >= kljugs3oy4 ) { if ( kljugs3oy4 >
32767 ) { qY_e = MAX_uint16_T ; } else { qY_e = ( uint16_T ) ( kljugs3oy4 <<
1 ) ; } qY_p = ( uint32_T ) qY_e - ( uint16_T ) tmp ; if ( qY_p > qY_e ) {
qY_p = 0U ; } qY = qY_p - 1U ; if ( qY_p - 1U > qY_p ) { qY = 0U ; } localB
-> n1ku1hlgib = ( uint16_T ) qY ; } else { localB -> gwfhlmmysn = ( uint16_T
) tmp ; } } } else { if ( ( uint16_T ) qY > 32767 ) { qY_e = MAX_uint16_T ; }
else { qY_e = ( uint16_T ) ( ( uint16_T ) qY << 1 ) ; } if ( qY_e >= (
uint16_T ) tmp ) { tmp = ( uint32_T ) cxzyjr5xc4 + b1014f3qc0 ; if ( tmp >
65535U ) { tmp = 65535U ; } if ( ( uint16_T ) qY >= ( int32_T ) tmp ) { qY_p
= kljugs3oy4 - 1U ; if ( kljugs3oy4 - 1U > kljugs3oy4 ) { qY_p = 0U ; }
localB -> gwfhlmmysn = ( uint16_T ) qY_p ; } else { tmp = ( uint32_T )
hfq3rzgjar + pirjnxlo5b ; if ( tmp > 65535U ) { tmp = 65535U ; } if ( (
uint16_T ) tmp >= kljugs3oy4 ) { if ( kljugs3oy4 > 32767 ) { qY_e =
MAX_uint16_T ; } else { qY_e = ( uint16_T ) ( kljugs3oy4 << 1 ) ; } qY_p = (
uint32_T ) qY_e - ( uint16_T ) tmp ; if ( qY_p > qY_e ) { qY_p = 0U ; } qY =
qY_p - 1U ; if ( qY_p - 1U > qY_p ) { qY = 0U ; } localB -> n1ku1hlgib = (
uint16_T ) qY ; } else { localB -> gwfhlmmysn = ( uint16_T ) tmp ; } } } } }
void bvrjvl2kzf ( a3wuqqhzdr * localDW , njjlrak4ge * localP ) { localDW ->
emwxkef0aw = localP -> UnitDelay1_InitialCondition ; } void meo3xsl5lq (
int16_T ddcgyc02rj , int16_T jynyusg2t0 , nnjbh2uy01 * localB , a3wuqqhzdr *
localDW ) { int32_T tmp ; tmp = ddcgyc02rj - localDW -> emwxkef0aw ; if ( tmp
> 32767 ) { tmp = 32767 ; } else { if ( tmp < - 32768 ) { tmp = - 32768 ; } }
localB -> okk1dkpu34 = ( int16_T ) ( ( int16_T ) ( ( jynyusg2t0 * tmp ) >> 14
) + localDW -> emwxkef0aw ) ; localB -> np4j3haun3 = localB -> okk1dkpu34 ; }
void h0w0rxcscx ( nnjbh2uy01 * localB , a3wuqqhzdr * localDW ) { localDW ->
emwxkef0aw = localB -> okk1dkpu34 ; } void mrkf2n5cyb ( eqljxdvcin * localDW
, pkbcijxfuo * localP ) { localDW -> aw4gkotmo1 = localP ->
UnitDelay_InitialCondition ; localDW -> fuo5sxlped = 1U ; } void fdz4phu3ry (
int16_T bavo4ngebs , int16_T l2lhxohlnc , int16_T f2ai5oumqx , int16_T
m3wqeak4ta , int16_T cjnwlwzhkd , int16_T lrozvbpc3i , int16_T fctb1nyivp ,
uint8_T oqjslzcw5p , ajcqwmt0sb * localB , eqljxdvcin * localDW , bmesdcnt5d
* localZCE ) { int64_T tmp ; localB -> ormyhe3icn = ( bavo4ngebs * l2lhxohlnc
) >> 7 ; if ( ( oqjslzcw5p > 0 ) && ( localZCE -> hdn5edzzdz != POS_ZCSIG ) )
{ localDW -> fuo5sxlped = 1U ; } localZCE -> hdn5edzzdz = ( ZCSigState ) (
oqjslzcw5p > 0 ) ; if ( localDW -> fuo5sxlped != 0 ) { localDW -> dyhfef4gnd
= localB -> dsjvzll5l3 ; } tmp = ( ( int64_T ) localB -> ormyhe3icn *
f2ai5oumqx ) >> 14 ; if ( tmp > 2147483647LL ) { tmp = 2147483647LL ; } else
{ if ( tmp < - 2147483648LL ) { tmp = - 2147483648LL ; } } tmp = ( ( (
int64_T ) ( int32_T ) tmp + fctb1nyivp ) + ( ( int64_T ) localDW ->
aw4gkotmo1 << 2 ) ) >> 2 ; if ( tmp > 2147483647LL ) { tmp = 2147483647LL ; }
else { if ( tmp < - 2147483648LL ) { tmp = - 2147483648LL ; } } localB ->
f41yvkauih = ( int32_T ) tmp + localDW -> dyhfef4gnd ; localB -> ccvgxr12jg =
localB -> f41yvkauih >> 2 ; tmp = ( ( int64_T ) localB -> ccvgxr12jg << 4 ) +
localB -> ormyhe3icn ; if ( tmp > 2147483647LL ) { tmp = 2147483647LL ; }
else { if ( tmp < - 2147483648LL ) { tmp = - 2147483648LL ; } } localB ->
egkbdr0n0p = ( int32_T ) tmp ; if ( localB -> egkbdr0n0p > ( cjnwlwzhkd << 4
) ) { localB -> mrsm1mogfj = cjnwlwzhkd ; } else if ( localB -> egkbdr0n0p <
( lrozvbpc3i << 4 ) ) { localB -> mrsm1mogfj = lrozvbpc3i ; } else { localB
-> mrsm1mogfj = ( int16_T ) ( localB -> egkbdr0n0p >> 4 ) ; } localB ->
bxmfuji0dh = ( int32_T ) ( ( ( int64_T ) ( ( localB -> mrsm1mogfj << 4 ) -
localB -> egkbdr0n0p ) * m3wqeak4ta ) >> 16 ) ; } void fdz4phu3ryTID4 (
int16_T ju12ukc1tz , ajcqwmt0sb * localB ) { localB -> dsjvzll5l3 =
ju12ukc1tz << 2 ; } void mnavzygiru ( ajcqwmt0sb * localB , eqljxdvcin *
localDW ) { localDW -> aw4gkotmo1 = localB -> bxmfuji0dh ; localDW ->
fuo5sxlped = 0U ; localDW -> dyhfef4gnd = localB -> f41yvkauih ; } void
MdlInitialize ( void ) { int32_T i ; for ( i = 0 ; i < 30 ; i ++ ) { rtDW .
oed2laixap [ i ] = rtP . Delay_InitialCondition ; } rtDW . gc0xzmti13 = rtP .
Memory2_InitialCondition ; rtDW . lvmiamzpyq = rtP . Memory3_InitialCondition
; rtDW . ay1uwe1gfj = rtP . Memory4_InitialCondition ; rtDW . hvwgiwbc4a =
rtP . Memory_InitialCondition ; rtDW . pfd5dzwr30 = rtP .
Memory1_InitialCondition ; rtDW . ome5bgj33n = rtP .
Delay_InitialCondition_jrezgfzsw4 ; rtDW . au2rtsfkik = rtP .
Delay1_InitialCondition ; rtDW . ktje2zmdhr = rtP . Delay2_InitialCondition ;
rtDW . bu0nq43hjp = rtP . UnitDelay_InitialCondition ; rtDW . aq020iueee =
rtP . Memory_InitialCondition_ggq2uamd5m ; rtDW . mlp4bstdwk = rtP .
Memory1_InitialCondition_hul0dtsj5y ; rtDW . jktgwyewld = rtP .
Delay_InitialCondition_e03esys32u ; rtDW . pkbeapsmz3 = rtP .
Delay1_InitialCondition_h33fxedixn ; rtDW . aclmup2bmp = rtP .
Delay2_InitialCondition_niglvl4npn ; rtDW . nvtolofyxv = rtP .
UnitDelay3_InitialCondition_ehofyfh5ho ; rtDW . mcvoesfujc = rtP .
UnitDelay4_InitialCondition_dhy1cxosgt ; rtDW . bpxc1e3ccx = rtP .
UnitDelay2_InitialCondition_b4hpeiwu4m ; rtDW . m413xofoyi = rtP .
UnitDelay3_InitialCondition_o0fqg000ri ; rtB . gpqvhujprf = rtP . z_dir_Y0 ;
rtB . g1jlceech1 = rtP . z_dirPrev_Y0 ; rtDW . c03fwpj0hi = rtP .
UnitDelay2_InitialCondition ; rtDW . escn0j1ja5 = rtP .
UnitDelay3_InitialCondition ; rtDW . czugf3lp1i = rtP .
UnitDelay5_InitialCondition ; rtDW . jivyloy3yi = rtP .
UnitDelay4_InitialCondition ; rtDW . dzcn1vh1zj = rtP .
UnitDelay8_InitialCondition ; rtDW . hyx42rdc0g = rtP .
UnitDelay7_InitialCondition ; rtDW . icooovlxpv = rtP .
UnitDelay6_InitialCondition ; rtDW . hbqzn53x3b = rtP .
UnitDelay1_InitialCondition_cbtku3cxyp ; rtB . m3g31sqwvs = rtP . z_maxCntRst
; rtB . asc45ue45v = rtP . dz_trnsDet_Y0 ; rtB . hfzboalwag = rtP .
n_motRaw_Y0 ; rtDW . b5j5pn4402 = rtP .
UnitDelay2_InitialCondition_jbowcjs2jf ; rtDW . a1b24cmuov = rtP .
UnitDelay3_InitialCondition_i4g0avon54 ; rtDW . d2llyw4aei = rtP .
UnitDelay5_InitialCondition_pwox0sikus ; rtB . g0gujplx2r = rtP .
b_enaAdvCtrl_Y0 ; rtB . j2g21zcr5b = rtP . r_fieldWeak_Y0 ; rtB . iz1n4yrey2
= rtP . Merge_InitialOutput_nnbegyxgeq ; rtDW . buptq5b3lk = rtP .
UnitDelay1_InitialCondition ; rtDW . myc2dris0z = rtP .
UnitDelay2_InitialCondition_hvi5vmqnsx ; mhfpckhuco ( & rtDW . cpoajd5uh02 ,
& rtP . cpoajd5uh02 ) ; bvrjvl2kzf ( & rtDW . meo3xsl5lqf , & rtP .
meo3xsl5lqf ) ; mrkf2n5cyb ( & rtDW . fdz4phu3ryu , & rtP . fdz4phu3ryu ) ;
rtB . fdz4phu3ryu . mrsm1mogfj = rtP . pi_out_Y0 ; ngslrlcyim ( & rtDW .
n30etil1yvr , & rtP . n30etil1yvr ) ; rtB . n30etil1yvr . n4j2qb3der = rtP .
id_out_Y0 ; dydxqoptgm ( & rtDW . pubdfj1edpf , & rtP . pubdfj1edpf ) ; rtB .
pubdfj1edpf . fsq15efoh5 = rtP . vq_out_Y0 ; rtB . ozks1puxeq [ 0 ] = rtP .
Merge_InitialOutput ; rtB . ozks1puxeq [ 1 ] = rtP . Merge_InitialOutput ; }
void MdlStart ( void ) { NeModelParameters modelParameters ;
NeModelParameters modelParameters_p ; NeslSimulationData * tmp_e ;
NeslSimulator * tmp ; NeuDiagnosticManager * diagnosticManager ;
NeuDiagnosticTree * diagnosticTree ; char * msg ; real_T tmp_i ; int32_T
tmp_m ; boolean_T tmp_p ; { bool externalInputIsInDatasetFormat = false ;
void * pISigstreamManager = rt_GetISigstreamManager ( rtS ) ;
rtwISigstreamManagerGetInputIsInDatasetFormat ( pISigstreamManager , &
externalInputIsInDatasetFormat ) ; if ( externalInputIsInDatasetFormat ) { }
} { { { { sdiSignalSourceInfoU srcInfo ; sdiLabelU loggedName =
sdiGetLabelFromChars ( "" ) ; sdiLabelU origSigName = sdiGetLabelFromChars (
"" ) ; sdiLabelU propName = sdiGetLabelFromChars ( "" ) ; sdiLabelU blockPath
= sdiGetLabelFromChars ( "MotorController_FOC/Rotor_Angle15" ) ; sdiLabelU
blockSID = sdiGetLabelFromChars ( "" ) ; sdiLabelU subPath =
sdiGetLabelFromChars ( "" ) ; sdiDims sigDims ; sdiLabelU sigName =
sdiGetLabelFromChars ( "" ) ; sdiAsyncRepoDataTypeHandle hDT =
sdiAsyncRepoGetBuiltInDataTypeHandle ( DATA_TYPE_UINT8 ) ; { sdiComplexity
sigComplexity = REAL ; sdiSampleTimeContinuity stCont = SAMPLE_TIME_DISCRETE
; int_T sigDimsArray [ 1 ] = { 1 } ; sigDims . nDims = 1 ; sigDims .
dimensions = sigDimsArray ; srcInfo . numBlockPathElems = 1 ; srcInfo .
fullBlockPath = ( sdiFullBlkPathU ) & blockPath ; srcInfo . SID = (
sdiSignalIDU ) & blockSID ; srcInfo . subPath = subPath ; srcInfo . portIndex
= 0 + 1 ; srcInfo . signalName = sigName ; srcInfo . sigSourceUUID = 0 ; rtDW
. nqodwfxjjo . AQHandles = sdiAsyncRepoCreateAsyncioQueue ( hDT , & srcInfo ,
rt_dataMapInfo . mmi . InstanceMap . fullPath ,
"c57efbff-f66f-4928-a677-7f5e421942f1" , sigComplexity , & sigDims ,
DIMENSIONS_MODE_FIXED , stCont , "" ) ; if ( rtDW . nqodwfxjjo . AQHandles )
{ ssCachePointer ( rtS , & ( rtDW . nqodwfxjjo . AQHandles ) ) ;
sdiSetSignalSampleTimeString ( rtDW . nqodwfxjjo . AQHandles , "5e-06" ,
5.0E-6 , ssGetTFinal ( rtS ) ) ; sdiSetRunStartTime ( rtDW . nqodwfxjjo .
AQHandles , ssGetTaskTime ( rtS , 1 ) ) ; sdiAsyncRepoSetSignalExportSettings
( rtDW . nqodwfxjjo . AQHandles , 1 , 0 ) ; sdiAsyncRepoSetSignalExportName (
rtDW . nqodwfxjjo . AQHandles , loggedName , origSigName , propName ) ; }
sdiFreeLabel ( sigName ) ; sdiFreeLabel ( loggedName ) ; sdiFreeLabel (
origSigName ) ; sdiFreeLabel ( propName ) ; sdiFreeLabel ( blockPath ) ;
sdiFreeLabel ( blockSID ) ; sdiFreeLabel ( subPath ) ; } } } } } rtDW .
b4mhrctptb = - 1 ; rtDW . hsdsrre1ez = - 1 ; rtDW . nwulawgmpz = - 1 ; rtDW .
mmgy52to34 = - 1 ; rtDW . akezlsvf4r = - 1 ; rtDW . nvwhihmuxi = - 1 ; tmp =
nesl_lease_simulator (
"MotorController_FOC/plant_pmsm/Solver Configuration_1" , 0 , 0 ) ; rtDW .
an0wa2vz4w = ( void * ) tmp ; tmp_p = pointer_is_null ( rtDW . an0wa2vz4w ) ;
if ( tmp_p ) { MotorController_FOC_466a9c02_1_gateway ( ) ; tmp =
nesl_lease_simulator (
"MotorController_FOC/plant_pmsm/Solver Configuration_1" , 0 , 0 ) ; rtDW .
an0wa2vz4w = ( void * ) tmp ; } tmp_e = nesl_create_simulation_data ( ) ;
rtDW . bxdcoquy3x = ( void * ) tmp_e ; diagnosticManager =
rtw_create_diagnostics ( ) ; rtDW . hviz4et2ov = ( void * ) diagnosticManager
; modelParameters . mSolverType = NE_SOLVER_TYPE_DISCRETE ; modelParameters .
mSolverTolerance = 0.001 ; modelParameters . mVariableStepSolver = false ;
modelParameters . mIsUsingODEN = false ; modelParameters . mFixedStepSize =
5.0E-6 ; modelParameters . mStartTime = 0.0 ; modelParameters .
mLoadInitialState = false ; modelParameters . mUseSimState = false ;
modelParameters . mLinTrimCompile = false ; modelParameters . mLoggingMode =
SSC_LOGGING_NONE ; modelParameters . mRTWModifiedTimeStamp = 5.69855584E+8 ;
tmp_i = 0.001 ; modelParameters . mSolverTolerance = tmp_i ; tmp_i = 5.0E-6 ;
modelParameters . mFixedStepSize = tmp_i ; tmp_p = false ; modelParameters .
mVariableStepSolver = tmp_p ; tmp_p = false ; modelParameters . mIsUsingODEN
= tmp_p ; tmp_p = ssGetGlobalInitialStatesAvailable ( rtS ) ; modelParameters
. mLoadInitialState = ( tmp_p && ssIsFirstInitCond ( rtS ) ) ;
diagnosticManager = ( NeuDiagnosticManager * ) rtDW . hviz4et2ov ;
diagnosticTree = neu_diagnostic_manager_get_initial_tree ( diagnosticManager
) ; tmp_m = nesl_initialize_simulator ( ( NeslSimulator * ) rtDW . an0wa2vz4w
, & modelParameters , diagnosticManager ) ; if ( tmp_m != 0 ) { tmp_p =
error_buffer_is_empty ( ssGetErrorStatus ( rtS ) ) ; if ( tmp_p ) { msg =
rtw_diagnostics_msg ( diagnosticTree ) ; ssSetErrorStatus ( rtS , msg ) ; } }
tmp = nesl_lease_simulator (
"MotorController_FOC/plant_pmsm/Solver Configuration_1" , 1 , 0 ) ; rtDW .
esmpu2rv15 = ( void * ) tmp ; tmp_p = pointer_is_null ( rtDW . esmpu2rv15 ) ;
if ( tmp_p ) { MotorController_FOC_466a9c02_1_gateway ( ) ; tmp =
nesl_lease_simulator (
"MotorController_FOC/plant_pmsm/Solver Configuration_1" , 1 , 0 ) ; rtDW .
esmpu2rv15 = ( void * ) tmp ; } tmp_e = nesl_create_simulation_data ( ) ;
rtDW . mk5pob3hjk = ( void * ) tmp_e ; diagnosticManager =
rtw_create_diagnostics ( ) ; rtDW . ol3d3jcj0w = ( void * ) diagnosticManager
; modelParameters_p . mSolverType = NE_SOLVER_TYPE_DISCRETE ;
modelParameters_p . mSolverTolerance = 0.001 ; modelParameters_p .
mVariableStepSolver = false ; modelParameters_p . mIsUsingODEN = false ;
modelParameters_p . mFixedStepSize = 5.0E-6 ; modelParameters_p . mStartTime
= 0.0 ; modelParameters_p . mLoadInitialState = false ; modelParameters_p .
mUseSimState = false ; modelParameters_p . mLinTrimCompile = false ;
modelParameters_p . mLoggingMode = SSC_LOGGING_NONE ; modelParameters_p .
mRTWModifiedTimeStamp = 5.69855584E+8 ; tmp_i = 0.001 ; modelParameters_p .
mSolverTolerance = tmp_i ; tmp_i = 5.0E-6 ; modelParameters_p .
mFixedStepSize = tmp_i ; tmp_p = false ; modelParameters_p .
mVariableStepSolver = tmp_p ; tmp_p = false ; modelParameters_p .
mIsUsingODEN = tmp_p ; tmp_p = ssGetGlobalInitialStatesAvailable ( rtS ) ;
modelParameters_p . mLoadInitialState = ( tmp_p && ssIsFirstInitCond ( rtS )
) ; diagnosticManager = ( NeuDiagnosticManager * ) rtDW . ol3d3jcj0w ;
diagnosticTree = neu_diagnostic_manager_get_initial_tree ( diagnosticManager
) ; tmp_m = nesl_initialize_simulator ( ( NeslSimulator * ) rtDW . esmpu2rv15
, & modelParameters_p , diagnosticManager ) ; if ( tmp_m != 0 ) { tmp_p =
error_buffer_is_empty ( ssGetErrorStatus ( rtS ) ) ; if ( tmp_p ) { msg =
rtw_diagnostics_msg ( diagnosticTree ) ; ssSetErrorStatus ( rtS , msg ) ; } }
{ FWksInfo * fromwksInfo ; if ( ( fromwksInfo = ( FWksInfo * ) calloc ( 1 ,
sizeof ( FWksInfo ) ) ) == ( NULL ) ) { ssSetErrorStatus ( rtS ,
"from workspace STRING(Name) memory allocation error" ) ; } else {
fromwksInfo -> origWorkspaceVarName = "tuvar" ; fromwksInfo -> origDataTypeId
= 0 ; fromwksInfo -> origIsComplex = 0 ; fromwksInfo -> origWidth = 1 ;
fromwksInfo -> origElSize = sizeof ( real_T ) ; fromwksInfo -> data = ( void
* ) rtP . FromWs_Data0 ; fromwksInfo -> nDataPoints = 8 ; fromwksInfo -> time
= ( double * ) rtP . FromWs_Time0 ; rtDW . hfbpng1m5z . TimePtr = fromwksInfo
-> time ; rtDW . hfbpng1m5z . DataPtr = fromwksInfo -> data ; rtDW .
hfbpng1m5z . RSimInfoPtr = fromwksInfo ; ssCachePointer ( rtS , & ( rtDW .
hfbpng1m5z . TimePtr ) ) ; ssCachePointer ( rtS , & ( rtDW . hfbpng1m5z .
DataPtr ) ) ; ssCachePointer ( rtS , & ( rtDW . hfbpng1m5z . RSimInfoPtr ) )
; } rtDW . j0ajw1byxy . PrevIndex = 0 ; } rtDW . fbfx01uq0n = rtP .
DataStoreMemory_InitialValue_k3d0py0lyr ; rtDW . h5tuq0lorh = rtP .
DataStoreMemory2_InitialValue_e0vyc005kc ; rtDW . jrusai53lx = rtP .
DataStoreMemory_InitialValue ; rtDW . mljj1znw3o = rtP .
DataStoreMemory2_InitialValue ; MdlInitialize ( ) ; } void MdlOutputs ( int_T
tid ) { real_T aanll2fxii ; int16_T bo15wrlfwn ; int16_T ocdwfzxb2r ; int16_T
doltjf0iws ; uint8_T cv0l4vqzrl ; NeslSimulationData * simulationData ;
NeuDiagnosticManager * diagnosticManager ; NeuDiagnosticTree * diagnosticTree
; char * msg ; int64_T tmp_c ; int64_T tmp_f ; real_T tmp_i [ 68 ] ; real_T
tmp_p [ 24 ] ; real_T agsb40ddde ; real_T fazx42jmnu ; real_T fsq5zusgg2 ;
real_T fwrnkeh1om ; real_T time ; real_T time_p ; int32_T i ; int32_T tmp_g ;
int32_T tmp_j ; int_T tmp_m [ 8 ] ; int_T tmp_e [ 7 ] ; uint32_T tmp_k ;
int16_T a1rdwgil3z ; int16_T ayvhk40cdk ; int16_T e1egg35odv ; int16_T
gyd3gek5if ; int16_T jpmxaxsrtg ; uint16_T bztotrrun4 ; int8_T rtAction ;
int8_T rtPrevAction ; boolean_T bziz4pj4c3 [ 6 ] ; boolean_T tmp ; srClearBC
( rtDW . aqnsdlzrky ) ; srClearBC ( rtDW . o15rhlrdvu ) ; srClearBC ( rtDW .
emjuqt1mza ) ; srClearBC ( rtDW . grldzuufc2 ) ; srClearBC ( rtDW .
lincvc42bd ) ; srClearBC ( rtDW . lufhggjfnd ) ; srClearBC ( rtDW .
agj4y5aysy ) ; srClearBC ( rtDW . okzuukxele ) ; srClearBC ( rtDW .
c1r3arr2wv ) ; srClearBC ( rtDW . adbs0iqmbq ) ; srClearBC ( rtDW .
jllb4crr4l ) ; srClearBC ( rtDW . fy2xh4lnkj ) ; srClearBC ( rtDW .
etrlwpgbmn ) ; for ( i = 0 ; i < 6 ; i ++ ) { rtB . hltmrpvj1p [ i ] = rtDW .
oed2laixap [ i ] ; } rtB . fuyeltap5a = look1_binlxpw ( muDoubleScalarRem (
ssGetT ( rtS ) - 0.0 , rtP . Constant_Value_lwga4fzsnq ) , rtP .
LookUpTable1_bp01Data , rtP . modulatedwave_rep_seq_y , 2U ) ; fwrnkeh1om =
muDoubleScalarFloor ( rtB . fuyeltap5a ) ; if ( muDoubleScalarIsNaN (
fwrnkeh1om ) || muDoubleScalarIsInf ( fwrnkeh1om ) ) { fwrnkeh1om = 0.0 ; }
else { fwrnkeh1om = muDoubleScalarRem ( fwrnkeh1om , 65536.0 ) ; } rtB .
hr0ijokt1h = ( uint16_T ) ( fwrnkeh1om < 0.0 ? ( int32_T ) ( uint16_T ) - (
int16_T ) ( uint16_T ) - fwrnkeh1om : ( int32_T ) ( uint16_T ) fwrnkeh1om ) ;
rtB . c0za51q0f5 = rtDW . gc0xzmti13 ; rtB . lk4zjjz41c = ( rtB . hr0ijokt1h
< rtB . c0za51q0f5 ) ; rtB . mweesx4sey = ! rtB . lk4zjjz41c ; rtB .
kqb2lyogzy = rtDW . lvmiamzpyq ; rtB . flinlchw1h = ( rtB . hr0ijokt1h < rtB
. kqb2lyogzy ) ; rtB . pxjlxuyjb5 = ! rtB . flinlchw1h ; rtB . o25j5dk545 =
rtDW . ay1uwe1gfj ; rtB . o4mntq1jfd = ( rtB . hr0ijokt1h < rtB . o25j5dk545
) ; rtB . hqr0qifjoz = ! rtB . o4mntq1jfd ; if ( rtP .
ManualSwitch_CurrentSetting_lozjlaovmx == 1 ) { rtB . megmewxqrd = rtP .
Dead_Enable_Value ; } else { rtB . megmewxqrd = rtP . Dead_Disable_Value ; }
if ( rtB . megmewxqrd > rtP . Switch_Threshold ) { bziz4pj4c3 [ 0 ] = ( rtB .
lk4zjjz41c && rtB . hltmrpvj1p [ 0 ] ) ; bziz4pj4c3 [ 1 ] = ( rtB .
mweesx4sey && rtB . hltmrpvj1p [ 1 ] ) ; bziz4pj4c3 [ 2 ] = ( rtB .
flinlchw1h && rtB . hltmrpvj1p [ 2 ] ) ; bziz4pj4c3 [ 3 ] = ( rtB .
pxjlxuyjb5 && rtB . hltmrpvj1p [ 3 ] ) ; bziz4pj4c3 [ 4 ] = ( rtB .
o4mntq1jfd && rtB . hltmrpvj1p [ 4 ] ) ; bziz4pj4c3 [ 5 ] = ( rtB .
hqr0qifjoz && rtB . hltmrpvj1p [ 5 ] ) ; } else { bziz4pj4c3 [ 0 ] = rtB .
lk4zjjz41c ; bziz4pj4c3 [ 1 ] = rtB . mweesx4sey ; bziz4pj4c3 [ 2 ] = rtB .
flinlchw1h ; bziz4pj4c3 [ 3 ] = rtB . pxjlxuyjb5 ; bziz4pj4c3 [ 4 ] = rtB .
o4mntq1jfd ; bziz4pj4c3 [ 5 ] = rtB . hqr0qifjoz ; } for ( i = 0 ; i < 6 ; i
++ ) { rtB . cidzayhxni [ i ] = bziz4pj4c3 [ i ] ; } rtB . n55agx45bu [ 0 ] =
rtB . cidzayhxni [ 2 ] ; rtB . n55agx45bu [ 1 ] = 0.0 ; rtB . n55agx45bu [ 2
] = 0.0 ; rtB . n55agx45bu [ 3 ] = 0.0 ; rtB . lfc51tobdb [ 0 ] = rtB .
cidzayhxni [ 3 ] ; rtB . lfc51tobdb [ 1 ] = 0.0 ; rtB . lfc51tobdb [ 2 ] =
0.0 ; rtB . lfc51tobdb [ 3 ] = 0.0 ; rtB . fiygwmgxli [ 0 ] = rtB .
cidzayhxni [ 4 ] ; rtB . fiygwmgxli [ 1 ] = 0.0 ; rtB . fiygwmgxli [ 2 ] =
0.0 ; rtB . fiygwmgxli [ 3 ] = 0.0 ; rtB . hrn0vza32l [ 0 ] = rtB .
cidzayhxni [ 5 ] ; rtB . hrn0vza32l [ 1 ] = 0.0 ; rtB . hrn0vza32l [ 2 ] =
0.0 ; rtB . hrn0vza32l [ 3 ] = 0.0 ; rtB . nckbbwqwdk [ 0 ] = rtB .
cidzayhxni [ 0 ] ; rtB . nckbbwqwdk [ 1 ] = 0.0 ; rtB . nckbbwqwdk [ 2 ] =
0.0 ; rtB . nckbbwqwdk [ 3 ] = 0.0 ; rtB . ijzodrsa3j [ 0 ] = rtB .
cidzayhxni [ 1 ] ; rtB . ijzodrsa3j [ 1 ] = 0.0 ; rtB . ijzodrsa3j [ 2 ] =
0.0 ; rtB . ijzodrsa3j [ 3 ] = 0.0 ; simulationData = ( NeslSimulationData *
) rtDW . bxdcoquy3x ; time = ssGetT ( rtS ) ; simulationData -> mData ->
mTime . mN = 1 ; simulationData -> mData -> mTime . mX = & time ;
simulationData -> mData -> mContStates . mN = 0 ; simulationData -> mData ->
mContStates . mX = NULL ; simulationData -> mData -> mDiscStates . mN = 24 ;
simulationData -> mData -> mDiscStates . mX = & rtDW . keiuwklhbp [ 0 ] ;
simulationData -> mData -> mModeVector . mN = 20 ; simulationData -> mData ->
mModeVector . mX = & rtDW . ckqpu5xkdu [ 0 ] ; tmp = false ; simulationData
-> mData -> mFoundZcEvents = tmp ; simulationData -> mData ->
mIsMajorTimeStep = true ; tmp = ( ssGetMdlInfoPtr ( rtS ) -> mdlFlags .
solverAssertCheck == 1U ) ; simulationData -> mData -> mIsSolverAssertCheck =
tmp ; simulationData -> mData -> mIsSolverCheckingCIC = false ;
simulationData -> mData -> mIsComputingJacobian = false ; simulationData ->
mData -> mIsEvaluatingF0 = false ; simulationData -> mData ->
mIsSolverRequestingReset = false ; tmp_e [ 0 ] = 0 ; tmp_p [ 0 ] = rtB .
n55agx45bu [ 0 ] ; tmp_p [ 1 ] = rtB . n55agx45bu [ 1 ] ; tmp_p [ 2 ] = rtB .
n55agx45bu [ 2 ] ; tmp_p [ 3 ] = rtB . n55agx45bu [ 3 ] ; tmp_e [ 1 ] = 4 ;
tmp_p [ 4 ] = rtB . lfc51tobdb [ 0 ] ; tmp_p [ 5 ] = rtB . lfc51tobdb [ 1 ] ;
tmp_p [ 6 ] = rtB . lfc51tobdb [ 2 ] ; tmp_p [ 7 ] = rtB . lfc51tobdb [ 3 ] ;
tmp_e [ 2 ] = 8 ; tmp_p [ 8 ] = rtB . fiygwmgxli [ 0 ] ; tmp_p [ 9 ] = rtB .
fiygwmgxli [ 1 ] ; tmp_p [ 10 ] = rtB . fiygwmgxli [ 2 ] ; tmp_p [ 11 ] = rtB
. fiygwmgxli [ 3 ] ; tmp_e [ 3 ] = 12 ; tmp_p [ 12 ] = rtB . hrn0vza32l [ 0 ]
; tmp_p [ 13 ] = rtB . hrn0vza32l [ 1 ] ; tmp_p [ 14 ] = rtB . hrn0vza32l [ 2
] ; tmp_p [ 15 ] = rtB . hrn0vza32l [ 3 ] ; tmp_e [ 4 ] = 16 ; tmp_p [ 16 ] =
rtB . nckbbwqwdk [ 0 ] ; tmp_p [ 17 ] = rtB . nckbbwqwdk [ 1 ] ; tmp_p [ 18 ]
= rtB . nckbbwqwdk [ 2 ] ; tmp_p [ 19 ] = rtB . nckbbwqwdk [ 3 ] ; tmp_e [ 5
] = 20 ; tmp_p [ 20 ] = rtB . ijzodrsa3j [ 0 ] ; tmp_p [ 21 ] = rtB .
ijzodrsa3j [ 1 ] ; tmp_p [ 22 ] = rtB . ijzodrsa3j [ 2 ] ; tmp_p [ 23 ] = rtB
. ijzodrsa3j [ 3 ] ; tmp_e [ 6 ] = 24 ; simulationData -> mData ->
mInputValues . mN = 24 ; simulationData -> mData -> mInputValues . mX = &
tmp_p [ 0 ] ; simulationData -> mData -> mInputOffsets . mN = 7 ;
simulationData -> mData -> mInputOffsets . mX = & tmp_e [ 0 ] ;
simulationData -> mData -> mOutputs . mN = 44 ; simulationData -> mData ->
mOutputs . mX = & rtB . cth1cljg1v [ 0 ] ; simulationData -> mData ->
mSampleHits . mN = 0 ; simulationData -> mData -> mSampleHits . mX = NULL ;
tmp = ssIsSampleHit ( rtS , 1 , 0 ) ; simulationData -> mData ->
mIsFundamentalSampleHit = tmp ; simulationData -> mData -> mTolerances . mN =
0 ; simulationData -> mData -> mTolerances . mX = NULL ; simulationData ->
mData -> mCstateHasChanged = false ; diagnosticManager = (
NeuDiagnosticManager * ) rtDW . hviz4et2ov ; diagnosticTree =
neu_diagnostic_manager_get_initial_tree ( diagnosticManager ) ; i =
ne_simulator_method ( ( NeslSimulator * ) rtDW . an0wa2vz4w ,
NESL_SIM_OUTPUTS , simulationData , diagnosticManager ) ; if ( i != 0 ) { tmp
= error_buffer_is_empty ( ssGetErrorStatus ( rtS ) ) ; if ( tmp ) { msg =
rtw_diagnostics_msg ( diagnosticTree ) ; ssSetErrorStatus ( rtS , msg ) ; } }
ssSetBlockStateForSolverChangedAtMajorStep ( rtS ) ; simulationData = (
NeslSimulationData * ) rtDW . mk5pob3hjk ; time_p = ssGetT ( rtS ) ;
simulationData -> mData -> mTime . mN = 1 ; simulationData -> mData -> mTime
. mX = & time_p ; simulationData -> mData -> mContStates . mN = 0 ;
simulationData -> mData -> mContStates . mX = NULL ; simulationData -> mData
-> mDiscStates . mN = 0 ; simulationData -> mData -> mDiscStates . mX = &
rtDW . ncijok5okf ; simulationData -> mData -> mModeVector . mN = 0 ;
simulationData -> mData -> mModeVector . mX = & rtDW . hvyhz0rinp ; tmp =
false ; simulationData -> mData -> mFoundZcEvents = tmp ; simulationData ->
mData -> mIsMajorTimeStep = true ; tmp = ( ssGetMdlInfoPtr ( rtS ) ->
mdlFlags . solverAssertCheck == 1U ) ; simulationData -> mData ->
mIsSolverAssertCheck = tmp ; simulationData -> mData -> mIsSolverCheckingCIC
= false ; simulationData -> mData -> mIsComputingJacobian = false ;
simulationData -> mData -> mIsEvaluatingF0 = false ; simulationData -> mData
-> mIsSolverRequestingReset = false ; tmp_m [ 0 ] = 0 ; tmp_i [ 0 ] = rtB .
n55agx45bu [ 0 ] ; tmp_i [ 1 ] = rtB . n55agx45bu [ 1 ] ; tmp_i [ 2 ] = rtB .
n55agx45bu [ 2 ] ; tmp_i [ 3 ] = rtB . n55agx45bu [ 3 ] ; tmp_m [ 1 ] = 4 ;
tmp_i [ 4 ] = rtB . lfc51tobdb [ 0 ] ; tmp_i [ 5 ] = rtB . lfc51tobdb [ 1 ] ;
tmp_i [ 6 ] = rtB . lfc51tobdb [ 2 ] ; tmp_i [ 7 ] = rtB . lfc51tobdb [ 3 ] ;
tmp_m [ 2 ] = 8 ; tmp_i [ 8 ] = rtB . fiygwmgxli [ 0 ] ; tmp_i [ 9 ] = rtB .
fiygwmgxli [ 1 ] ; tmp_i [ 10 ] = rtB . fiygwmgxli [ 2 ] ; tmp_i [ 11 ] = rtB
. fiygwmgxli [ 3 ] ; tmp_m [ 3 ] = 12 ; tmp_i [ 12 ] = rtB . hrn0vza32l [ 0 ]
; tmp_i [ 13 ] = rtB . hrn0vza32l [ 1 ] ; tmp_i [ 14 ] = rtB . hrn0vza32l [ 2
] ; tmp_i [ 15 ] = rtB . hrn0vza32l [ 3 ] ; tmp_m [ 4 ] = 16 ; tmp_i [ 16 ] =
rtB . nckbbwqwdk [ 0 ] ; tmp_i [ 17 ] = rtB . nckbbwqwdk [ 1 ] ; tmp_i [ 18 ]
= rtB . nckbbwqwdk [ 2 ] ; tmp_i [ 19 ] = rtB . nckbbwqwdk [ 3 ] ; tmp_m [ 5
] = 20 ; tmp_i [ 20 ] = rtB . ijzodrsa3j [ 0 ] ; tmp_i [ 21 ] = rtB .
ijzodrsa3j [ 1 ] ; tmp_i [ 22 ] = rtB . ijzodrsa3j [ 2 ] ; tmp_i [ 23 ] = rtB
. ijzodrsa3j [ 3 ] ; tmp_m [ 6 ] = 24 ; memcpy ( & tmp_i [ 24 ] , & rtB .
cth1cljg1v [ 0 ] , 44U * sizeof ( real_T ) ) ; tmp_m [ 7 ] = 68 ;
simulationData -> mData -> mInputValues . mN = 68 ; simulationData -> mData
-> mInputValues . mX = & tmp_i [ 0 ] ; simulationData -> mData ->
mInputOffsets . mN = 8 ; simulationData -> mData -> mInputOffsets . mX = &
tmp_m [ 0 ] ; simulationData -> mData -> mOutputs . mN = 6 ; simulationData
-> mData -> mOutputs . mX = & rtB . iairrjrsnt [ 0 ] ; simulationData ->
mData -> mSampleHits . mN = 0 ; simulationData -> mData -> mSampleHits . mX =
NULL ; tmp = ssIsSampleHit ( rtS , 1 , 0 ) ; simulationData -> mData ->
mIsFundamentalSampleHit = tmp ; simulationData -> mData -> mTolerances . mN =
0 ; simulationData -> mData -> mTolerances . mX = NULL ; simulationData ->
mData -> mCstateHasChanged = false ; diagnosticManager = (
NeuDiagnosticManager * ) rtDW . ol3d3jcj0w ; diagnosticTree =
neu_diagnostic_manager_get_initial_tree ( diagnosticManager ) ; i =
ne_simulator_method ( ( NeslSimulator * ) rtDW . esmpu2rv15 ,
NESL_SIM_OUTPUTS , simulationData , diagnosticManager ) ; if ( i != 0 ) { tmp
= error_buffer_is_empty ( ssGetErrorStatus ( rtS ) ) ; if ( tmp ) { msg =
rtw_diagnostics_msg ( diagnosticTree ) ; ssSetErrorStatus ( rtS , msg ) ; } }
ssSetBlockStateForSolverChangedAtMajorStep ( rtS ) ; fazx42jmnu = rtP .
n_resistance * rtP . n_gain / rtP . n_ref_vol * rtP . n_adc_max ; fwrnkeh1om
= muDoubleScalarFloor ( fazx42jmnu * rtDW . hvwgiwbc4a ) ; if (
muDoubleScalarIsNaN ( fwrnkeh1om ) || muDoubleScalarIsInf ( fwrnkeh1om ) ) {
fwrnkeh1om = 0.0 ; } else { fwrnkeh1om = muDoubleScalarRem ( fwrnkeh1om ,
65536.0 ) ; } rtB . jypvuvbmom [ 0 ] = ( int16_T ) ( fwrnkeh1om < 0.0 ? (
int32_T ) ( int16_T ) - ( int16_T ) ( uint16_T ) - fwrnkeh1om : ( int32_T ) (
int16_T ) ( uint16_T ) fwrnkeh1om ) ; fwrnkeh1om = muDoubleScalarFloor (
fazx42jmnu * rtDW . pfd5dzwr30 ) ; if ( muDoubleScalarIsNaN ( fwrnkeh1om ) ||
muDoubleScalarIsInf ( fwrnkeh1om ) ) { fwrnkeh1om = 0.0 ; } else { fwrnkeh1om
= muDoubleScalarRem ( fwrnkeh1om , 65536.0 ) ; } rtB . jypvuvbmom [ 1 ] = (
int16_T ) ( fwrnkeh1om < 0.0 ? ( int32_T ) ( int16_T ) - ( int16_T ) (
uint16_T ) - fwrnkeh1om : ( int32_T ) ( int16_T ) ( uint16_T ) fwrnkeh1om ) ;
fazx42jmnu = rtP . n_polePairs * rtB . iairrjrsnt [ 3 ] ; fwrnkeh1om = rtP .
Gain1_Gain * rtB . iairrjrsnt [ 4 ] ; fwrnkeh1om = trunc ( fwrnkeh1om * 4.0 )
; if ( muDoubleScalarIsNaN ( fwrnkeh1om ) || muDoubleScalarIsInf ( fwrnkeh1om
) ) { fwrnkeh1om = 0.0 ; } else { fwrnkeh1om = muDoubleScalarRem ( fwrnkeh1om
, 65536.0 ) ; } rtB . neyktewlh5 = ( int16_T ) ( fwrnkeh1om < 0.0 ? ( int32_T
) ( int16_T ) - ( int16_T ) ( uint16_T ) - fwrnkeh1om : ( int32_T ) ( int16_T
) ( uint16_T ) fwrnkeh1om ) ; { real_T * pDataValues = ( real_T * ) rtDW .
hfbpng1m5z . DataPtr ; real_T * pTimeValues = ( real_T * ) rtDW . hfbpng1m5z
. TimePtr ; int_T currTimeIndex = rtDW . j0ajw1byxy . PrevIndex ; real_T t =
ssGetTaskTime ( rtS , 0 ) ; int numPoints , lastPoint ; FWksInfo *
fromwksInfo = ( FWksInfo * ) rtDW . hfbpng1m5z . RSimInfoPtr ; numPoints =
fromwksInfo -> nDataPoints ; lastPoint = numPoints - 1 ; if ( t <=
pTimeValues [ 0 ] ) { currTimeIndex = 0 ; } else if ( t >= pTimeValues [
lastPoint ] ) { currTimeIndex = lastPoint - 1 ; } else { if ( t < pTimeValues
[ currTimeIndex ] ) { while ( t < pTimeValues [ currTimeIndex ] ) {
currTimeIndex -- ; } } else { while ( t >= pTimeValues [ currTimeIndex + 1 ]
) { currTimeIndex ++ ; } } } rtDW . j0ajw1byxy . PrevIndex = currTimeIndex ;
{ real_T t1 = pTimeValues [ currTimeIndex ] ; real_T t2 = pTimeValues [
currTimeIndex + 1 ] ; if ( t1 == t2 ) { if ( t < t1 ) { aanll2fxii =
pDataValues [ currTimeIndex ] ; } else { aanll2fxii = pDataValues [
currTimeIndex + 1 ] ; } } else { real_T f1 = ( t2 - t ) / ( t2 - t1 ) ;
real_T f2 = 1.0 - f1 ; real_T d1 ; real_T d2 ; int_T TimeIndex =
currTimeIndex ; d1 = pDataValues [ TimeIndex ] ; d2 = pDataValues [ TimeIndex
+ 1 ] ; aanll2fxii = ( real_T ) rtInterpolate ( d1 , d2 , f1 , f2 ) ;
pDataValues += numPoints ; } } } if ( rtP . ManualSwitch1_CurrentSetting == 1
) { fwrnkeh1om = rtP . Constant_Value ; } else { fwrnkeh1om = aanll2fxii ; }
fwrnkeh1om = muDoubleScalarFloor ( rtP . Gain2_Gain * fwrnkeh1om * 4.0 ) ; if
( muDoubleScalarIsNaN ( fwrnkeh1om ) || muDoubleScalarIsInf ( fwrnkeh1om ) )
{ fwrnkeh1om = 0.0 ; } else { fwrnkeh1om = muDoubleScalarRem ( fwrnkeh1om ,
65536.0 ) ; } rtB . nfuvtrnjsl = ( int16_T ) ( fwrnkeh1om < 0.0 ? ( int32_T )
( int16_T ) - ( int16_T ) ( uint16_T ) - fwrnkeh1om : ( int32_T ) ( int16_T )
( uint16_T ) fwrnkeh1om ) ; fwrnkeh1om = rtP . n_polePairs * rtB . iairrjrsnt
[ 3 ] ; muDoubleScalarSinCos ( fwrnkeh1om , & fsq5zusgg2 , & agsb40ddde ) ;
fwrnkeh1om = rtP . raddeg_Gain * muDoubleScalarAtan2 ( fsq5zusgg2 ,
agsb40ddde ) ; rtB . n2ct5ob2wl = ( ( fwrnkeh1om >= rtP .
Constant_Value_hoxzd0nsmk ) && ( fwrnkeh1om <= rtP .
Constant1_Value_nrwkmil05x ) ) ; rtB . gyfvvpphg3 = rtB . n2ct5ob2wl ; rtB .
gdygozc13m = ( ( fwrnkeh1om >= rtP . Constant2_Value ) || ( fwrnkeh1om <= rtP
. Constant3_Value ) ) ; rtB . lq04dno4oh = rtB . gdygozc13m ; rtB .
j12geqgcex = ( ( fwrnkeh1om >= rtP . Constant4_Value ) && ( fwrnkeh1om <= rtP
. Constant5_Value ) ) ; rtB . agxforlowa = rtB . j12geqgcex ; rtB .
aomo240dmp = ( boolean_T ) ( rtB . n2ct5ob2wl ^ rtDW . ome5bgj33n ^ rtB .
gdygozc13m ^ rtDW . au2rtsfkik ^ rtB . j12geqgcex ) ^ rtDW . ktje2zmdhr ; if
( rtB . aomo240dmp ) { tmp_k = rtP . Constant23_Value ; } else { tmp_k = rtDW
. bu0nq43hjp ; } rtB . hl1k3jvtug = rtP . Constant6_Value + tmp_k ; rtB .
kn5b5mjgpt = ( boolean_T ) ( ( rtB . gyfvvpphg3 != 0 ) ^ ( rtDW . jktgwyewld
!= 0 ) ^ ( rtB . lq04dno4oh != 0 ) ^ ( rtDW . pkbeapsmz3 != 0 ) ^ ( rtB .
agxforlowa != 0 ) ) ^ ( rtDW . aclmup2bmp != 0 ) ; rtB . jkihbayrji = (
uint8_T ) ( ( uint32_T ) ( uint8_T ) ( ( uint32_T ) ( uint8_T ) ( ( uint32_T
) rtP . Gain_Gain_nwocmfpvxk * rtB . agxforlowa ) + ( uint8_T ) ( ( uint32_T
) rtP . Gain1_Gain_dcquyu5zec * rtB . lq04dno4oh ) ) + rtB . gyfvvpphg3 ) ;
rtB . htuwjcxbk0 = rtP . vec_hallToPos [ rtB . jkihbayrji ] ; rtPrevAction =
rtDW . mmgy52to34 ; rtAction = - 1 ; if ( rtB . kn5b5mjgpt ) { rtAction = 0 ;
} rtDW . mmgy52to34 = rtAction ; if ( ( rtPrevAction != rtAction ) && (
rtPrevAction == 0 ) ) { ssSetBlockStateForSolverChangedAtMajorStep ( rtS ) ;
} if ( rtAction == 0 ) { rtB . dklsg5pvbb = rtDW . bpxc1e3ccx ; rtPrevAction
= ( int8_T ) ( rtB . htuwjcxbk0 - rtB . dklsg5pvbb ) ; if ( ( rtPrevAction ==
rtP . Constant8_Value_a5rnl3iohi ) || ( rtPrevAction == rtP .
Constant20_Value ) ) { rtB . gpqvhujprf = rtP . Constant24_Value ; } else {
rtB . gpqvhujprf = rtP . Constant23_Value_hao4x44ah2 ; } rtB . g1jlceech1 =
rtDW . m413xofoyi ; srUpdateBC ( rtDW . okzuukxele ) ; } rtDW . akezlsvf4r =
- 1 ; if ( rtB . kn5b5mjgpt ) { rtDW . akezlsvf4r = 0 ; rtB . m3g31sqwvs =
rtDW . nvtolofyxv ; rtB . bnw3q0x0h2 = rtDW . escn0j1ja5 ; rtB . h4eizf2njq =
rtDW . czugf3lp1i ; if ( rtP . smooth_Value ) { rtB . prh0tvfdbd = div_s16u64
( ( uint64_T ) rtP . cf_speedCoef << 2 , rtB . m3g31sqwvs ) ; } else { rtB .
prh0tvfdbd = div_s16u64 ( ( uint64_T ) rtB . iyujfsg4il << 2 , ( ( rtDW .
c03fwpj0hi + rtB . bnw3q0x0h2 ) + rtB . h4eizf2njq ) + rtB . m3g31sqwvs ) ; }
i = ( rtB . prh0tvfdbd - rtDW . jivyloy3yi ) >> 2 ; if ( i < 0 ) { i = - i ;
} rtB . aphubgpj5g = rtDW . hyx42rdc0g ; rtB . oia2g23wpz = rtDW . icooovlxpv
; rtDW . agy30vsbxo = ( ( i >= rtP . dz_cntTrnsDetHi ) || ( ( i > rtP .
dz_cntTrnsDetLo ) && rtDW . agy30vsbxo ) ) ; if ( rtDW . agy30vsbxo ) { rtB .
dttoav0moq = rtP . dz_cntTrnsDet_YOn ; } else { rtB . dttoav0moq = rtP .
dz_cntTrnsDet_YOff ; } rtB . asc45ue45v = ( ( uint8_T ) ( ( uint32_T ) (
uint8_T ) ( ( uint32_T ) ( uint8_T ) ( ( uint32_T ) rtDW . dzcn1vh1zj + rtB .
aphubgpj5g ) + rtB . oia2g23wpz ) + rtB . dttoav0moq ) >= rtP .
CompareToConstant_const_opnhp32m4z ) ; rtB . cy0dyuedjp = ( rtB . gpqvhujprf
!= rtB . g1jlceech1 ) ; if ( rtB . cy0dyuedjp && rtDW . hbqzn53x3b ) {
jpmxaxsrtg = rtP . Constant4_Value_g5tdqfpf0h ; } else if ( rtB . cy0dyuedjp
) { jpmxaxsrtg = rtDW . mcvoesfujc ; } else { jpmxaxsrtg = rtB . prh0tvfdbd ;
} rtB . hfzboalwag = ( int16_T ) ( jpmxaxsrtg * rtB . gpqvhujprf ) ;
srUpdateBC ( rtDW . adbs0iqmbq ) ; } if ( rtB . gpqvhujprf == rtP .
Constant16_Value ) { rtB . g3gfwjxxix = rtB . htuwjcxbk0 ; } else { rtB .
g3gfwjxxix = ( int8_T ) ( rtB . htuwjcxbk0 + rtP . Constant2_Value_bvzbygmfek
) ; } rtB . irm414lix3 = ( int16_T ) ( ( ( int16_T ) ( div_s16u64 ( (
uint64_T ) muIntScalarMin_uint32 ( rtB . hl1k3jvtug , rtB . m3g31sqwvs ) <<
14 , rtB . m3g31sqwvs ) * rtB . gpqvhujprf ) + ( rtB . g3gfwjxxix << 14 ) )
>> 2 ) ; if ( rtB . hl1k3jvtug >= rtP . i_hall_count_max ) { rtB . i03w3s4gvi
= rtP . Constant4_Value_nwbm45bej2 ; } else { rtB . i03w3s4gvi = rtB .
hfzboalwag ; } if ( rtB . i03w3s4gvi < 0 ) { rtB . hav1bb2xr5 = ( int16_T ) -
rtB . i03w3s4gvi ; } else { rtB . hav1bb2xr5 = rtB . i03w3s4gvi ; } rtDW .
nvwhihmuxi = - 1 ; if ( rtB . kn5b5mjgpt ) { rtDW . nvwhihmuxi = 0 ; rtB .
bicv1bgkwt = rtDW . a1b24cmuov ; rtB . o0dr2mdulx = rtDW . d2llyw4aei ; rtDW
. nqb5vdyagk = ( ( rtB . hav1bb2xr5 >= rtP . n_commDeacvHi ) || ( ( rtB .
hav1bb2xr5 > rtP . n_commAcvLo ) && rtDW . nqb5vdyagk ) ) ; if ( rtDW .
nqb5vdyagk ) { tmp = rtP . n_commDeacv_YOn ; } else { tmp = rtP .
n_commDeacv_YOff ; } rtB . bitjivs5h3 = ( uint16_T ) ( rtP . b_angleMeasEna
|| tmp ) ; rtB . g0gujplx2r = ( ( uint16_T ) ( ( uint32_T ) ( uint16_T ) ( (
uint32_T ) ( uint16_T ) ( ( uint32_T ) rtDW . b5j5pn4402 + rtB . bicv1bgkwt )
+ rtB . o0dr2mdulx ) + rtB . bitjivs5h3 ) >= rtP .
CompareToConstant_const_c30px104f3 ) ; srUpdateBC ( rtDW . c1r3arr2wv ) ; }
if ( rtP . ManualSwitch_CurrentSetting_b43dnndgpt == 1 ) { tmp = rtB .
g0gujplx2r ; } else { tmp = rtP . Constant_Value_kwwys1kvag ; } if ( tmp ) {
gyd3gek5if = rtB . irm414lix3 ; } else { gyd3gek5if = ( int16_T ) ( rtB .
g3gfwjxxix << 12 ) ; } if ( gyd3gek5if <= rtP . Constant1_Value_pbdosmlzxp )
{ gyd3gek5if = rtP . Constant1_Value_pbdosmlzxp ; } jpmxaxsrtg = ( int16_T )
( ( ( rtP . a_elecDeltaAngle * gyd3gek5if ) >> 18 ) + rtP . i_hall_offset ) ;
if ( rtP . Constant1_Value_mfuu3zdpmt == 0 ) { rtB . hyvw3g0pr4 = jpmxaxsrtg
; } else { rtB . hyvw3g0pr4 = ( int16_T ) ( jpmxaxsrtg - ( int16_T ) (
div_s16s32_floor ( jpmxaxsrtg , rtP . Constant1_Value_mfuu3zdpmt ) * rtP .
Constant1_Value_mfuu3zdpmt ) ) ; } fwrnkeh1om = muDoubleScalarFloor ( rtP .
Gain_Gain * muDoubleScalarMod ( fazx42jmnu , rtP . Constant1_Value ) ) ; if (
muDoubleScalarIsNaN ( fwrnkeh1om ) || muDoubleScalarIsInf ( fwrnkeh1om ) ) {
fwrnkeh1om = 0.0 ; } else { fwrnkeh1om = muDoubleScalarRem ( fwrnkeh1om ,
65536.0 ) ; } rtB . c5xoayxq5h = ( uint16_T ) ( fwrnkeh1om < 0.0 ? ( int32_T
) ( uint16_T ) - ( int16_T ) ( uint16_T ) - fwrnkeh1om : ( int32_T ) (
uint16_T ) fwrnkeh1om ) ; if ( rtP . hall_motor_speed_choice_CurrentSetting
== 1 ) { rtB . fm3w14hvds = rtB . i03w3s4gvi ; } else { rtB . fm3w14hvds =
rtB . neyktewlh5 ; } if ( rtB . fm3w14hvds < 0 ) { bztotrrun4 = ( uint16_T )
( ( uint32_T ) ( uint16_T ) - rtB . fm3w14hvds >> 2 ) ; } else { bztotrrun4 =
( uint16_T ) ( ( uint32_T ) ( uint16_T ) rtB . fm3w14hvds >> 2 ) ; } if ( rtB
. g0gujplx2r ) { rtB . ckpag1ejut = rtP . ctrl_mode_Value ; } else { rtB .
ckpag1ejut = rtP . OPEN_MODE ; } rtB . dhnxtiktvh = ( ( rtB . nfuvtrnjsl >
rtP . CompareToConstant_const ) && rtP . motor_enable_Value ) ; if ( rtP .
b_fieldWeakEna ) { if ( rtB . nfuvtrnjsl < 0 ) { gyd3gek5if = ( int16_T ) -
rtB . nfuvtrnjsl ; } else { gyd3gek5if = rtB . nfuvtrnjsl ; } if ( (
bztotrrun4 << 4 ) > rtP . n_fieldWeakAuthHi ) { bztotrrun4 = ( uint16_T ) (
rtP . n_fieldWeakAuthHi >> 4 ) ; } else { if ( ( bztotrrun4 << 4 ) < rtP .
n_fieldWeakAuthLo ) { bztotrrun4 = ( uint16_T ) ( rtP . n_fieldWeakAuthLo >>
4 ) ; } } if ( ( gyd3gek5if << 2 ) > rtP . r_fieldWeakHi ) { gyd3gek5if = (
int16_T ) ( rtP . r_fieldWeakHi >> 2 ) ; } else { if ( ( gyd3gek5if << 2 ) <
rtP . r_fieldWeakLo ) { gyd3gek5if = ( int16_T ) ( rtP . r_fieldWeakLo >> 2 )
; } } tmp_f = ( int64_T ) ( int16_T ) ( ( ( gyd3gek5if << 2 ) - rtP .
r_fieldWeakLo ) >> 2 ) << 17 ; tmp_c = ( int64_T ) ( uint16_T ) ( ( (
bztotrrun4 << 4 ) - rtP . n_fieldWeakAuthLo ) >> 4 ) << 19 ; rtB . j2g21zcr5b
= ( int16_T ) ( ( ( uint16_T ) ( ( ( uint32_T ) ( uint16_T ) ( rtB .
pi2ii4ufwm == 0LL ? tmp_f >= 0LL ? MAX_int64_T : MIN_int64_T : tmp_f / rtB .
pi2ii4ufwm ) * ( uint16_T ) ( rtB . hpir1kphxx == 0LL ? tmp_c >= 0LL ?
MAX_int64_T : MIN_int64_T : tmp_c / rtB . hpir1kphxx ) ) >> 15 ) * rtP .
id_fieldWeakMax ) >> 16 ) ; srUpdateBC ( rtDW . emjuqt1mza ) ; } if ( rtB .
ckpag1ejut == 2 ) { srUpdateBC ( rtDW . grldzuufc2 ) ; } else { if ( rtB .
ckpag1ejut == 0 ) { if ( ! rtB . dhnxtiktvh ) { rtB . iz1n4yrey2 = rtP .
Constant_Value_afpjfy0ltl ; srUpdateBC ( rtDW . lincvc42bd ) ; } else {
gyd3gek5if = ( int16_T ) ( ( ( int16_T ) ( ( rtP . Gain_Gain_b3km5qa3ir * rtB
. nfuvtrnjsl ) >> 1 ) * rtP . a_rpm_step ) >> 14 ) ; if ( gyd3gek5if > rtP .
i_Udc ) { rtB . iz1n4yrey2 = rtP . i_Udc ; } else { if ( rtB . nfuvtrnjsl >
rtP . Switch_Threshold_pf1zwyimv5 ) { jpmxaxsrtg = rtP .
min_start_voltage_openloop ; } else { jpmxaxsrtg = rtP .
Constant4_Value_oh2tsdggov ; } if ( gyd3gek5if < jpmxaxsrtg ) { rtB .
iz1n4yrey2 = jpmxaxsrtg ; } else { rtB . iz1n4yrey2 = gyd3gek5if ; } }
srUpdateBC ( rtDW . lufhggjfnd ) ; } srUpdateBC ( rtDW . agj4y5aysy ) ; } }
rtB . fglfzygoz5 [ 0 ] = ( int16_T ) ( ( rtP . Multiply_Gain * rtB .
jypvuvbmom [ 0 ] ) >> 12 ) ; rtB . fglfzygoz5 [ 1 ] = ( int16_T ) ( ( rtP .
Multiply_Gain * rtB . jypvuvbmom [ 1 ] ) >> 12 ) ; if ( ssIsSampleHit ( rtS ,
1 , 0 ) ) { i = ( rtP . Gain_Gain_p31gsgekrj * rtB . fglfzygoz5 [ 0 ] ) >> 13
; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i = - 32768 ;
} } rtB . gvza14twud = ( int16_T ) i ; i = rtB . fglfzygoz5 [ 0 ] + rtB .
fglfzygoz5 [ 1 ] ; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 )
{ i = - 32768 ; } } rtB . ehbpsnl1hj = ( int16_T ) ( rtP .
Constant1_Value_fm0hfw5dcj - i ) ; i = rtB . fglfzygoz5 [ 1 ] + rtB .
ehbpsnl1hj ; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i =
- 32768 ; } } ayvhk40cdk = ( int16_T ) ( ( ( ( rtB . gvza14twud - i ) >> 1 )
* rtP . Gain1_Gain_elbvr5ycds ) >> 15 ) ; if ( rtP .
hall_motor_angel_choice_CurrentSetting == 1 ) { bztotrrun4 = ( uint16_T ) rtB
. hyvw3g0pr4 ; } else { bztotrrun4 = rtB . c5xoayxq5h ; } bztotrrun4 =
plook_u16u16_evencka ( bztotrrun4 , rtP . a_elecAngle_XA [ 0 ] , ( uint16_T )
( ( uint32_T ) rtP . a_elecAngle_XA [ 1 ] - rtP . a_elecAngle_XA [ 0 ] ) ,
360U ) ; a1rdwgil3z = rtP . r_cos_M1 [ bztotrrun4 ] ; i = ( ( ( rtB .
fglfzygoz5 [ 1 ] - rtB . ehbpsnl1hj ) >> 1 ) * rtP . Gain2_Gain_jhbn4t1dyg )
>> 14 ; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i = -
32768 ; } } e1egg35odv = rtP . r_sin_M1 [ bztotrrun4 ] ; tmp_j = ( int16_T )
( ( ayvhk40cdk * rtP . r_cos_M1 [ bztotrrun4 ] ) >> 14 ) + ( int16_T ) ( ( (
int16_T ) i * rtP . r_sin_M1 [ bztotrrun4 ] ) >> 14 ) ; if ( tmp_j > 32767 )
{ tmp_j = 32767 ; } else { if ( tmp_j < - 32768 ) { tmp_j = - 32768 ; } }
bo15wrlfwn = ( int16_T ) tmp_j ; i = ( int16_T ) ( ( ( int16_T ) i * rtP .
r_cos_M1 [ bztotrrun4 ] ) >> 14 ) - ( int16_T ) ( ( ayvhk40cdk * rtP .
r_sin_M1 [ bztotrrun4 ] ) >> 14 ) ; if ( i > 32767 ) { i = 32767 ; } else {
if ( i < - 32768 ) { i = - 32768 ; } } ocdwfzxb2r = ( int16_T ) i ;
cpoajd5uh0 ( bo15wrlfwn , ocdwfzxb2r , rtP . f_lpf_coeff , & rtB .
cpoajd5uh02 , & rtDW . cpoajd5uh02 ) ; ayvhk40cdk = rtDW . buptq5b3lk ;
doltjf0iws = ( int16_T ) ( ( int16_T ) ( ( ( int16_T ) ( ( rtDW . buptq5b3lk
* rtB . pywty24jlk ) >> 9 ) * rtB . cpoajd5uh02 . htqonzvdzb [ 0 ] ) >> 10 )
+ ( int16_T ) ( ( ( int16_T ) ( ( rtDW . myc2dris0z * rtB . pywty24jlk ) >> 9
) * rtB . cpoajd5uh02 . htqonzvdzb [ 1 ] ) >> 10 ) ) ; meo3xsl5lq (
doltjf0iws , rtP . Constant1_Value_bgqlwtwk4z , & rtB . meo3xsl5lqf , & rtDW
. meo3xsl5lqf ) ; tmp_f = ( int64_T ) rtB . j2g21zcr5b << 17 ; tmp_f = rtP .
i_dc_limit_Value == 0LL ? tmp_f >= 0LL ? MAX_int64_T : MIN_int64_T : tmp_f /
rtP . i_dc_limit_Value ; if ( tmp_f < 0LL ) { tmp_f = 0LL ; } else { if (
tmp_f > 65535LL ) { tmp_f = 65535LL ; } } rtB . dcimgobmd0 = ( int16_T ) ( (
rtP . iq_maxSca_M1 [ plook_u8u16_evencka ( ( uint16_T ) tmp_f , rtP .
iq_maxSca_XA [ 0 ] , ( uint16_T ) ( ( uint32_T ) rtP . iq_maxSca_XA [ 1 ] -
rtP . iq_maxSca_XA [ 0 ] ) , 49U ) ] * rtP . i_dc_limit_Value ) >> 17 ) ; i =
rtP . Gain1_Gain_fqealp2cnm * rtB . dcimgobmd0 ; rtB . k203swwpuy = ( int16_T
) ( ( ( i < 0 ? 63 : 0 ) + i ) >> 6 ) ; if ( rtB . ckpag1ejut != 0 ) { rtB .
ormfoxg3ds = rtP . Constant2_Value_lpzpzwglez ; } else { rtB . ormfoxg3ds =
rtP . Constant1_Value_ot4nebnjcg ; } } if ( ssIsSampleHit ( rtS , 3 , 0 ) ) {
rtPrevAction = rtDW . nwulawgmpz ; rtAction = - 1 ; if ( rtB . ormfoxg3ds ==
1 ) { rtAction = 0 ; } rtDW . nwulawgmpz = rtAction ; if ( ( rtPrevAction !=
rtAction ) && ( rtPrevAction == 0 ) ) {
ssSetBlockStateForSolverChangedAtMajorStep ( rtS ) ; } if ( rtAction == 0 ) {
if ( rtB . nfuvtrnjsl > rtP . speed_limit_Value ) { jpmxaxsrtg = rtP .
speed_limit_Value ; } else if ( rtB . nfuvtrnjsl < rtP .
Constant5_Value_hukixlpixn ) { jpmxaxsrtg = rtP . Constant5_Value_hukixlpixn
; } else { jpmxaxsrtg = rtB . nfuvtrnjsl ; } rtB . dr11tqhixq = ( int16_T ) (
jpmxaxsrtg - rtB . fm3w14hvds ) ; fdz4phu3ry ( rtB . dr11tqhixq , rtP .
Constant_Value_fmokpqnlpw , rtP . Constant1_Value_i3felecbvz , rtP .
Constant11_Value , rtB . dcimgobmd0 , rtB . k203swwpuy , rtP .
Constant2_Value_ld1sjzzy1n , rtB . ormfoxg3ds , & rtB . fdz4phu3ryu , & rtDW
. fdz4phu3ryu , & rtPrevZCX . fdz4phu3ryu ) ; srUpdateBC ( rtDW . etrlwpgbmn
) ; } if ( rtP . ManualSwitch_CurrentSetting == 1 ) { rtB . nceu43w1ix = rtB
. fdz4phu3ryu . mrsm1mogfj ; } else { rtB . nceu43w1ix = rtP .
Constant_Value_gruv4kmzc0 ; } } if ( ssIsSampleHit ( rtS , 1 , 0 ) ) { if (
ayvhk40cdk < 0 ) { ayvhk40cdk = ( int16_T ) - ayvhk40cdk ; } rtB . kth5gdtz2g
= rtP . Vq_max_M1 [ plook_u16s16_evencka ( ayvhk40cdk , rtP . Vq_max_XA [ 0 ]
, ( uint16_T ) ( rtP . Vq_max_XA [ 1 ] - rtP . Vq_max_XA [ 0 ] ) , 45U ) ] ;
i = rtP . Gain5_Gain * rtB . kth5gdtz2g ; rtB . jot1xj131p = ( int16_T ) ( (
( i < 0 ? 63 : 0 ) + i ) >> 6 ) ; } if ( ssIsSampleHit ( rtS , 2 , 0 ) ) {
rtPrevAction = rtDW . b4mhrctptb ; rtAction = - 1 ; if ( rtB . ormfoxg3ds ==
1 ) { rtAction = 0 ; } rtDW . b4mhrctptb = rtAction ; if ( ( rtPrevAction !=
rtAction ) && ( rtPrevAction == 0 ) ) {
ssSetBlockStateForSolverChangedAtMajorStep ( rtS ) ; } if ( rtAction == 0 ) {
if ( rtB . j2g21zcr5b > rtB . j0kbkxugjw ) { jpmxaxsrtg = rtB . j0kbkxugjw ;
} else if ( rtB . j2g21zcr5b < rtB . hgv1cfpui3 ) { jpmxaxsrtg = rtB .
hgv1cfpui3 ; } else { jpmxaxsrtg = rtB . j2g21zcr5b ; } rtB . ifs0c0epvr = (
int16_T ) ( jpmxaxsrtg - rtB . cpoajd5uh02 . htqonzvdzb [ 0 ] ) ; n30etil1yv
( rtB . ifs0c0epvr , rtP . Constant3_Value_cktpavq45n , rtP .
Constant4_Value_meuudjocpu , rtP . Constant6_Value_plm5mh4hzr , rtP . Vd_max
, rtB . keyifcwses , rtP . Constant9_Value , & rtB . n30etil1yvr , & rtDW .
n30etil1yvr ) ; srUpdateBC ( rtDW . fy2xh4lnkj ) ; } rtPrevAction = rtDW .
hsdsrre1ez ; rtAction = - 1 ; if ( rtB . ormfoxg3ds == 1 ) { rtAction = 0 ; }
rtDW . hsdsrre1ez = rtAction ; if ( ( rtPrevAction != rtAction ) && (
rtPrevAction == 0 ) ) { ssSetBlockStateForSolverChangedAtMajorStep ( rtS ) ;
} if ( rtAction == 0 ) { if ( rtB . nceu43w1ix > rtB . dcimgobmd0 ) {
jpmxaxsrtg = rtB . dcimgobmd0 ; } else if ( rtB . nceu43w1ix < rtB .
k203swwpuy ) { jpmxaxsrtg = rtB . k203swwpuy ; } else { jpmxaxsrtg = rtB .
nceu43w1ix ; } rtB . kkpembvzgm = ( int16_T ) ( jpmxaxsrtg - rtB .
cpoajd5uh02 . htqonzvdzb [ 1 ] ) ; pubdfj1edp ( rtB . kkpembvzgm , rtP .
Constant7_Value , rtP . Constant8_Value , rtP . Constant1_Value_n1mqsrpxk5 ,
rtB . kth5gdtz2g , rtB . jot1xj131p , rtP . Constant3_Value_iim4kqaacm , &
rtB . pubdfj1edpf , & rtDW . pubdfj1edpf ) ; srUpdateBC ( rtDW . jllb4crr4l )
; } } if ( ssIsSampleHit ( rtS , 1 , 0 ) ) { if ( rtB . ckpag1ejut != 0 ) {
rtB . kwfu3n45l5 = rtB . n30etil1yvr . n4j2qb3der ; rtB . pw2awuefim = rtB .
pubdfj1edpf . fsq15efoh5 ; } else { rtB . kwfu3n45l5 = rtP .
Constant3_Value_lp4igfeqm2 ; rtB . pw2awuefim = rtB . iz1n4yrey2 ; } i = (
int16_T ) ( ( rtB . kwfu3n45l5 * e1egg35odv ) >> 14 ) + ( int16_T ) ( ( rtB .
pw2awuefim * a1rdwgil3z ) >> 14 ) ; if ( i > 32767 ) { i = 32767 ; } else {
if ( i < - 32768 ) { i = - 32768 ; } } jpmxaxsrtg = ( int16_T ) ( ( rtP .
Constant_Value_lawquwqtq3 * ( int16_T ) i ) >> 10 ) ; ayvhk40cdk = ( int16_T
) ( ( ( int16_T ) ( ( rtP . Constant4_Value_eo5zsifiwc * jpmxaxsrtg ) >> 14 )
* rtB . pemdc1ds0q ) >> 10 ) ; tmp_j = ( int16_T ) ( ( rtB . kwfu3n45l5 *
a1rdwgil3z ) >> 14 ) - ( int16_T ) ( ( rtB . pw2awuefim * e1egg35odv ) >> 14
) ; if ( tmp_j > 32767 ) { tmp_j = 32767 ; } else { if ( tmp_j < - 32768 ) {
tmp_j = - 32768 ; } } e1egg35odv = ( int16_T ) ( ( rtP .
Constant1_Value_cn31ybre3o * ( int16_T ) tmp_j ) >> 10 ) ; jpmxaxsrtg = (
int16_T ) ( ( rtP . Constant2_Value_j0nafyqrpv * jpmxaxsrtg ) >> 12 ) ;
a1rdwgil3z = ( int16_T ) ( ( ( ( e1egg35odv + jpmxaxsrtg ) >> 1 ) * rtB .
pemdc1ds0q ) >> 11 ) ; jpmxaxsrtg = ( int16_T ) ( ( ( ( jpmxaxsrtg -
e1egg35odv ) >> 1 ) * rtB . pemdc1ds0q ) >> 11 ) ; e1egg35odv = ( int16_T ) (
( rtP . Constant3_Value_nqkf541o1m * ( int16_T ) i ) >> 10 ) ; if ( ( int16_T
) i >= 0 ) { if ( ( int16_T ) tmp_j >= 0 ) { if ( e1egg35odv > ( ( int16_T )
tmp_j << 2 ) ) { cv0l4vqzrl = 2U ; } else { cv0l4vqzrl = 1U ; } } else { i =
- e1egg35odv ; if ( - e1egg35odv > 32767 ) { i = 32767 ; } if ( i > ( (
int16_T ) tmp_j << 2 ) ) { cv0l4vqzrl = 3U ; } else { cv0l4vqzrl = 2U ; } } }
else if ( ( int16_T ) tmp_j >= 0 ) { i = - e1egg35odv ; if ( - e1egg35odv >
32767 ) { i = 32767 ; } if ( i > ( ( int16_T ) tmp_j << 2 ) ) { cv0l4vqzrl =
5U ; } else { cv0l4vqzrl = 6U ; } } else if ( e1egg35odv > ( ( int16_T )
tmp_j << 2 ) ) { cv0l4vqzrl = 4U ; } else { cv0l4vqzrl = 5U ; } switch ( (
int8_T ) cv0l4vqzrl ) { case 1 : i = - jpmxaxsrtg ; if ( - jpmxaxsrtg > 32767
) { i = 32767 ; } tmp_j = rtB . dui4igmu1s - ( int16_T ) i ; if ( tmp_j >
32767 ) { tmp_j = 32767 ; } else { if ( tmp_j < - 32768 ) { tmp_j = - 32768 ;
} } tmp_j -= ayvhk40cdk ; if ( tmp_j > 32767 ) { tmp_j = 32767 ; } else { if
( tmp_j < - 32768 ) { tmp_j = - 32768 ; } } gyd3gek5if = ( int16_T )
muDoubleScalarRound ( ( real_T ) tmp_j / 4.0 ) ; e1egg35odv = ( int16_T ) ( (
int32_T ) muDoubleScalarRound ( ( real_T ) ayvhk40cdk / 2.0 ) + gyd3gek5if )
; i = ( int32_T ) muDoubleScalarRound ( ( real_T ) ( int16_T ) i / 2.0 ) +
e1egg35odv ; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i =
- 32768 ; } } a1rdwgil3z = ( int16_T ) i ; break ; case 2 : i = rtB .
dui4igmu1s - a1rdwgil3z ; if ( i > 32767 ) { i = 32767 ; } else { if ( i < -
32768 ) { i = - 32768 ; } } i -= jpmxaxsrtg ; if ( i > 32767 ) { i = 32767 ;
} else { if ( i < - 32768 ) { i = - 32768 ; } } gyd3gek5if = ( int16_T )
muDoubleScalarRound ( ( real_T ) i / 4.0 ) ; a1rdwgil3z = ( int16_T ) ( (
int32_T ) muDoubleScalarRound ( ( real_T ) a1rdwgil3z / 2.0 ) + gyd3gek5if )
; i = ( int32_T ) muDoubleScalarRound ( ( real_T ) jpmxaxsrtg / 2.0 ) +
a1rdwgil3z ; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i =
- 32768 ; } } e1egg35odv = ( int16_T ) i ; break ; case 3 : i = - a1rdwgil3z
; if ( - a1rdwgil3z > 32767 ) { i = 32767 ; } tmp_j = rtB . dui4igmu1s -
ayvhk40cdk ; if ( tmp_j > 32767 ) { tmp_j = 32767 ; } else { if ( tmp_j < -
32768 ) { tmp_j = - 32768 ; } } tmp_j -= ( int16_T ) i ; if ( tmp_j > 32767 )
{ tmp_j = 32767 ; } else { if ( tmp_j < - 32768 ) { tmp_j = - 32768 ; } }
a1rdwgil3z = ( int16_T ) muDoubleScalarRound ( ( real_T ) tmp_j / 4.0 ) ;
gyd3gek5if = ( int16_T ) ( ( int32_T ) muDoubleScalarRound ( ( real_T ) (
int16_T ) i / 2.0 ) + a1rdwgil3z ) ; i = ( int32_T ) muDoubleScalarRound ( (
real_T ) ayvhk40cdk / 2.0 ) + gyd3gek5if ; if ( i > 32767 ) { i = 32767 ; }
else { if ( i < - 32768 ) { i = - 32768 ; } } e1egg35odv = ( int16_T ) i ;
break ; case 4 : i = - ayvhk40cdk ; if ( - ayvhk40cdk > 32767 ) { i = 32767 ;
} tmp_j = rtB . dui4igmu1s - ( int16_T ) i ; if ( tmp_j > 32767 ) { tmp_j =
32767 ; } else { if ( tmp_j < - 32768 ) { tmp_j = - 32768 ; } } tmp_j -=
jpmxaxsrtg ; if ( tmp_j > 32767 ) { tmp_j = 32767 ; } else { if ( tmp_j < -
32768 ) { tmp_j = - 32768 ; } } a1rdwgil3z = ( int16_T ) muDoubleScalarRound
( ( real_T ) tmp_j / 4.0 ) ; e1egg35odv = ( int16_T ) ( ( int32_T )
muDoubleScalarRound ( ( real_T ) jpmxaxsrtg / 2.0 ) + a1rdwgil3z ) ; i = (
int32_T ) muDoubleScalarRound ( ( real_T ) ( int16_T ) i / 2.0 ) + e1egg35odv
; if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i = - 32768 ;
} } gyd3gek5if = ( int16_T ) i ; break ; case 5 : i = - a1rdwgil3z ; if ( -
a1rdwgil3z > 32767 ) { i = 32767 ; } tmp_j = - jpmxaxsrtg ; if ( - jpmxaxsrtg
> 32767 ) { tmp_j = 32767 ; } tmp_g = rtB . dui4igmu1s - ( int16_T ) i ; if (
tmp_g > 32767 ) { tmp_g = 32767 ; } else { if ( tmp_g < - 32768 ) { tmp_g = -
32768 ; } } tmp_g -= ( int16_T ) tmp_j ; if ( tmp_g > 32767 ) { tmp_g = 32767
; } else { if ( tmp_g < - 32768 ) { tmp_g = - 32768 ; } } e1egg35odv = (
int16_T ) muDoubleScalarRound ( ( real_T ) tmp_g / 4.0 ) ; a1rdwgil3z = (
int16_T ) ( ( int32_T ) muDoubleScalarRound ( ( real_T ) ( int16_T ) tmp_j /
2.0 ) + e1egg35odv ) ; i = ( int32_T ) muDoubleScalarRound ( ( real_T ) (
int16_T ) i / 2.0 ) + a1rdwgil3z ; if ( i > 32767 ) { i = 32767 ; } else { if
( i < - 32768 ) { i = - 32768 ; } } gyd3gek5if = ( int16_T ) i ; break ;
default : i = - ayvhk40cdk ; if ( - ayvhk40cdk > 32767 ) { i = 32767 ; }
tmp_j = rtB . dui4igmu1s - a1rdwgil3z ; if ( tmp_j > 32767 ) { tmp_j = 32767
; } else { if ( tmp_j < - 32768 ) { tmp_j = - 32768 ; } } tmp_j -= ( int16_T
) i ; if ( tmp_j > 32767 ) { tmp_j = 32767 ; } else { if ( tmp_j < - 32768 )
{ tmp_j = - 32768 ; } } e1egg35odv = ( int16_T ) muDoubleScalarRound ( (
real_T ) tmp_j / 4.0 ) ; gyd3gek5if = ( int16_T ) ( ( int32_T )
muDoubleScalarRound ( ( real_T ) ( int16_T ) i / 2.0 ) + e1egg35odv ) ; i = (
int32_T ) muDoubleScalarRound ( ( real_T ) a1rdwgil3z / 2.0 ) + gyd3gek5if ;
if ( i > 32767 ) { i = 32767 ; } else { if ( i < - 32768 ) { i = - 32768 ; }
} a1rdwgil3z = ( int16_T ) i ; break ; } if ( a1rdwgil3z > rtP .
i_half_pwm_count ) { rtB . mgmfyffcon [ 0 ] = rtP . i_half_pwm_count ; } else
if ( a1rdwgil3z < rtP . Constant5_Value_axszy5sgp5 ) { rtB . mgmfyffcon [ 0 ]
= rtP . Constant5_Value_axszy5sgp5 ; } else { rtB . mgmfyffcon [ 0 ] = (
uint16_T ) a1rdwgil3z ; } if ( e1egg35odv > rtP . i_half_pwm_count ) { rtB .
mgmfyffcon [ 1 ] = rtP . i_half_pwm_count ; } else if ( e1egg35odv < rtP .
Constant5_Value_axszy5sgp5 ) { rtB . mgmfyffcon [ 1 ] = rtP .
Constant5_Value_axszy5sgp5 ; } else { rtB . mgmfyffcon [ 1 ] = ( uint16_T )
e1egg35odv ; } if ( gyd3gek5if > rtP . i_half_pwm_count ) { rtB . mgmfyffcon
[ 2 ] = rtP . i_half_pwm_count ; } else if ( gyd3gek5if < rtP .
Constant5_Value_axszy5sgp5 ) { rtB . mgmfyffcon [ 2 ] = rtP .
Constant5_Value_axszy5sgp5 ; } else { rtB . mgmfyffcon [ 2 ] = ( uint16_T )
gyd3gek5if ; } switch ( cv0l4vqzrl ) { case 1 : rtB . iai2mktnen [ 0 ] = rtB
. mgmfyffcon [ 0 ] ; rtB . iai2mktnen [ 1 ] = rtB . mgmfyffcon [ 1 ] ; rtB .
iai2mktnen [ 2 ] = rtB . mgmfyffcon [ 2 ] ; break ; case 2 : rtB . iai2mktnen
[ 0 ] = rtB . mgmfyffcon [ 1 ] ; rtB . iai2mktnen [ 1 ] = rtB . mgmfyffcon [
0 ] ; rtB . iai2mktnen [ 2 ] = rtB . mgmfyffcon [ 2 ] ; break ; case 3 : rtB
. iai2mktnen [ 0 ] = rtB . mgmfyffcon [ 1 ] ; rtB . iai2mktnen [ 1 ] = rtB .
mgmfyffcon [ 2 ] ; rtB . iai2mktnen [ 2 ] = rtB . mgmfyffcon [ 0 ] ; break ;
case 4 : rtB . iai2mktnen [ 0 ] = rtB . mgmfyffcon [ 2 ] ; rtB . iai2mktnen [
1 ] = rtB . mgmfyffcon [ 1 ] ; rtB . iai2mktnen [ 2 ] = rtB . mgmfyffcon [ 0
] ; break ; case 5 : rtB . iai2mktnen [ 0 ] = rtB . mgmfyffcon [ 2 ] ; rtB .
iai2mktnen [ 1 ] = rtB . mgmfyffcon [ 0 ] ; rtB . iai2mktnen [ 2 ] = rtB .
mgmfyffcon [ 1 ] ; break ; default : rtB . iai2mktnen [ 0 ] = rtB .
mgmfyffcon [ 0 ] ; rtB . iai2mktnen [ 1 ] = rtB . mgmfyffcon [ 2 ] ; rtB .
iai2mktnen [ 2 ] = rtB . mgmfyffcon [ 1 ] ; break ; } b1d41tupsk ( rtB .
iai2mktnen [ 0 ] , rtB . iai2mktnen [ 1 ] , cv0l4vqzrl , rtP .
i_half_pwm_count , rtP . i_adc , rtP . i_dead , rtP . i_sample_before , & rtB
. j1khybhwff ) ; rtB . g2aizzghv3 = rtP . Gain6_Gain * rtB . j1khybhwff .
l1s3iblud2 ; } { if ( rtDW . nqodwfxjjo . AQHandles && ssGetLogOutput ( rtS )
) { sdiWriteSignal ( rtDW . nqodwfxjjo . AQHandles , ssGetTaskTime ( rtS , 1
) , ( char * ) & rtB . j1khybhwff . l1s3iblud2 + 0 ) ; } } rtB . cmokv1niht =
rtDW . aq020iueee ; rtB . mabcey02v2 = ( rtB . hr0ijokt1h >= rtB . cmokv1niht
) ; if ( rtB . mabcey02v2 && ( rtPrevZCX . kxdrhb2qez != 1 ) ) { ow4zjx1n21 (
rtB . iairrjrsnt [ 0 ] , rtB . iairrjrsnt [ 1 ] , rtB . iairrjrsnt [ 2 ] ,
rtB . j1khybhwff . l1s3iblud2 , & rtB . n0gksqxwn5 ) ; rtDW . fbfx01uq0n =
rtB . n0gksqxwn5 . jh44athpdt ; rtDW . h5tuq0lorh = rtB . n0gksqxwn5 .
cusnr13h0o ; rtB . ozks1puxeq [ 0 ] = rtDW . fbfx01uq0n ; rtB . ozks1puxeq [
1 ] = rtDW . h5tuq0lorh ; rtDW . o15rhlrdvu = 4 ; } rtPrevZCX . kxdrhb2qez =
rtB . mabcey02v2 ; rtB . dksojetaez = rtDW . mlp4bstdwk ; rtB . a505li3yys =
( rtB . hr0ijokt1h < rtB . dksojetaez ) ; if ( ( ! rtB . a505li3yys ) && (
rtPrevZCX . kitz0vstzp != 0 ) ) { ow4zjx1n21 ( rtB . iairrjrsnt [ 0 ] , rtB .
iairrjrsnt [ 1 ] , rtB . iairrjrsnt [ 2 ] , rtB . j1khybhwff . l1s3iblud2 , &
rtB . pzgfoorf2m ) ; rtDW . jrusai53lx = rtB . pzgfoorf2m . jh44athpdt ; rtDW
. mljj1znw3o = rtB . pzgfoorf2m . cusnr13h0o ; rtB . ozks1puxeq [ 0 ] = rtDW
. jrusai53lx ; rtB . ozks1puxeq [ 1 ] = rtDW . mljj1znw3o ; rtDW . aqnsdlzrky
= 4 ; } rtPrevZCX . kitz0vstzp = rtB . a505li3yys ; rtB . ksiabedanv [ 0 ] =
rtB . lk4zjjz41c ; rtB . ksiabedanv [ 1 ] = rtB . mweesx4sey ; rtB .
ksiabedanv [ 2 ] = rtB . flinlchw1h ; rtB . ksiabedanv [ 3 ] = rtB .
pxjlxuyjb5 ; rtB . ksiabedanv [ 4 ] = rtB . o4mntq1jfd ; rtB . ksiabedanv [ 5
] = rtB . hqr0qifjoz ; rtB . g2bdghkoar = muIntScalarMin_uint32 ( rtB .
hl1k3jvtug , rtB . bpatsrsf2k ) ; UNUSED_PARAMETER ( tid ) ; } void
MdlOutputsTID4 ( int_T tid ) { int32_T tmp ; rtB . bpatsrsf2k = rtP .
i_hall_count_max ; tmp = rtP . Gain3_Gain * rtP . Vd_max ; rtB . keyifcwses =
( int16_T ) ( ( ( tmp < 0 ? 63 : 0 ) + tmp ) >> 6 ) ; rtB . j0kbkxugjw = (
int16_T ) ( rtP . i_dc_limit_Value >> 1 ) ; tmp = rtP . Gain4_Gain * rtB .
j0kbkxugjw ; rtB . hgv1cfpui3 = ( int16_T ) ( ( ( tmp < 0 ? 63 : 0 ) + tmp )
>> 6 ) ; rtB . dui4igmu1s = ( int16_T ) rtP . TS_Value ; rtB . pemdc1ds0q =
div_s16s32_floor ( ( int16_T ) rtP . TS_Value << 10 , rtP . i_Udc ) ; rtB .
pywty24jlk = div_s16s64_floor ( ( int64_T ) rtP . Constant_Value_m5qrbrxcrt
<< 20 , rtP . Gain_Gain_aibzfyynsg * rtP . i_Udc ) ; fdz4phu3ryTID4 ( rtP .
Constant4_Value_gbsmiewbbg , & rtB . fdz4phu3ryu ) ; rtB . iyujfsg4il = rtP .
g_Ha_Gain * rtP . cf_speedCoef ; rtB . hpir1kphxx = ( int16_T ) ( rtP .
n_fieldWeakAuthHi - rtP . n_fieldWeakAuthLo ) ; rtB . pi2ii4ufwm = ( int16_T
) ( rtP . r_fieldWeakHi - rtP . r_fieldWeakLo ) ; UNUSED_PARAMETER ( tid ) ;
} void MdlUpdate ( int_T tid ) { NeslSimulationData * simulationData ;
NeuDiagnosticManager * diagnosticManager ; NeuDiagnosticTree * diagnosticTree
; char * msg ; real_T tmp_p [ 24 ] ; real_T time ; int32_T i ; int32_T
idxWidth ; int_T tmp_e [ 7 ] ; boolean_T tmp ; for ( i = 0 ; i < 4 ; i ++ ) {
for ( idxWidth = 0 ; idxWidth < 6 ; idxWidth ++ ) { rtDW . oed2laixap [ i *
6U + idxWidth ] = rtDW . oed2laixap [ ( i + 1U ) * 6U + idxWidth ] ; } } for
( i = 0 ; i < 6 ; i ++ ) { rtDW . oed2laixap [ i + 24 ] = rtB . ksiabedanv [
i ] ; } rtDW . gc0xzmti13 = rtB . mgmfyffcon [ 0 ] ; rtDW . lvmiamzpyq = rtB
. mgmfyffcon [ 1 ] ; rtDW . ay1uwe1gfj = rtB . mgmfyffcon [ 2 ] ;
simulationData = ( NeslSimulationData * ) rtDW . bxdcoquy3x ; time = ssGetT (
rtS ) ; simulationData -> mData -> mTime . mN = 1 ; simulationData -> mData
-> mTime . mX = & time ; simulationData -> mData -> mContStates . mN = 0 ;
simulationData -> mData -> mContStates . mX = NULL ; simulationData -> mData
-> mDiscStates . mN = 24 ; simulationData -> mData -> mDiscStates . mX = &
rtDW . keiuwklhbp [ 0 ] ; simulationData -> mData -> mModeVector . mN = 20 ;
simulationData -> mData -> mModeVector . mX = & rtDW . ckqpu5xkdu [ 0 ] ; tmp
= false ; simulationData -> mData -> mFoundZcEvents = tmp ; simulationData ->
mData -> mIsMajorTimeStep = true ; tmp = ( ssGetMdlInfoPtr ( rtS ) ->
mdlFlags . solverAssertCheck == 1U ) ; simulationData -> mData ->
mIsSolverAssertCheck = tmp ; simulationData -> mData -> mIsSolverCheckingCIC
= false ; simulationData -> mData -> mIsComputingJacobian = false ;
simulationData -> mData -> mIsEvaluatingF0 = false ; simulationData -> mData
-> mIsSolverRequestingReset = false ; tmp_e [ 0 ] = 0 ; tmp_p [ 0 ] = rtB .
n55agx45bu [ 0 ] ; tmp_p [ 1 ] = rtB . n55agx45bu [ 1 ] ; tmp_p [ 2 ] = rtB .
n55agx45bu [ 2 ] ; tmp_p [ 3 ] = rtB . n55agx45bu [ 3 ] ; tmp_e [ 1 ] = 4 ;
tmp_p [ 4 ] = rtB . lfc51tobdb [ 0 ] ; tmp_p [ 5 ] = rtB . lfc51tobdb [ 1 ] ;
tmp_p [ 6 ] = rtB . lfc51tobdb [ 2 ] ; tmp_p [ 7 ] = rtB . lfc51tobdb [ 3 ] ;
tmp_e [ 2 ] = 8 ; tmp_p [ 8 ] = rtB . fiygwmgxli [ 0 ] ; tmp_p [ 9 ] = rtB .
fiygwmgxli [ 1 ] ; tmp_p [ 10 ] = rtB . fiygwmgxli [ 2 ] ; tmp_p [ 11 ] = rtB
. fiygwmgxli [ 3 ] ; tmp_e [ 3 ] = 12 ; tmp_p [ 12 ] = rtB . hrn0vza32l [ 0 ]
; tmp_p [ 13 ] = rtB . hrn0vza32l [ 1 ] ; tmp_p [ 14 ] = rtB . hrn0vza32l [ 2
] ; tmp_p [ 15 ] = rtB . hrn0vza32l [ 3 ] ; tmp_e [ 4 ] = 16 ; tmp_p [ 16 ] =
rtB . nckbbwqwdk [ 0 ] ; tmp_p [ 17 ] = rtB . nckbbwqwdk [ 1 ] ; tmp_p [ 18 ]
= rtB . nckbbwqwdk [ 2 ] ; tmp_p [ 19 ] = rtB . nckbbwqwdk [ 3 ] ; tmp_e [ 5
] = 20 ; tmp_p [ 20 ] = rtB . ijzodrsa3j [ 0 ] ; tmp_p [ 21 ] = rtB .
ijzodrsa3j [ 1 ] ; tmp_p [ 22 ] = rtB . ijzodrsa3j [ 2 ] ; tmp_p [ 23 ] = rtB
. ijzodrsa3j [ 3 ] ; tmp_e [ 6 ] = 24 ; simulationData -> mData ->
mInputValues . mN = 24 ; simulationData -> mData -> mInputValues . mX = &
tmp_p [ 0 ] ; simulationData -> mData -> mInputOffsets . mN = 7 ;
simulationData -> mData -> mInputOffsets . mX = & tmp_e [ 0 ] ;
diagnosticManager = ( NeuDiagnosticManager * ) rtDW . hviz4et2ov ;
diagnosticTree = neu_diagnostic_manager_get_initial_tree ( diagnosticManager
) ; i = ne_simulator_method ( ( NeslSimulator * ) rtDW . an0wa2vz4w ,
NESL_SIM_UPDATE , simulationData , diagnosticManager ) ; if ( i != 0 ) { tmp
= error_buffer_is_empty ( ssGetErrorStatus ( rtS ) ) ; if ( tmp ) { msg =
rtw_diagnostics_msg ( diagnosticTree ) ; ssSetErrorStatus ( rtS , msg ) ; } }
rtDW . hvwgiwbc4a = rtB . ozks1puxeq [ 0 ] ; rtDW . pfd5dzwr30 = rtB .
ozks1puxeq [ 1 ] ; rtDW . ome5bgj33n = rtB . n2ct5ob2wl ; rtDW . au2rtsfkik =
rtB . gdygozc13m ; rtDW . ktje2zmdhr = rtB . j12geqgcex ; rtDW . bu0nq43hjp =
rtB . g2bdghkoar ; rtDW . jktgwyewld = rtB . gyfvvpphg3 ; rtDW . pkbeapsmz3 =
rtB . lq04dno4oh ; rtDW . aclmup2bmp = rtB . agxforlowa ; if ( rtDW .
mmgy52to34 == 0 ) { rtDW . bpxc1e3ccx = rtB . htuwjcxbk0 ; rtDW . m413xofoyi
= rtB . gpqvhujprf ; } rtDW . nvtolofyxv = rtB . hl1k3jvtug ; rtDW .
mcvoesfujc = rtB . hav1bb2xr5 ; if ( rtDW . akezlsvf4r == 0 ) { rtDW .
c03fwpj0hi = rtB . bnw3q0x0h2 ; rtDW . escn0j1ja5 = rtB . h4eizf2njq ; rtDW .
czugf3lp1i = rtB . m3g31sqwvs ; rtDW . jivyloy3yi = rtB . prh0tvfdbd ; rtDW .
dzcn1vh1zj = rtB . aphubgpj5g ; rtDW . hyx42rdc0g = rtB . oia2g23wpz ; rtDW .
icooovlxpv = rtB . dttoav0moq ; rtDW . hbqzn53x3b = rtB . cy0dyuedjp ; } if (
rtDW . nvwhihmuxi == 0 ) { rtDW . b5j5pn4402 = rtB . bicv1bgkwt ; rtDW .
a1b24cmuov = rtB . o0dr2mdulx ; rtDW . d2llyw4aei = rtB . bitjivs5h3 ; } if (
ssIsSampleHit ( rtS , 1 , 0 ) ) { fzuldxxrcu ( & rtB . cpoajd5uh02 , & rtDW .
cpoajd5uh02 ) ; rtDW . buptq5b3lk = rtB . kwfu3n45l5 ; rtDW . myc2dris0z =
rtB . pw2awuefim ; h0w0rxcscx ( & rtB . meo3xsl5lqf , & rtDW . meo3xsl5lqf )
; } if ( ssIsSampleHit ( rtS , 3 , 0 ) && ( rtDW . nwulawgmpz == 0 ) ) {
mnavzygiru ( & rtB . fdz4phu3ryu , & rtDW . fdz4phu3ryu ) ; } if (
ssIsSampleHit ( rtS , 2 , 0 ) ) { if ( rtDW . b4mhrctptb == 0 ) { bbjrz03vll
( & rtB . n30etil1yvr , & rtDW . n30etil1yvr ) ; } if ( rtDW . hsdsrre1ez ==
0 ) { bpx04raylq ( & rtB . pubdfj1edpf , & rtDW . pubdfj1edpf ) ; } } rtDW .
aq020iueee = rtB . j1khybhwff . gwfhlmmysn ; rtDW . mlp4bstdwk = rtB .
j1khybhwff . n1ku1hlgib ; UNUSED_PARAMETER ( tid ) ; } void MdlUpdateTID4 (
int_T tid ) { UNUSED_PARAMETER ( tid ) ; } void MdlTerminate ( void ) {
neu_destroy_diagnostic_manager ( ( NeuDiagnosticManager * ) rtDW . hviz4et2ov
) ; nesl_destroy_simulation_data ( ( NeslSimulationData * ) rtDW . bxdcoquy3x
) ; nesl_erase_simulator (
"MotorController_FOC/plant_pmsm/Solver Configuration_1" ) ;
nesl_destroy_registry ( ) ; neu_destroy_diagnostic_manager ( (
NeuDiagnosticManager * ) rtDW . ol3d3jcj0w ) ; nesl_destroy_simulation_data (
( NeslSimulationData * ) rtDW . mk5pob3hjk ) ; nesl_erase_simulator (
"MotorController_FOC/plant_pmsm/Solver Configuration_1" ) ;
nesl_destroy_registry ( ) ; rt_FREE ( rtDW . hfbpng1m5z . RSimInfoPtr ) ; {
if ( rtDW . nqodwfxjjo . AQHandles ) { sdiTerminateStreaming ( & rtDW .
nqodwfxjjo . AQHandles ) ; } } } void MdlInitializeSizes ( void ) {
ssSetNumContStates ( rtS , 0 ) ; ssSetNumY ( rtS , 0 ) ; ssSetNumU ( rtS , 0
) ; ssSetDirectFeedThrough ( rtS , 0 ) ; ssSetNumSampleTimes ( rtS , 4 ) ;
ssSetNumBlocks ( rtS , 533 ) ; ssSetNumBlockIO ( rtS , 124 ) ;
ssSetNumBlockParams ( rtS , 1490 ) ; } void MdlInitializeSampleTimes ( void )
{ ssSetSampleTime ( rtS , 0 , 0.0 ) ; ssSetSampleTime ( rtS , 1 , 5.0E-6 ) ;
ssSetSampleTime ( rtS , 2 , 5.0E-5 ) ; ssSetSampleTime ( rtS , 3 , 0.0025 ) ;
ssSetOffsetTime ( rtS , 0 , 0.0 ) ; ssSetOffsetTime ( rtS , 1 , 0.0 ) ;
ssSetOffsetTime ( rtS , 2 , 0.0 ) ; ssSetOffsetTime ( rtS , 3 , 0.0 ) ; }
void raccel_set_checksum ( ) { ssSetChecksumVal ( rtS , 0 , 2080476559U ) ;
ssSetChecksumVal ( rtS , 1 , 3124858972U ) ; ssSetChecksumVal ( rtS , 2 ,
2659875823U ) ; ssSetChecksumVal ( rtS , 3 , 2655922484U ) ; }
#if defined(_MSC_VER)
#pragma optimize( "", off )

#endif
SimStruct * raccel_register_model ( ssExecutionInfo * executionInfo ) {
static struct _ssMdlInfo mdlInfo ; ( void ) memset ( ( char * ) rtS , 0 ,
sizeof ( SimStruct ) ) ; ( void ) memset ( ( char * ) & mdlInfo , 0 , sizeof
( struct _ssMdlInfo ) ) ; ssSetMdlInfoPtr ( rtS , & mdlInfo ) ;
ssSetExecutionInfo ( rtS , executionInfo ) ; { static time_T mdlPeriod [
NSAMPLE_TIMES ] ; static time_T mdlOffset [ NSAMPLE_TIMES ] ; static time_T
mdlTaskTimes [ NSAMPLE_TIMES ] ; static int_T mdlTsMap [ NSAMPLE_TIMES ] ;
static int_T mdlSampleHits [ NSAMPLE_TIMES ] ; static boolean_T
mdlTNextWasAdjustedPtr [ NSAMPLE_TIMES ] ; static int_T mdlPerTaskSampleHits
[ NSAMPLE_TIMES * NSAMPLE_TIMES ] ; static time_T mdlTimeOfNextSampleHit [
NSAMPLE_TIMES ] ; { int_T i ; for ( i = 0 ; i < NSAMPLE_TIMES ; i ++ ) {
mdlPeriod [ i ] = 0.0 ; mdlOffset [ i ] = 0.0 ; mdlTaskTimes [ i ] = 0.0 ;
mdlTsMap [ i ] = i ; mdlSampleHits [ i ] = 1 ; } } ssSetSampleTimePtr ( rtS ,
& mdlPeriod [ 0 ] ) ; ssSetOffsetTimePtr ( rtS , & mdlOffset [ 0 ] ) ;
ssSetSampleTimeTaskIDPtr ( rtS , & mdlTsMap [ 0 ] ) ; ssSetTPtr ( rtS , &
mdlTaskTimes [ 0 ] ) ; ssSetSampleHitPtr ( rtS , & mdlSampleHits [ 0 ] ) ;
ssSetTNextWasAdjustedPtr ( rtS , & mdlTNextWasAdjustedPtr [ 0 ] ) ;
ssSetPerTaskSampleHitsPtr ( rtS , & mdlPerTaskSampleHits [ 0 ] ) ;
ssSetTimeOfNextSampleHitPtr ( rtS , & mdlTimeOfNextSampleHit [ 0 ] ) ; }
ssSetSolverMode ( rtS , SOLVER_MODE_SINGLETASKING ) ; { ssSetBlockIO ( rtS ,
( ( void * ) & rtB ) ) ; ssSetWorkSizeInBytes ( rtS , sizeof ( rtB ) ,
"BlockIO" ) ; ( void ) memset ( ( ( void * ) & rtB ) , 0 , sizeof ( B ) ) ; {
rtB . pubdfj1edpf . gefdxyy0g1 = ( 0LL ) ; } } { void * dwork = ( void * ) &
rtDW ; ssSetRootDWork ( rtS , dwork ) ; ssSetWorkSizeInBytes ( rtS , sizeof (
rtDW ) , "DWork" ) ; ( void ) memset ( dwork , 0 , sizeof ( DW ) ) ; } {
static DataTypeTransInfo dtInfo ; ( void ) memset ( ( char_T * ) & dtInfo , 0
, sizeof ( dtInfo ) ) ; ssSetModelMappingInfo ( rtS , & dtInfo ) ; dtInfo .
numDataTypes = 43 ; dtInfo . dataTypeSizes = & rtDataTypeSizes [ 0 ] ; dtInfo
. dataTypeNames = & rtDataTypeNames [ 0 ] ; dtInfo . BTransTable = &
rtBTransTable ; dtInfo . PTransTable = & rtPTransTable ; dtInfo .
dataTypeInfoTable = rtDataTypeInfoTable ; }
MotorController_FOC_InitializeDataMapInfo ( ) ; ssSetIsRapidAcceleratorActive
( rtS , true ) ; ssSetRootSS ( rtS , rtS ) ; ssSetVersion ( rtS ,
SIMSTRUCT_VERSION_LEVEL2 ) ; ssSetModelName ( rtS , "MotorController_FOC" ) ;
ssSetPath ( rtS , "MotorController_FOC" ) ; ssSetTStart ( rtS , 0.0 ) ;
ssSetTFinal ( rtS , 5.0 ) ; ssSetStepSize ( rtS , 5.0E-6 ) ;
ssSetFixedStepSize ( rtS , 5.0E-6 ) ; { static RTWLogInfo rt_DataLoggingInfo
; rt_DataLoggingInfo . loggingInterval = NULL ; ssSetRTWLogInfo ( rtS , &
rt_DataLoggingInfo ) ; } { { static int_T rt_LoggedStateWidths [ ] = { 2 , 2
, 2 , 2 , 2 , 2 , 24 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1
, 1 , 1 , 1 , 1 , 1 , 1 , 30 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2
} ; static int_T rt_LoggedStateNumDimensions [ ] = { 1 , 1 , 1 , 1 , 1 , 1 ,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1
, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 } ; static int_T
rt_LoggedStateDimensions [ ] = { 2 , 2 , 2 , 2 , 2 , 2 , 24 , 1 , 1 , 1 , 1 ,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 30 , 1 , 1 ,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 } ; static boolean_T
rt_LoggedStateIsVarDims [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; static BuiltInDTypeId
rt_LoggedStateDataTypeIds [ ] = { SS_DOUBLE , SS_DOUBLE , SS_DOUBLE ,
SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_UINT32 , SS_UINT32 ,
SS_UINT32 , SS_UINT32 , SS_UINT32 , SS_UINT16 , SS_UINT16 , SS_UINT16 ,
SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_INT8 , SS_INT8 , SS_UINT8
, SS_UINT8 , SS_UINT8 , SS_UINT8 , SS_UINT8 , SS_UINT8 , SS_BOOLEAN ,
SS_BOOLEAN , SS_BOOLEAN , SS_BOOLEAN , SS_BOOLEAN , SS_DOUBLE , SS_DOUBLE ,
SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_DOUBLE , SS_DOUBLE } ;
static int_T rt_LoggedStateComplexSignals [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; static
RTWPreprocessingFcnPtr rt_LoggingStatePreprocessingFcnPtrs [ ] = { ( NULL ) ,
( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) ,
( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) ,
( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) ,
( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) ,
( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) ,
( NULL ) , ( NULL ) , ( NULL ) , ( NULL ) } ; static const char_T *
rt_LoggedStateLabels [ ] = { "Discrete" , "Discrete" , "Discrete" ,
"Discrete" , "Discrete" , "Discrete" , "Discrete" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" } ; static const char_T *
rt_LoggedStateBlockNames [ ] = {
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/INPUT_3_1_1" ,
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/INPUT_4_1_1" ,
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/INPUT_5_1_1" ,
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/INPUT_6_1_1" ,
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/INPUT_1_1_1" ,
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/INPUT_2_1_1" ,
"MotorController_FOC/plant_pmsm/Solver\nConfiguration/EVAL_KEY/STATE_1" ,
"MotorController_FOC/HardWare/Counter/rst_Delay/UnitDelay" ,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/UnitDelay3"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay2"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay3"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay5"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Subsystem/UnitDelay2"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Subsystem/UnitDelay3"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Subsystem/UnitDelay5"
, "MotorController_FOC/PMSM_Controller/controller/UnitDelay1" ,
"MotorController_FOC/PMSM_Controller/controller/UnitDelay2" ,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/UnitDelay4"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay4"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Direction_Detection/UnitDelay2"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Direction_Detection/UnitDelay3"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Edge_Detect/Delay"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Edge_Detect/Delay1"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Edge_Detect/Delay2"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay8"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay7"
,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay6"
, "MotorController_FOC/HardWare/PWM_Generitor/DeadZone/Delay" ,
"MotorController_FOC/Edge_Detect/Delay" ,
"MotorController_FOC/Edge_Detect/Delay1" ,
"MotorController_FOC/Edge_Detect/Delay2" ,
 "MotorController_FOC/PMSM_Controller/Electrical_Speed_Estimation/Speed_Estimation/Raw_Motor_Speed_Estimation/UnitDelay1"
,
 "MotorController_FOC/PMSM_Controller/controller/speed_ctrl/speed_ctrl/PI_speed/UnitDelay"
,
 "MotorController_FOC/PMSM_Controller/controller/speed_ctrl/speed_ctrl/PI_speed/Integrator/Resettable Delay"
,
 "MotorController_FOC/PMSM_Controller/controller/ivbus_calc/Low_Pass_Filter/UnitDelay1"
,
 "MotorController_FOC/PMSM_Controller/controller/PID_Controller/id_ctrl/PI_id/Integrator/UnitDelay"
,
 "MotorController_FOC/PMSM_Controller/controller/PID_Controller/id_ctrl/PI_id/UnitDelay"
,
 "MotorController_FOC/PMSM_Controller/controller/PID_Controller/iq_ctrl/PI_iq/Integrator/UnitDelay"
,
 "MotorController_FOC/PMSM_Controller/controller/PID_Controller/iq_ctrl/PI_iq/UnitDelay"
,
 "MotorController_FOC/PMSM_Controller/controller/Clarke_Park_Transform_Forward/Low_Pass_Filter/UnitDelay1"
} ; static const char_T * rt_LoggedStateNames [ ] = { "Discrete" , "Discrete"
, "Discrete" , "Discrete" , "Discrete" , "Discrete" , "Discrete" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" ,
"DSTATE" , "DSTATE" , "DSTATE" , "DSTATE" } ; static boolean_T
rt_LoggedStateCrossMdlRef [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; static RTWLogDataTypeConvert
rt_RTWLogDataTypeConvert [ ] = { { 0 , SS_DOUBLE , SS_DOUBLE , 0 , 0 , 0 ,
1.0 , 0 , 0.0 } , { 0 , SS_DOUBLE , SS_DOUBLE , 0 , 0 , 0 , 1.0 , 0 , 0.0 } ,
{ 0 , SS_DOUBLE , SS_DOUBLE , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_DOUBLE ,
SS_DOUBLE , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_DOUBLE , SS_DOUBLE , 0 , 0
, 0 , 1.0 , 0 , 0.0 } , { 0 , SS_DOUBLE , SS_DOUBLE , 0 , 0 , 0 , 1.0 , 0 ,
0.0 } , { 0 , SS_DOUBLE , SS_DOUBLE , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 ,
SS_UINT32 , SS_UINT32 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT32 ,
SS_UINT32 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT32 , SS_UINT32 , 0 , 0
, 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT32 , SS_UINT32 , 0 , 0 , 0 , 1.0 , 0 ,
0.0 } , { 0 , SS_UINT32 , SS_UINT32 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 ,
SS_UINT16 , SS_UINT16 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT16 ,
SS_UINT16 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT16 , SS_UINT16 , 0 , 0
, 0 , 1.0 , 0 , 0.0 } , { 1 , SS_DOUBLE , SS_INT16 , 64 , 1 , 1 , 1.0 , - 4 ,
0.0 } , { 1 , SS_DOUBLE , SS_INT16 , 64 , 1 , 1 , 1.0 , - 4 , 0.0 } , { 1 ,
SS_DOUBLE , SS_INT16 , 64 , 1 , 1 , 1.0 , - 2 , 0.0 } , { 1 , SS_DOUBLE ,
SS_INT16 , 64 , 1 , 1 , 1.0 , - 2 , 0.0 } , { 0 , SS_INT8 , SS_INT8 , 0 , 0 ,
0 , 1.0 , 0 , 0.0 } , { 0 , SS_INT8 , SS_INT8 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } ,
{ 0 , SS_UINT8 , SS_UINT8 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT8 ,
SS_UINT8 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT8 , SS_UINT8 , 0 , 0 ,
0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT8 , SS_UINT8 , 0 , 0 , 0 , 1.0 , 0 , 0.0 }
, { 0 , SS_UINT8 , SS_UINT8 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_UINT8 ,
SS_UINT8 , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_BOOLEAN , SS_BOOLEAN , 0 ,
0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_BOOLEAN , SS_BOOLEAN , 0 , 0 , 0 , 1.0 , 0
, 0.0 } , { 0 , SS_BOOLEAN , SS_BOOLEAN , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 ,
SS_BOOLEAN , SS_BOOLEAN , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 0 , SS_BOOLEAN ,
SS_BOOLEAN , 0 , 0 , 0 , 1.0 , 0 , 0.0 } , { 1 , SS_DOUBLE , SS_INT32 , 64 ,
1 , 1 , 1.0 , - 8 , 0.0 } , { 1 , SS_DOUBLE , SS_INT32 , 64 , 1 , 1 , 1.0 , -
8 , 0.0 } , { 1 , SS_DOUBLE , SS_INT16 , 64 , 1 , 1 , 1.0 , - 6 , 0.0 } , { 1
, SS_DOUBLE , SS_INT32 , 64 , 1 , 1 , 1.0 , - 7 , 0.0 } , { 1 , SS_DOUBLE ,
SS_INT32 , 64 , 1 , 1 , 1.0 , - 10 , 0.0 } , { 1 , SS_DOUBLE , SS_INT64 , 64
, 1 , 1 , 1.0 , - 20 , 0.0 } , { 1 , SS_DOUBLE , SS_INT32 , 64 , 1 , 1 , 1.0
, - 10 , 0.0 } , { 1 , SS_DOUBLE , SS_INT16 , 64 , 1 , 1 , 1.0 , - 6 , 0.0 }
} ; static RTWLogSignalInfo rt_LoggedStateSignalInfo = { 40 ,
rt_LoggedStateWidths , rt_LoggedStateNumDimensions , rt_LoggedStateDimensions
, rt_LoggedStateIsVarDims , ( NULL ) , ( NULL ) , rt_LoggedStateDataTypeIds ,
rt_LoggedStateComplexSignals , ( NULL ) , rt_LoggingStatePreprocessingFcnPtrs
, { rt_LoggedStateLabels } , ( NULL ) , ( NULL ) , ( NULL ) , {
rt_LoggedStateBlockNames } , { rt_LoggedStateNames } ,
rt_LoggedStateCrossMdlRef , rt_RTWLogDataTypeConvert } ; static void *
rt_LoggedStateSignalPtrs [ 40 ] ; rtliSetLogXSignalPtrs ( ssGetRTWLogInfo (
rtS ) , ( LogSignalPtrsType ) rt_LoggedStateSignalPtrs ) ;
rtliSetLogXSignalInfo ( ssGetRTWLogInfo ( rtS ) , & rt_LoggedStateSignalInfo
) ; rt_LoggedStateSignalPtrs [ 0 ] = ( void * ) rtDW . o5kmncknbj ;
rt_LoggedStateSignalPtrs [ 1 ] = ( void * ) rtDW . crq4oiu4cs ;
rt_LoggedStateSignalPtrs [ 2 ] = ( void * ) rtDW . fyfgj2vhwy ;
rt_LoggedStateSignalPtrs [ 3 ] = ( void * ) rtDW . mpp40kgjsl ;
rt_LoggedStateSignalPtrs [ 4 ] = ( void * ) rtDW . hld2w0s3bq ;
rt_LoggedStateSignalPtrs [ 5 ] = ( void * ) rtDW . hkkcc3iipy ;
rt_LoggedStateSignalPtrs [ 6 ] = ( void * ) rtDW . keiuwklhbp ;
rt_LoggedStateSignalPtrs [ 7 ] = ( void * ) & rtDW . bu0nq43hjp ;
rt_LoggedStateSignalPtrs [ 8 ] = ( void * ) & rtDW . nvtolofyxv ;
rt_LoggedStateSignalPtrs [ 9 ] = ( void * ) & rtDW . c03fwpj0hi ;
rt_LoggedStateSignalPtrs [ 10 ] = ( void * ) & rtDW . escn0j1ja5 ;
rt_LoggedStateSignalPtrs [ 11 ] = ( void * ) & rtDW . czugf3lp1i ;
rt_LoggedStateSignalPtrs [ 12 ] = ( void * ) & rtDW . b5j5pn4402 ;
rt_LoggedStateSignalPtrs [ 13 ] = ( void * ) & rtDW . a1b24cmuov ;
rt_LoggedStateSignalPtrs [ 14 ] = ( void * ) & rtDW . d2llyw4aei ;
rt_LoggedStateSignalPtrs [ 15 ] = ( void * ) & rtDW . buptq5b3lk ;
rt_LoggedStateSignalPtrs [ 16 ] = ( void * ) & rtDW . myc2dris0z ;
rt_LoggedStateSignalPtrs [ 17 ] = ( void * ) & rtDW . mcvoesfujc ;
rt_LoggedStateSignalPtrs [ 18 ] = ( void * ) & rtDW . jivyloy3yi ;
rt_LoggedStateSignalPtrs [ 19 ] = ( void * ) & rtDW . bpxc1e3ccx ;
rt_LoggedStateSignalPtrs [ 20 ] = ( void * ) & rtDW . m413xofoyi ;
rt_LoggedStateSignalPtrs [ 21 ] = ( void * ) & rtDW . jktgwyewld ;
rt_LoggedStateSignalPtrs [ 22 ] = ( void * ) & rtDW . pkbeapsmz3 ;
rt_LoggedStateSignalPtrs [ 23 ] = ( void * ) & rtDW . aclmup2bmp ;
rt_LoggedStateSignalPtrs [ 24 ] = ( void * ) & rtDW . dzcn1vh1zj ;
rt_LoggedStateSignalPtrs [ 25 ] = ( void * ) & rtDW . hyx42rdc0g ;
rt_LoggedStateSignalPtrs [ 26 ] = ( void * ) & rtDW . icooovlxpv ;
rt_LoggedStateSignalPtrs [ 27 ] = ( void * ) rtDW . oed2laixap ;
rt_LoggedStateSignalPtrs [ 28 ] = ( void * ) & rtDW . ome5bgj33n ;
rt_LoggedStateSignalPtrs [ 29 ] = ( void * ) & rtDW . au2rtsfkik ;
rt_LoggedStateSignalPtrs [ 30 ] = ( void * ) & rtDW . ktje2zmdhr ;
rt_LoggedStateSignalPtrs [ 31 ] = ( void * ) & rtDW . hbqzn53x3b ;
rt_LoggedStateSignalPtrs [ 32 ] = ( void * ) & rtDW . fdz4phu3ryu .
aw4gkotmo1 ; rt_LoggedStateSignalPtrs [ 33 ] = ( void * ) & rtDW .
fdz4phu3ryu . dyhfef4gnd ; rt_LoggedStateSignalPtrs [ 34 ] = ( void * ) &
rtDW . meo3xsl5lqf . emwxkef0aw ; rt_LoggedStateSignalPtrs [ 35 ] = ( void *
) & rtDW . n30etil1yvr . mxzjvqfpt5 ; rt_LoggedStateSignalPtrs [ 36 ] = (
void * ) & rtDW . n30etil1yvr . mp5vh0x33p ; rt_LoggedStateSignalPtrs [ 37 ]
= ( void * ) & rtDW . pubdfj1edpf . oqy0i3di0d ; rt_LoggedStateSignalPtrs [
38 ] = ( void * ) & rtDW . pubdfj1edpf . ck2g4y21cg ;
rt_LoggedStateSignalPtrs [ 39 ] = ( void * ) rtDW . cpoajd5uh02 . bdbhhwxoih
; } rtliSetLogT ( ssGetRTWLogInfo ( rtS ) , "tout" ) ; rtliSetLogX (
ssGetRTWLogInfo ( rtS ) , "" ) ; rtliSetLogXFinal ( ssGetRTWLogInfo ( rtS ) ,
"" ) ; rtliSetLogVarNameModifier ( ssGetRTWLogInfo ( rtS ) , "none" ) ;
rtliSetLogFormat ( ssGetRTWLogInfo ( rtS ) , 4 ) ; rtliSetLogMaxRows (
ssGetRTWLogInfo ( rtS ) , 0 ) ; rtliSetLogDecimation ( ssGetRTWLogInfo ( rtS
) , 1 ) ; rtliSetLogY ( ssGetRTWLogInfo ( rtS ) , "" ) ;
rtliSetLogYSignalInfo ( ssGetRTWLogInfo ( rtS ) , ( NULL ) ) ;
rtliSetLogYSignalPtrs ( ssGetRTWLogInfo ( rtS ) , ( NULL ) ) ; } { static
struct _ssStatesInfo2 statesInfo2 ; ssSetStatesInfo2 ( rtS , & statesInfo2 )
; } { static ssPeriodicStatesInfo periodicStatesInfo ;
ssSetPeriodicStatesInfo ( rtS , & periodicStatesInfo ) ; } { static
ssJacobianPerturbationBounds jacobianPerturbationBounds ;
ssSetJacobianPerturbationBounds ( rtS , & jacobianPerturbationBounds ) ; } {
static ssSolverInfo slvrInfo ; ssSetSolverInfo ( rtS , & slvrInfo ) ;
ssSetSolverName ( rtS , "FixedStepDiscrete" ) ; ssSetVariableStepSolver ( rtS
, 0 ) ; ssSetSolverConsistencyChecking ( rtS , 0 ) ;
ssSetSolverAdaptiveZcDetection ( rtS , 0 ) ; ssSetSolverRobustResetMethod (
rtS , 0 ) ; ssSetSolverStateProjection ( rtS , 0 ) ;
ssSetSolverMassMatrixType ( rtS , ( ssMatrixType ) 0 ) ;
ssSetSolverMassMatrixNzMax ( rtS , 0 ) ; ssSetModelOutputs ( rtS , MdlOutputs
) ; ssSetModelLogData ( rtS , rt_UpdateTXYLogVars ) ;
ssSetModelLogDataIfInInterval ( rtS , rt_UpdateTXXFYLogVars ) ;
ssSetModelUpdate ( rtS , MdlUpdate ) ; ssSetTNextTid ( rtS , INT_MIN ) ;
ssSetTNext ( rtS , rtMinusInf ) ; ssSetSolverNeedsReset ( rtS ) ;
ssSetNumNonsampledZCs ( rtS , 0 ) ; } { ZCSigState * zc = ( ZCSigState * ) &
rtPrevZCX ; ssSetPrevZCSigState ( rtS , zc ) ; ssSetWorkSizeInBytes ( rtS ,
sizeof ( rtPrevZCX ) , "PrevZCSigState" ) ; } { rtPrevZCX . kitz0vstzp =
ZERO_ZCSIG ; rtPrevZCX . kxdrhb2qez = POS_ZCSIG ; rtPrevZCX . fdz4phu3ryu .
hdn5edzzdz = POS_ZCSIG ; } ssSetChecksumVal ( rtS , 0 , 2080476559U ) ;
ssSetChecksumVal ( rtS , 1 , 3124858972U ) ; ssSetChecksumVal ( rtS , 2 ,
2659875823U ) ; ssSetChecksumVal ( rtS , 3 , 2655922484U ) ; { static const
sysRanDType rtAlwaysEnabled = SUBSYS_RAN_BC_ENABLE ; static RTWExtModeInfo
rt_ExtModeInfo ; static const sysRanDType * systemRan [ 42 ] ;
gblRTWExtModeInfo = & rt_ExtModeInfo ; ssSetRTWExtModeInfo ( rtS , &
rt_ExtModeInfo ) ; rteiSetSubSystemActiveVectorAddresses ( & rt_ExtModeInfo ,
systemRan ) ; systemRan [ 0 ] = & rtAlwaysEnabled ; systemRan [ 1 ] = (
sysRanDType * ) & rtDW . aqnsdlzrky ; systemRan [ 2 ] = ( sysRanDType * ) &
rtDW . aqnsdlzrky ; systemRan [ 3 ] = ( sysRanDType * ) & rtDW . o15rhlrdvu ;
systemRan [ 4 ] = ( sysRanDType * ) & rtDW . o15rhlrdvu ; systemRan [ 5 ] = &
rtAlwaysEnabled ; systemRan [ 6 ] = ( sysRanDType * ) & rtDW . emjuqt1mza ;
systemRan [ 7 ] = ( sysRanDType * ) & rtDW . emjuqt1mza ; systemRan [ 8 ] = (
sysRanDType * ) & rtDW . emjuqt1mza ; systemRan [ 9 ] = ( sysRanDType * ) &
rtDW . lufhggjfnd ; systemRan [ 10 ] = ( sysRanDType * ) & rtDW . lufhggjfnd
; systemRan [ 11 ] = ( sysRanDType * ) & rtDW . lincvc42bd ; systemRan [ 12 ]
= ( sysRanDType * ) & rtDW . agj4y5aysy ; systemRan [ 13 ] = ( sysRanDType *
) & rtDW . grldzuufc2 ; systemRan [ 14 ] = ( sysRanDType * ) & rtDW .
okzuukxele ; systemRan [ 15 ] = & rtAlwaysEnabled ; systemRan [ 16 ] = (
sysRanDType * ) & rtDW . adbs0iqmbq ; systemRan [ 17 ] = ( sysRanDType * ) &
rtDW . adbs0iqmbq ; systemRan [ 18 ] = ( sysRanDType * ) & rtDW . adbs0iqmbq
; systemRan [ 19 ] = ( sysRanDType * ) & rtDW . adbs0iqmbq ; systemRan [ 20 ]
= ( sysRanDType * ) & rtDW . c1r3arr2wv ; systemRan [ 21 ] = &
rtAlwaysEnabled ; systemRan [ 22 ] = ( sysRanDType * ) & rtDW . fy2xh4lnkj ;
systemRan [ 23 ] = ( sysRanDType * ) & rtDW . fy2xh4lnkj ; systemRan [ 24 ] =
( sysRanDType * ) & rtDW . fy2xh4lnkj ; systemRan [ 25 ] = ( sysRanDType * )
& rtDW . fy2xh4lnkj ; systemRan [ 26 ] = ( sysRanDType * ) & rtDW .
jllb4crr4l ; systemRan [ 27 ] = ( sysRanDType * ) & rtDW . jllb4crr4l ;
systemRan [ 28 ] = ( sysRanDType * ) & rtDW . jllb4crr4l ; systemRan [ 29 ] =
( sysRanDType * ) & rtDW . jllb4crr4l ; systemRan [ 30 ] = & rtAlwaysEnabled
; systemRan [ 31 ] = & rtAlwaysEnabled ; systemRan [ 32 ] = & rtAlwaysEnabled
; systemRan [ 33 ] = & rtAlwaysEnabled ; systemRan [ 34 ] = & rtAlwaysEnabled
; systemRan [ 35 ] = ( sysRanDType * ) & rtDW . etrlwpgbmn ; systemRan [ 36 ]
= ( sysRanDType * ) & rtDW . etrlwpgbmn ; systemRan [ 37 ] = ( sysRanDType *
) & rtDW . etrlwpgbmn ; systemRan [ 38 ] = ( sysRanDType * ) & rtDW .
etrlwpgbmn ; systemRan [ 39 ] = & rtAlwaysEnabled ; systemRan [ 40 ] = &
rtAlwaysEnabled ; systemRan [ 41 ] = & rtAlwaysEnabled ;
rteiSetModelMappingInfoPtr ( ssGetRTWExtModeInfo ( rtS ) , &
ssGetModelMappingInfo ( rtS ) ) ; rteiSetChecksumsPtr ( ssGetRTWExtModeInfo (
rtS ) , ssGetChecksums ( rtS ) ) ; rteiSetTPtr ( ssGetRTWExtModeInfo ( rtS )
, ssGetTPtr ( rtS ) ) ; } return rtS ; }
#if defined(_MSC_VER)
#pragma optimize( "", on )

#endif
const int_T gblParameterTuningTid = 4 ; void MdlOutputsParameterSampleTime (
int_T tid ) { MdlOutputsTID4 ( tid ) ; }
