12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607 |
- /************************************************************************
- Project: Welling Motor Control Paltform
- Filename: alarm.c
- Partner Filename: alarm.h
- Description: System fault detection and diagnosis
- Complier: IAR Embedded Workbench for ARM 7.80, IAR Systems.
- CPU TYPE : GD32F3x0
- *************************************************************************
- Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
- All rights reserved.
- *************************************************************************
- *************************************************************************
- Revising History (ECL of this file):
- ************************************************************************/
- /************************************************************************
- Beginning of File, do not put anything above here except notes
- Compiler Directives:
- *************************************************************************/
- #ifndef _ALARM_C_
- #define _ALARM_C_
- #endif
- /************************************************************************
- Included File:
- *************************************************************************/
- #include "syspar.h"
- #include "user.h"
- #include "FSM_1st.h"
- #include "FSM_2nd.h"
- #include "spdctrFSM.h"
- /************************************************************************
- Private Variables:
- ************************************************************************/
- static UWORD alm_pvt_uwResPwrWt = 0;
- static BOOL alm_pvt_blIPMOTReCheckFlg = FALSE;
- static SWORD alm_pvt_swSpdRefAbsPu = 0;
- static SWORD alm_pvt_swSpdFbAbsPu = 0;
- static SLONG alm_pvt_slSpdFbLpfAbsPu = 0;
- static SWORD alm_pvt_swSpdFbLpfAbsPu = 0;
- static SWORD alm_pvt_swIqRefAbsPu = 0;
- static SLONG alm_pvt_slIqRefLpfAbsPu = 0;
- static SWORD alm_pvt_swIqRefLpfAbsPu = 0;
- static BOOL alm_pvt_blTbcFirstFlg = FALSE;
- static BOOL alm_pvt_blTbsFirstFlg = FALSE;
- static SWORD alm_pvt_swRtLockPwrRatio = 0;
- /************************************************************************
- Constant Table:
- *************************************************************************/
- /************************************************************************
- Exported Functions:
- *************************************************************************/
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voInit(void)
- {
- alm_unCode.all = 0;
- alm_unBikeCode.all = 0;
- alm_unAction.all = 0;
- alm_enFSMStatus = Alm_Stop;
- alm_uwRotorLockedResetCnts = 0;
- alm_uwOSResetCnts = 0;
- alm_uwIPMOCResetCnts = 0;
- alm_uwOCResetCnts = 0;
- alm_pvt_blIPMOTReCheckFlg = FALSE;
- alm_blPowerDownFlg = FALSE;
- /* Clear stop count */
- alm_stStopCt.ulThrPhsShrtFrc = 0;
- alm_stStopCt.ulPWMOff = 0;
- alm_stStopCt.ulThrPhsShrt = 0;
- alm_stStopCt.uwRotorStopCnt = 0;
- alm_stStopCt.ulPWMOffShrtSw = 0;
- alm_stStopCt.ulShrtPWMOffSw = 0;
- alm_stStopCt.ulBikePWMOff = 0;
-
- /* Clear recover count */
- alm_stRecCt.ulGlbl = 0;
- alm_stRecCt.ulOvrVlt = 0;
- alm_stRecCt.ulOvrVlt1 = 0;
- alm_stRecCt.ulUndrVlt = 0;
- alm_stRecCt.ulUndrVlt1 = 0;
- alm_stRecCt.ulIPMOvrHeat = 0;
- alm_stRecCt.ulIPMOvrHeat1 = 0;
- alm_stRecCt.ulIPMOC = 0;
- alm_stRecCt.ulBikeGlbl = 0;
- alm_stRecCt.ulBikeSpdFlt = 0;
- alm_stRecCt.ulCadenceFlt = 0;
- alm_stRecCt.ulTorqFlt = 0;
- alm_stRecCt.ulThrottleFlt = 0;
- alm_stRecCt.ulPCBNTCFlt = 0;
- alm_stRecCt.ulMotorNTCFlt = 0;
-
- /* Clear alarm flag */
- alm_blAlmOccrFlg = FALSE;
- alm_blAlmSingleRecordDoneFlg = FALSE;
- /* Clear alarm count */
- alm_stDecCt.ulIPMOvrHeat = 0;
- alm_stDecCt.ulIPMOvrHeat1 = 0;
- alm_stDecCt.ulOvrCur = 0;
- alm_stDecCt.ulOvrSpd = 0;
- alm_stDecCt.ulOvrVltLvl1 = 0;
- alm_stDecCt.ulOvrVltLvl2 = 0;
- alm_stDecCt.ulOvrVltLvl3 = 0;
- alm_stDecCt.ulPhsALoss = 0;
- alm_stDecCt.ulPhsBLoss = 0;
- alm_stDecCt.ulPhsCLoss = 0;
- alm_stDecCt.slRotorLock = 0;
- alm_stDecCt.ulUndrVltLvl1 = 0;
- alm_stDecCt.ulUndrVltLvl2 = 0;
- alm_stDecCt.uwBikeSpdFlt = 0;
- alm_stDecCt.uwCadenceFlt = 0;
- alm_stDecCt.uwTorqFlt = 0;
- alm_stDecCt.uwThrottleFlt = 0;
- alm_stDecCt.uwPCBNTCFlt = 0;
- alm_stDecCt.uwMotorNTCFlt = 0;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voCoef(void)
- {
- alm_stDetectTbcCoefIn.uwIbAp = IBASE;
- alm_stDetectTbcCoefIn.uwUbVt = VBASE;
- alm_stDetectTbcCoefIn.uwFTbcHz = FTBC_HZ;
- alm_stDetectTbcCoefIn.uwPairs = cp_stMotorPara.swMotrPolePairs;
- alm_stDetectTbcCoefIn.uwMtRsOm = cp_stMotorPara.swRsOhm;
- alm_stDetectTbcCoefIn.uwFbHz = FBASE;
- alm_stDetectTbcCoefIn.uwOvrCurIa = cp_stControlPara.swAlmOverCurrentVal;
- alm_stDetectTbcCoefIn.uwOvrCurTu = cp_stControlPara.swAlmOverCurrentTM;
- alm_stDetectTbcCoefIn.uwAdcDetHigVt = cp_stControlPara.swAlmAdcDetectHighVal;
- alm_stDetectTbcCoefIn.uwAdcDetLowVt = cp_stControlPara.swAlmAdcDetectLowVal;
- alm_stDetectTbcCoefIn.uwPhsLossVt = cp_stControlPara.swAlmPhsLossVal;
- alm_stDetectTbcCoefIn.uwPhsLossTs = cp_stControlPara.swAlmPhsLossTM;
- alm_stDetectTbcCoefIn.uwRotorLockSpdK = cp_stControlPara.swAlmRotorLockK;
- alm_stDetectTbcCoefIn.uwRotorLockTs = cp_stControlPara.swAlmRotorLockTM;
- alm_stDetectTbcCoefIn.swIqRefLpfAbsAp = cp_stControlPara.swAlmRotorLockCurVal;
- alm_stDetectTbcCoefIn.swSpdFbLpfAbsRpm = cp_stControlPara.swAlmRotorLockSpdVal;
- alm_voDetecTBCCoef(&alm_stDetectTbcCoefIn, &alm_stDetectTbcCoef);
- alm_stDetectTbsCoefIn.uwPairs = cp_stMotorPara.swMotrPolePairs;
- alm_stDetectTbsCoefIn.uwFbHz = FBASE;
- alm_stDetectTbsCoefIn.uwFTbsHz = FTBS_HZ;
- alm_stDetectTbsCoefIn.uwUbVt = VBASE;
- alm_stDetectTbsCoefIn.uwOvrVlt1Vt = cp_stControlPara.swAlmOverVolVal1;
- alm_stDetectTbsCoefIn.uwOvrVlt2Vt = cp_stControlPara.swAlmOverVolVal2;
- alm_stDetectTbsCoefIn.uwOvrVlt3Vt = cp_stControlPara.swAlmOverVolVal3;
- alm_stDetectTbsCoefIn.uwOvrVlt1Ts = cp_stControlPara.swAlmOverVolTM1;
- alm_stDetectTbsCoefIn.uwOvrVlt2Tm = cp_stControlPara.swAlmOverVolTM2;
- alm_stDetectTbsCoefIn.uwOvrVlt3Tm = cp_stControlPara.swAlmOverVolTM3;
- alm_stDetectTbsCoefIn.uwUndrVlt1Vt = cp_stControlPara.swAlmUnderVolVal1;
- alm_stDetectTbsCoefIn.uwUndrVlt2Vt = cp_stControlPara.swAlmUnderVolVal2;
- alm_stDetectTbsCoefIn.uwUndrVlt1Ts = cp_stControlPara.swAlmUnderVolTM1;
- alm_stDetectTbsCoefIn.uwUndrVlt2Tm = cp_stControlPara.swAlmUnderVolTM2;
- alm_stDetectTbsCoefIn.uwOvrSpdRpm = cp_stControlPara.swAlmOverSpdVal;
- alm_stDetectTbsCoefIn.uwOvrSpdTm = cp_stControlPara.swAlmOverSpdTM;
- alm_stDetectTbsCoefIn.uwIpmOvrHeatRecCe = cp_stControlPara.swAlmRecOHeatVal;
- alm_stDetectTbsCoefIn.uwIpmOvrHeatTs = cp_stControlPara.swAlmOverHeatTM;
- alm_stDetectTbsCoefIn.uwIpmOvrHeatCe = cp_stControlPara.swAlmOverHeatCeVal;
- alm_voDetecTBSCoef(&alm_stDetectTbsCoefIn, &alm_stDetectTbsCoef);
- alm_stStopTbcCoefIn.uwIbAp = IBASE;
- alm_stStopTbcCoefIn.uwUbVt = VBASE;
- alm_stStopTbcCoefIn.uwFTbcHz = FTBC_HZ;
- alm_stStopTbcCoefIn.uwThrPhsShrtFrcTs = cp_stControlPara.swAlmThrPhsShrtFrcTM;
- alm_stStopTbcCoefIn.uwIPMOverCurStopTs = cp_stControlPara.swAlmIPMOverCurStopTM;
- alm_stStopTbcCoefIn.uwPwmoffShrt1SwTs = cp_stControlPara.swAlmPWMOffShrtsw1TM;
- alm_stStopTbcCoefIn.uwShrtPwmoffSwTs = cp_stControlPara.swAlmShrtPWMOffswTM;
- alm_stStopTbcCoefIn.uwPwmOffTs = cp_stControlPara.swAlmPWMOffTM;
- alm_stStopTbcCoefIn.uwThrPhsShrtTs = cp_stControlPara.swAlmThrPhsShrtNormTM;
- alm_stStopTbcCoefIn.uwOvrVlt1Vt = cp_stControlPara.swAlmOverVolVal1;
- alm_voStopTBCCoef(&alm_stStopTbcCoefIn, &alm_stStopTbcCoef);
- alm_stResetCoefIn.uwUbVt = VBASE;
- alm_stResetCoefIn.uwFTbcHz = FTBC_HZ;
- alm_stResetCoefIn.uwRecAllTs = cp_stControlPara.swAlmRecAllTM;
- alm_stResetCoefIn.uwIpmOcRecTs = cp_stControlPara.swAlmRecOCTM;
- alm_stResetCoefIn.uwOvrVltRecVt = cp_stControlPara.swAlmRecOVVal;
- alm_stResetCoefIn.uwOvrVltRecTs = cp_stControlPara.swAlmRecOVTM;
- alm_stResetCoefIn.uwOvrVltRec1Ts = cp_stControlPara.swAlmRecOVTM1;
- alm_stResetCoefIn.uwUndrVltRecVt = cp_stControlPara.swAlmRecUVVal;
- alm_stResetCoefIn.uwUndrVltRecTs = cp_stControlPara.swAlmRecUVTM;
- alm_stResetCoefIn.uwUndrVltRec1Ts = cp_stControlPara.swAlmRecUVTM1;
- alm_stResetCoefIn.uwIpmOvrHeatRecCe = cp_stControlPara.swAlmRecOHeatVal;
- alm_stResetCoefIn.uwIpmOvrHeatRecTs = cp_stControlPara.swAlmRecOHeatTM;
- alm_stResetCoefIn.uwIpmOvrHeatRec1Ts = cp_stControlPara.swAlmRecOHeatTM1;
- alm_voResetCoef(&alm_stResetCoefIn, &alm_stResetCoef);
-
- alm_stDetect200MSCoefIn.swMotorSpdMinRpm = ALM_MOTORSPD_MIN_RPM;
- alm_stDetect200MSCoefIn.uwBikeSpdFltTs = ALM_BIKESPD_FLT_TS;
- alm_stDetect200MSCoefIn.uwCadenceFltTs = ALM_CADENCE_FLT_TS;
- alm_stDetect200MSCoefIn.uwFbHz = FBASE;
- alm_stDetect200MSCoefIn.uwFT200MSHz = 5 ;
- alm_stDetect200MSCoefIn.uwMotorNTCFltTs = ALM_MOTORNTC_FLT_TS;
- alm_stDetect200MSCoefIn.uwPairs = cp_stMotorPara.swMotrPolePairs;
- alm_stDetect200MSCoefIn.uwPCBNTCFltTs = ALM_PCBNTC_FLT_TS;
- alm_stDetect200MSCoefIn.uwThrottleFltTs = ALM_THROTTLE_FLT_TS;
- alm_stDetect200MSCoefIn.uwTorqFltTs = ALM_TORQ_FLT_TS;
- alm_stDetect200MSCoefIn.uwTorqMaxVol = ALM_TORQ_MAX_VOL;
- alm_stDetect200MSCoefIn.uwTorqMinVol = ALM_TORQ_MIN_VOL;
- alm_stDetect200MSCoefIn.uwThrottleMaxVol = ALM_THROTTLE_MAX_VOL;
- alm_stDetect200MSCoefIn.uwThrottleMinVol =ALM_THROTTLE_MIN_VOL;
- alm_stDetect200MSCoefIn.uwNTCMaxVol = ALM_NTC_MAX_VOL;
- alm_stDetect200MSCoefIn.uwNTCMinVol = ALM_NTC_MIN_VOL;
- alm_voDetec200MSCoef(&alm_stDetect200MSCoefIn, &alm_stDetect200MSCoef);
-
- alm_stReset1MSCoefIn.uwBikeGlblTm = ALM_BIKE_REC_ALL_TM;
- alm_stReset1MSCoefIn.uwBikeSpdFltTm = ALM_BIKESPD_REC_TM;
- alm_stReset1MSCoefIn.uwCadenceFltTm = ALM_CADENCE_REC_TM;
- alm_stReset1MSCoefIn.uwFT1MSHz = 1000;
- alm_stReset1MSCoefIn.uwMotorNTCFltTm = ALM_MOTORNTC_REC_TM;
- alm_stReset1MSCoefIn.uwPCBNTCFltTm = ALM_PCBNTC_REC_TM;
- alm_stReset1MSCoefIn.uwThrottleFltTm = ALM_THROTTLE_REC_TM;
- alm_stReset1MSCoefIn.uwTorqFltTm = ALM_TORQ_REC_TM;
- alm_voReset1MSCoef(&alm_stReset1MSCoefIn, &alm_stReset1MSCoef);
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voDetecTBCCoef(ALM_DETECTBC_COFIN *in, ALM_DETECTBC_COF *out)
- {
- UWORD uwRbOm;
- if (in->uwIbAp < 1)
- {
- in->uwIbAp = 1;
- }
- if (in->uwFbHz < 1)
- {
- in->uwFbHz = 1;
- }
- uwRbOm = (UWORD)((ULONG)in->uwUbVt * 100000 / in->uwIbAp); /* unit: 0.01Ohm, Resistance base */
- out->uwRsPu = (UWORD)(((ULONG)in->uwMtRsOm << 15) / uwRbOm); /* Q15, Phase resistance */
- out->uwPbWt = (UWORD)((ULONG)in->uwUbVt * in->uwIbAp * 3 / 100 >> 1); /* unit: 0.1w, Power base */
- out->ulOvrCurValPu = ((ULONG)in->uwOvrCurIa << 14) / in->uwIbAp; // CUR_AP2PU(x) (((ULONG)(x)<<14)/IBASE) Q14
- out->ulOvrCurValCt = ((ULONG)in->uwOvrCurTu * in->uwFTbcHz / 1000000) >> 1; // TBC_US2CT(x) ((ULONG)(x)*FTBC_HZ/1000000)
- out->slAdcDetHigValPu = (SLONG)in->uwAdcDetHigVt * 4096 / 330; //_IQ12(A) (SLONG)(A * 4096L)
- out->slAdcDetLowValPu = (SLONG)in->uwAdcDetLowVt * 4096 / 330;
- out->ulPhsLossValPu = ((ULONG)in->uwPhsLossVt << 14) / in->uwIbAp;
- out->ulPhsLossValCt = ((ULONG)in->uwPhsLossTs * in->uwFTbcHz) >> 1; // TBC_S2CT(x) ((ULONG)(x)*FTBC_HZ)
- out->slRotorLockSpdK = (SLONG)in->uwRotorLockSpdK * 1024 / 100; //_IQ10(0.5) (SLONG)(A * 1024L)
- out->slRotorLockValCt = ((SLONG)in->uwRotorLockTs * in->uwFTbcHz) >> 1;
- out->slIqRefLpfAbsValPu = ((SLONG)in->swIqRefLpfAbsAp << 14) / in->uwIbAp; // CUR_AP2PU(x) (((ULONG)(x)<<14)/IBASE)
- out->slSpdFbLpfAbsValPu = ((SLONG)in->swSpdFbLpfAbsRpm << 15) / 60 * in->uwPairs / in->uwFbHz;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voDetecTBC(const ALM_IN *in, const ALM_DETECTBC_COF *coef) /* parasoft-suppress METRICS-28 "本项目圈复杂度无法更改,后续避免" */
- {
- SWORD swTmp1, swTmp2;
- if(clasB_unFaultCode.all != 0) //MicroFault Handle
- {
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.MCUErr = 1;
- }
- /*=======================================================================
- IPM fault
- =======================================================================*/
- if (MCU_BRKIN_FLG != 0)
- {
- alm_unAction.bit.ThrPhsShrtFrc = 1;
- alm_unCode.bit.IPMFlt = 1;
- }
- if (alm_pvt_blTbcFirstFlg == 1)
- {
- /*=======================================================================
- Software Over current
- =======================================================================*/
- if (in->blADCInitOvrFlg)
- {
- if (curSpeed_state.state != Stop)
- {
- if (in->uwIpeakPu > coef->ulOvrCurValPu) // 9A
- {
- alm_stDecCt.ulOvrCur++;
- if (alm_stDecCt.ulOvrCur >= coef->ulOvrCurValCt) // 500us
- {
- alm_stDecCt.ulOvrCur = coef->ulOvrCurValCt;
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.OvrCur = 1;
- }
- }
- else
- {
- alm_stDecCt.ulOvrCur = 0;
- }
- }
- else
- {
- alm_stDecCt.ulOvrCur = 0;
- }
- }
- /*=======================================================================
- ADC Self Detecting Fault
- =======================================================================*/
- // if (in->blADCInitOvrFlg)
- // {
- // if((in->uwIdcOffset >= coef->slAdcDetHigValPu)||(in->uwIdcOffset <= coef->slAdcDetLowValPu))
- // {
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- // alm_unCode.bit.ADCOffsetFlt = TRUE;
- // }
- // }
- /*=======================================================================
- Over load
- =======================================================================*/
- /*=======================================================================
- Phase loss
- =======================================================================*/
- if (curSpeed_state.state != Stop)
- {
- if (scm_swIqRefPu > 150 || scm_swIqRefPu < -150)
- {
- if (in->uwIaAbsPu < coef->ulPhsLossValPu) // 0.18A
- {
- alm_stDecCt.ulPhsALoss++;
- }
- else
- {
- alm_stDecCt.ulPhsALoss = 0;
- }
- if (in->uwIbAbsPu < coef->ulPhsLossValPu)
- {
- alm_stDecCt.ulPhsBLoss++;
- }
- else
- {
- alm_stDecCt.ulPhsBLoss = 0;
- }
- if (in->uwIcAbsPu < coef->ulPhsLossValPu)
- {
- alm_stDecCt.ulPhsCLoss++;
- }
- else
- {
- alm_stDecCt.ulPhsCLoss = 0;
- }
- }
- if (alm_stDecCt.ulPhsALoss >= coef->ulPhsLossValCt || alm_stDecCt.ulPhsBLoss >= coef->ulPhsLossValCt ||
- alm_stDecCt.ulPhsCLoss >= coef->ulPhsLossValCt) // 4s
- {
- alm_stDecCt.ulPhsALoss = coef->ulPhsLossValCt;
- alm_stDecCt.ulPhsBLoss = coef->ulPhsLossValCt;
- alm_stDecCt.ulPhsCLoss = coef->ulPhsLossValCt;
- alm_unAction.bit.PWMOff = 1;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- // alm_unCode.bit.PhsLoss = TRUE;
- }
- }
- else
- {
- alm_stDecCt.ulPhsALoss = 0;
- alm_stDecCt.ulPhsBLoss = 0;
- alm_stDecCt.ulPhsCLoss = 0;
- }
- /*=======================================================================
- Set AlmTbcDetectFlg
- =======================================================================*/
- alm_pvt_blTbcFirstFlg = FALSE;
- }
- else
- {
- /*=======================================================================
- Rotor lock for sensorless
- =======================================================================*/
- alm_pvt_swSpdRefAbsPu = (SWORD)in->uwSpdRefAbsPu; // Q15
- alm_pvt_swIqRefAbsPu = (SWORD)abs(in->swIqRefPu);
- alm_pvt_slIqRefLpfAbsPu = (SLONG)0x0010 * (alm_pvt_swIqRefAbsPu - alm_pvt_swIqRefLpfAbsPu) + alm_pvt_slIqRefLpfAbsPu; // Q30
- alm_pvt_swIqRefLpfAbsPu = (SWORD)(alm_pvt_slIqRefLpfAbsPu >> 15);
- alm_pvt_swSpdFbAbsPu = (SWORD)in->uwSpdFbkLpfAbsPu; // Q15
- alm_pvt_slSpdFbLpfAbsPu = (SLONG)0x0010 * (alm_pvt_swSpdFbAbsPu - alm_pvt_swSpdFbLpfAbsPu) + alm_pvt_slSpdFbLpfAbsPu; // Q30
- alm_pvt_swSpdFbLpfAbsPu = (SWORD)(alm_pvt_slSpdFbLpfAbsPu >> 15); // Q15
- if (((curSpeed_state.state == ClzLoop) || (curSpeed_state.state == StartUp)) && (in->uwSpdRefAbsPu > 0))
- {
- swTmp1 = (in->swIalhpaPu * in->swIalhpaPu + in->swIbetaPu * in->swIbetaPu) >> 14; // Q14=Q14+Q14-Q14
- swTmp2 = (SWORD)(swTmp1 * (SLONG)coef->uwRsPu >> 14); // Q15=Q14+Q15-Q14
- alm_pvt_uwResPwrWt = swTmp2 * coef->uwPbWt >> 15; // unit: 0.1w
- if ((in->swMotorPwrInWt > 0) && (alm_pvt_swIqRefLpfAbsPu > coef->slIqRefLpfAbsValPu) &&
- (alm_pvt_swSpdFbLpfAbsPu < coef->slSpdFbLpfAbsValPu))
- {
- alm_pvt_swRtLockPwrRatio = (SWORD)((SLONG)alm_pvt_uwResPwrWt * 100 / in->swMotorPwrInWt);
- if (alm_pvt_uwResPwrWt > (coef->slRotorLockSpdK * in->swMotorPwrInWt >> 10)) // k = 0.5
- {
- alm_stDecCt.slRotorLock++;
- if (alm_stDecCt.slRotorLock >= coef->slRotorLockValCt) // 4s
- {
- alm_stDecCt.slRotorLock = coef->slRotorLockValCt;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.RotorLock = 1;
- }
- }
- else
- {
- alm_stDecCt.slRotorLock--;
- if (alm_stDecCt.slRotorLock < 0)
- {
- alm_stDecCt.slRotorLock = 0;
- }
- }
- }
- else
- {
- alm_stDecCt.slRotorLock = 0;
- }
- }
- else
- {
- alm_stDecCt.slRotorLock = 0;
- }
- /*=======================================================================
- Spi Theta Fault
- =======================================================================*/
- if(in->blSpiThetaFltFlg)
- {
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.SpiThetaFlt = 1;
- }
-
- /*=======================================================================
- Set AlmTbcDetectFlg
- =======================================================================*/
- alm_pvt_blTbcFirstFlg = TRUE;
- }
- /*========================== Alarm flag set ===========================*/
- if ((alm_unCode.all != 0) || (alm_pvt_blIPMOTReCheckFlg == TRUE) || (alm_unBikeCode.all != 0))
- {
- alm_blAlmOccrFlg = TRUE;
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voDetecTBSCoef(ALM_DETECTBS_COFIN *in, ALM_DETECTBS_COF *out)
- {
- if (in->uwFbHz < 1)
- {
- in->uwFbHz = 1;
- }
- if (in->uwUbVt < 1)
- {
- in->uwUbVt = 1;
- }
- out->ulOvrVltLvl1ValPu = ((ULONG)in->uwOvrVlt1Vt << 14) / in->uwUbVt;
- out->ulOvrVltLvl2ValPu = ((ULONG)in->uwOvrVlt2Vt << 14) / in->uwUbVt;
- out->ulOvrVltLvl3ValPu = ((ULONG)in->uwOvrVlt3Vt << 14) / in->uwUbVt;
- out->ulOvrVltLvl1ValCt = ((ULONG)in->uwOvrVlt1Ts * in->uwFTbsHz) >> 1; // TBS_S2CT(x) ((ULONG)(x)*FTBS_HZ)
- out->ulOvrVltLvl2ValCt = ((ULONG)in->uwOvrVlt2Tm * in->uwFTbsHz / 1000) >> 1;
- out->ulOvrVltLvl3ValCt = ((ULONG)in->uwOvrVlt3Tm * in->uwFTbsHz / 1000) >> 1;
- out->ulUndrVltLvl1ValPu = ((ULONG)in->uwUndrVlt1Vt << 14) / in->uwUbVt;
- out->ulUndrVltLvl2ValPu = ((ULONG)in->uwUndrVlt2Vt << 14) / in->uwUbVt;
- out->ulUndrVltLvl1ValCt = ((ULONG)in->uwUndrVlt1Ts * in->uwFTbsHz) >> 1;
- out->ulUndrVltLvl2ValCt = ((ULONG)in->uwUndrVlt2Tm * in->uwFTbsHz / 1000) >> 1; // TBS_MS2CT(x) ((ULONG)(x)*FTBS_HZ/1000)
- out->slOvrSpdValPu = ((SLONG)in->uwOvrSpdRpm << 15) / 60 * in->uwPairs /
- in->uwFbHz; // SPD_RPM2PU(x) (((SLONG)(x)<<15)/60*MOTOR_PAIRS/FBASE) /* rpm to Pu(Q15) */
- out->ulOvrSpdValCt = ((ULONG)in->uwOvrSpdTm * in->uwFTbsHz / 1000) >> 1;
- out->uwIPMOvrHeatRecValCe = in->uwIpmOvrHeatRecCe;
- out->ulIPMOvrHeatValCt = ((ULONG)in->uwIpmOvrHeatTs * in->uwFTbsHz) >> 1;
- out->uwIPMOvrHeatValCe = in->uwIpmOvrHeatCe;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voDetecTBS(const ALM_IN *in, const ALM_DETECTBS_COF *coef)
- {
- if (alm_pvt_blTbsFirstFlg == FALSE)
- {
- /*=======================================================================
- Over voltage
- =======================================================================*/
- /* Over voltage level 3 */
- if (in->uwVdcPu > coef->ulOvrVltLvl3ValPu) // 45V
- {
- alm_stDecCt.ulOvrVltLvl3++;
- if (alm_stDecCt.ulOvrVltLvl3 >= coef->ulOvrVltLvl3ValCt) // 1ms
- {
- alm_stDecCt.ulOvrVltLvl3 = coef->ulOvrVltLvl3ValCt;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unCode.bit.OvrVlt = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.ulOvrVltLvl3 = 0;
- }
- /* Over voltage level 2 */
- if (in->uwVdcPu > coef->ulOvrVltLvl2ValPu) // 44V
- {
- alm_stDecCt.ulOvrVltLvl2++;
- if (alm_stDecCt.ulOvrVltLvl2 >= coef->ulOvrVltLvl2ValCt) // 10ms
- {
- alm_stDecCt.ulOvrVltLvl2 = coef->ulOvrVltLvl2ValCt;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unCode.bit.OvrVlt = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.ulOvrVltLvl2 = 0;
- }
- /* Over voltage level 1 */
- if (in->uwVdcPu > coef->ulOvrVltLvl1ValPu) // 43V
- {
- alm_stDecCt.ulOvrVltLvl1++;
- if (alm_stDecCt.ulOvrVltLvl1 >= coef->ulOvrVltLvl1ValCt) // 2s
- {
- alm_stDecCt.ulOvrVltLvl1 = coef->ulOvrVltLvl1ValCt;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unCode.bit.OvrVlt = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.ulOvrVltLvl1 = 0;
- }
- /*=======================================================================
- Under voltage
- =======================================================================*/
- /* Under voltage level 2 */
- if (in->uwVdcPu < coef->ulUndrVltLvl2ValPu) // 160v
- {
- alm_stDecCt.ulUndrVltLvl2++;
- if (alm_stDecCt.ulUndrVltLvl2 >= coef->ulUndrVltLvl2ValCt) // 1ms
- {
- alm_stDecCt.ulUndrVltLvl2 = coef->ulUndrVltLvl2ValCt;
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.UndrVlt = 1;
- }
- }
- else
- {
- alm_stDecCt.ulUndrVltLvl2 = 0;
- }
- // /* Under voltage level 1 */
- if (in->uwVdcPu < coef->ulUndrVltLvl1ValPu) // 190V
- {
- alm_stDecCt.ulUndrVltLvl1++;
- if (alm_stDecCt.ulUndrVltLvl1 >= coef->ulUndrVltLvl1ValCt) // 2s
- {
- alm_stDecCt.ulUndrVltLvl1 = coef->ulUndrVltLvl1ValCt;
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.UndrVlt = 1;
- }
- }
- else
- {
- alm_stDecCt.ulUndrVltLvl1 = 0;
- }
- alm_pvt_blTbsFirstFlg = TRUE;
- }
- else
- {
- /*=======================================================================
- Over speed
- =======================================================================*/
- if (in->uwSpdFbkLpfAbsPu > coef->slOvrSpdValPu) // 19000rpm
- {
- alm_stDecCt.ulOvrSpd++;
- if (alm_stDecCt.ulOvrSpd >= coef->ulOvrSpdValCt) // 100ms
- {
- alm_stDecCt.ulOvrSpd = coef->ulOvrSpdValCt;
- alm_unAction.bit.ThrPhsShrt = 1;
- alm_unCode.bit.OvrSpd = 1;
- }
- }
- else
- {
- alm_stDecCt.ulOvrSpd = 0;
- }
- /*=======================================================================
- over heat
- =======================================================================*/
- if (alm_pvt_blIPMOTReCheckFlg == TRUE)
- {
- if (in->uwIPMTempCe > coef->uwIPMOvrHeatRecValCe) // 70
- {
- alm_stDecCt.ulIPMOvrHeat1++;
- if (alm_stDecCt.ulIPMOvrHeat1 >= coef->ulIPMOvrHeatValCt) // 2s
- {
- alm_stDecCt.ulIPMOvrHeat1 = coef->ulIPMOvrHeatValCt;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.IPMOvrHeat = 1;
- }
- }
- else
- {
- alm_stDecCt.ulIPMOvrHeat1 = 0;
- }
- }
- else
- {
- if (in->uwIPMTempCe > coef->uwIPMOvrHeatValCe) // 85
- {
- alm_stDecCt.ulIPMOvrHeat++;
- if (alm_stDecCt.ulIPMOvrHeat >= coef->ulIPMOvrHeatValCt) // 2s
- {
- alm_stDecCt.ulIPMOvrHeat = coef->ulIPMOvrHeatValCt;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unAction.bit.PWMOff = 1;
- alm_unCode.bit.IPMOvrHeat = 1;
- alm_pvt_blIPMOTReCheckFlg = TRUE;
- }
- }
- else
- {
- alm_stDecCt.ulIPMOvrHeat = 0;
- }
- }
- /*=======================================================================
- Hall loss // MPS position loss
- =======================================================================*/
- // cp_stHistoryPara.uwPosSensorAlamTimes++;
- /*=======================================================================
- Communication over time
- =======================================================================*/
- if (uart_bCommOvrTmFlg)
- {
- alm_unAction.bit.PWMOff = 1;
- // alm_unAction.bit.ThrPhsShrt = TRUE;
- alm_unCode.bit.CommOvrTm = 1;
- }
- alm_pvt_blTbsFirstFlg = FALSE;
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voHandleTBC(const ALM_IN *in)
- {
- /* Alarm occur */
- if (alm_blAlmOccrFlg)
- {
- /* micro fault */
- if(clasB_unFaultCode.all != 0)
- {
- if(scm_stSpdFbkLpf.slY.sw.hi < SPD_RPM2PU(10))//puֵ Լ10rpm
- {
- NVIC_SystemReset();
- }
- }
- /* Alarm handle FSM */
- switch (alm_enFSMStatus)
- {
- case Alm_Stop:
- alm_voStopTBC(in, &alm_stStopTbcCoef); /* Stop in TBC */
- if (cmfsm_stFlg.blMotorStopFlg)
- {
- sysfsm_stFlg.blFSMRstOvrFlg = FALSE; /* Enable control mode FSM reset */
- sysfsm_stFlg.blCtrlMdVarClcOvrFlg = FALSE; /* Enable control mode variable clear */
- alm_enFSMStatus = Alm_VarClc;
- }
- break;
- case Alm_VarClc:
- if (sysfsm_stFlg.blFSMRstOvrFlg && sysfsm_stFlg.blCtrlMdVarClcOvrFlg)
- {
- alm_enFSMStatus = Alm_Reset;
- }
- break;
- case Alm_Reset:
- alm_voReset(in, &alm_stResetCoef);
- break;
- default:
- break;
- }
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voHandleTBS(const ALM_IN *in)
- {
- /* Alarm occur */
- if (alm_blAlmOccrFlg)
- {
- /* Alarm handle FSM */
- switch (alm_enFSMStatus)
- {
- case Alm_Stop:
- // alm_voStopTBS(); /* Stop in TBS */
- break;
- case Alm_VarClc:
- break;
- case Alm_Reset:
- // alm_voReset(in,&alm_stResetCoef);
- break;
- default:
- break;
- }
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voStopTBCCoef(ALM_STOPTBC_COFIN *in, ALM_STOPTBC_COF *out)
- {
- if (in->uwIbAp < 1)
- {
- in->uwIbAp = 1;
- }
- if (in->uwUbVt < 1)
- {
- in->uwUbVt = 1;
- }
- out->ulThrPhsShrtFrcValCt = ((ULONG)in->uwThrPhsShrtFrcTs * in->uwFTbcHz) / 1000; // TBC_S2CT(x) ((ULONG)(x)*FTBC_HZ)
- out->ulStopCurValCt = ((ULONG)in->uwIPMOverCurStopTs * in->uwFTbcHz) / 1000;
- out->ulPWMOffShrt1SwValCt = ((ULONG)in->uwPwmoffShrt1SwTs * in->uwFTbcHz) / 1000;
- out->ulShrtPWMOffSwValCt = ((ULONG)in->uwShrtPwmoffSwTs * in->uwFTbcHz) / 1000;
- out->ulPWMOffValCt = ((ULONG)in->uwPwmOffTs * in->uwFTbcHz) / 1000;
- out->ulThrPhsShrtNormValCt = ((ULONG)in->uwThrPhsShrtTs * in->uwFTbcHz) / 1000;
- out->ulOvrVltLvl1ValPu = (((ULONG)in->uwOvrVlt1Vt << 14) / in->uwUbVt) / 1000;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voStopTBC(const ALM_IN *in, const ALM_STOPTBC_COF *coef)
- {
- if (alm_unAction.bit.ThrPhsShrtFrc != 0)
- {
- if (MCU_BRKIN_FLG != 0)
- {
- hw_voPWMOff(); /* PWM off */
- MCU_BRKIN_FLG_CLR; /* Clear TIME0 break flag */
- MCU_POEN_FLG_EN; /* Enable TIME0 Channel outputs */
- alm_stStopCt.ulThrPhsShrtFrc++;
- if (alm_stStopCt.ulThrPhsShrtFrc > coef->ulThrPhsShrtFrcValCt) // 200ms
- {
- alm_stStopCt.uwRotorStopCnt++;
- if (alm_stStopCt.uwRotorStopCnt >= coef->ulStopCurValCt) // 100ms
- {
- hw_voPWMOff(); /* PWM off */
- cmfsm_stFlg.blMotorStopFlg = TRUE;
- alm_stStopCt.uwRotorStopCnt = (UWORD)coef->ulStopCurValCt;
- }
- }
- alm_stStopCt.ulShrtPWMOffSw = 0;
- }
- else
- {}
- }
- else if (alm_unAction.bit.PWMOff != 0)
- {
- alm_stStopCt.ulPWMOffShrtSw++;
- alm_stStopCt.ulPWMOff++;
- if (alm_stStopCt.ulPWMOffShrtSw < coef->ulPWMOffShrt1SwValCt) // 100ms
- {
- hw_voPWMOff();
- alm_stStopCt.uwRotorStopCnt = 0;
- }
- // else if(alm_stStopCt.ulPWMOffShrtSw < coef->ulPWMOffShrt2SwValCt)
- // {
- // hw_voThrPhsShrt();
- // }
- else
- {
- alm_stStopCt.ulPWMOffShrtSw = 0;
- }
- if (alm_stStopCt.ulPWMOff > coef->ulPWMOffValCt) // 200ms
- {
- cmfsm_stFlg.blMotorStopFlg = TRUE;
- alm_stStopCt.ulPWMOff = 0;
- }
- alm_stStopCt.ulShrtPWMOffSw = 0;
- }
- else // if (alm_unAction.bit.ThrPhsShrt)
- {
- alm_stStopCt.ulShrtPWMOffSw++;
- alm_stStopCt.ulThrPhsShrt++;
- if (alm_stStopCt.ulShrtPWMOffSw < coef->ulThrPhsShrtNormValCt) // 100ms
- {
- hw_voThrPhsShrt(); /* Three phase short */
- }
- else if (alm_stStopCt.ulShrtPWMOffSw < (coef->ulThrPhsShrtNormValCt + coef->ulShrtPWMOffSwValCt)) // 100ms + 100ms
- {
- hw_voPWMOff();
- if (in->uwVdcPu > coef->ulOvrVltLvl1ValPu) // over vol level1 43V
- {
- alm_stStopCt.ulShrtPWMOffSw = 0;
- }
- alm_stStopCt.uwRotorStopCnt = 0;
- }
- else
- {
- alm_stStopCt.ulShrtPWMOffSw = 0;
- }
- if (alm_stStopCt.ulThrPhsShrt > coef->ulThrPhsShrtFrcValCt) // 200ms
- {
- hw_voPWMOff(); /* PWM off */
- cmfsm_stFlg.blMotorStopFlg = TRUE;
- alm_stStopCt.ulThrPhsShrt = 0;
- }
- alm_stStopCt.ulPWMOffShrtSw = 0;
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voStopTBS(void)
- {
- // if (alm_unAction.bit.SlowDwn)
- // {
- // acm_voAlmCtrMdTbs();
- // }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voResetCoef(ALM_RESET_COFIN *in, ALM_RESET_COF *out)
- {
- if (in->uwUbVt < 1)
- {
- in->uwUbVt = 1;
- }
- out->ulRecAllValCt = ((ULONG)in->uwRecAllTs * in->uwFTbcHz) / 1000; // TBC_S2CT(x) ((ULONG)(x)*FTBC_HZ)
- out->ulIPMOcRecValCt = ((ULONG)in->uwIpmOcRecTs * in->uwFTbcHz) / 1000;
- out->ulOvrVltRecValPu = ((ULONG)in->uwOvrVltRecVt << 14) / in->uwUbVt;
- out->ulOvrVltRecValCt = ((ULONG)in->uwOvrVltRecTs * in->uwFTbcHz) / 1000;
- out->ulOvrVltRec1ValCt = ((ULONG)in->uwOvrVltRec1Ts * in->uwFTbcHz) / 1000;
- out->ulUndrVltRecValPu = ((ULONG)in->uwUndrVltRecVt << 14) / in->uwUbVt;
- out->ulUndrVltRecValCt = ((ULONG)in->uwUndrVltRecTs * in->uwFTbcHz) / 1000;
- out->ulUndrVltRec1ValCt = ((ULONG)in->uwUndrVltRec1Ts * in->uwFTbcHz) / 1000;
- out->uwIPMOvrHeatRecValCe = in->uwIpmOvrHeatRecCe;
- out->ulIPMOvrHeatRecValCt = (ULONG)in->uwIpmOvrHeatRecTs * in->uwFTbcHz;
- out->ulIPMOvrHeatRec1ValCt = (ULONG)in->uwIpmOvrHeatRec1Ts * in->uwFTbcHz;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voReset(const ALM_IN *in, const ALM_RESET_COF *coef) /* parasoft-suppress METRICS-28 "本项目圈复杂度无法更改,后续避免" */
- {
- /*=======================================================================
- Recover condition
- =======================================================================*/
- /* Recover time of global */
- if (alm_stRecCt.ulGlbl < coef->ulRecAllValCt) // 200ms
- {
- alm_stRecCt.ulGlbl++;
- }
- /* Recover time of IPM OC */
- if (alm_stRecCt.ulIPMOC < coef->ulIPMOcRecValCt) // 100ms
- {
- alm_stRecCt.ulIPMOC++;
- }
- /* Recover time of over voltage */
- if (in->uwVdcPu < coef->ulOvrVltRecValPu) // 450v
- {
- if (alm_stRecCt.ulOvrVlt < coef->ulOvrVltRecValCt) // 100ms
- {
- alm_stRecCt.ulOvrVlt++;
- }
- alm_stRecCt.ulOvrVlt1 = 0;
- }
- else
- {
- if (alm_stRecCt.ulOvrVlt1 < coef->ulOvrVltRec1ValCt) // 150ms
- {
- alm_stRecCt.ulOvrVlt1++;
- }
- alm_stRecCt.ulOvrVlt = 0;
- }
- /* Recover time of under voltage */
- if (in->uwVdcPu > coef->ulUndrVltRecValPu) // 30v
- {
- if (alm_stRecCt.ulUndrVlt < coef->ulUndrVltRecValCt) // 100ms
- {
- alm_stRecCt.ulUndrVlt++;
- }
- }
- else
- {
- if (alm_stRecCt.ulUndrVlt1 < coef->ulUndrVltRec1ValCt) // 150ms
- {
- // alm_stRecCt.ulUndrVlt1++;
- }
- }
- /* Recover time of IPM over heat */
- if (in->uwIPMTempCe < coef->uwIPMOvrHeatRecValCe) // 75
- {
- if (alm_stRecCt.ulIPMOvrHeat < coef->ulIPMOvrHeatRecValCt) // 60s
- {
- alm_stRecCt.ulIPMOvrHeat++;
- }
- alm_stRecCt.ulIPMOvrHeat1 = 0;
- }
- else
- {
- if (alm_stRecCt.ulIPMOvrHeat1 < coef->ulIPMOvrHeatRec1ValCt) // 120s
- {
- alm_stRecCt.ulIPMOvrHeat1++;
- }
- alm_stRecCt.ulIPMOvrHeat = 0;
- }
- /*=======================================================================
- Alarm code clear
- =======================================================================*/
- if (alm_stRecCt.ulGlbl >= coef->ulRecAllValCt) // 200ms
- {
- /* IPM fault */
- if ((alm_unCode.bit.IPMFlt == TRUE) && (alm_stRecCt.ulIPMOC >= coef->ulIPMOcRecValCt))
- {
- MCU_BRKIN_FLG_CLR; /* Clear TIME0 break flag */
- MCU_POEN_FLG_EN; /* Enable TIME0 Channel outputs */
- alm_unCode.bit.IPMFlt = 0;
- }
- /* Over current */
- if (alm_unCode.bit.OvrCur != 0)
- {
- alm_stDecCt.ulOvrCur = 0;
- alm_unCode.bit.OvrCur = 0;
- }
- /* Over voltage */
- if (alm_unCode.bit.OvrVlt != 0)
- {
- if ((alm_stRecCt.ulOvrVlt >= coef->ulOvrVltRecValCt) || (alm_stRecCt.ulUndrVlt1 >= coef->ulOvrVltRec1ValCt)) // 4s 20s
- {
- alm_stDecCt.ulOvrVltLvl1 = 0;
- alm_stDecCt.ulOvrVltLvl2 = 0;
- alm_stDecCt.ulOvrVltLvl3 = 0;
- alm_unCode.bit.OvrVlt = 0;
- }
- }
- /* Under voltage */
- if (alm_unCode.bit.UndrVlt != 0)
- {
- if ((alm_stRecCt.ulUndrVlt >= coef->ulUndrVltRecValCt) || (alm_stRecCt.ulUndrVlt1 >= coef->ulUndrVltRec1ValCt)) // 4s 20s
- {
- alm_stDecCt.ulUndrVltLvl1 = 0;
- alm_stDecCt.ulUndrVltLvl2 = 0;
- alm_unCode.bit.UndrVlt = 0;
- }
- }
- /* IPM over heat */
- if (alm_unCode.bit.IPMOvrHeat != 0)
- {
- if (alm_stRecCt.ulIPMOvrHeat >= coef->ulIPMOvrHeatRecValCt)
- {
- alm_stDecCt.ulIPMOvrHeat = 0;
- alm_stDecCt.ulIPMOvrHeat1 = 0;
- alm_unCode.bit.IPMOvrHeat = 0;
- alm_pvt_blIPMOTReCheckFlg = FALSE;
- }
- else if (alm_stRecCt.ulIPMOvrHeat1 >= coef->ulIPMOvrHeatRec1ValCt)
- {
- alm_stDecCt.ulIPMOvrHeat = 0;
- alm_stDecCt.ulIPMOvrHeat1 = 0;
- alm_unCode.bit.IPMOvrHeat = 0;
- alm_pvt_blIPMOTReCheckFlg = TRUE;
- }
- else
- {
- //do noting
- }
- }
- /* Hall loss */
- if (alm_unCode.bit.HallLoss != 0)
- {
- alm_unCode.bit.HallLoss = 0;
- }
-
- /* Spi Thete Fault */
- if((alm_unCode.bit.SpiThetaFlt != 0) && (!in->blSpiThetaFltFlg))
- {
- alm_unCode.bit.SpiThetaFlt = 0;
- }
- /* Phase loss */
- if (alm_unCode.bit.PhsLoss != 0)
- {
- alm_stDecCt.ulPhsALoss = 0;
- alm_stDecCt.ulPhsBLoss = 0;
- alm_stDecCt.ulPhsCLoss = 0;
- alm_unCode.bit.PhsLoss = 0;
- }
- /* Rotor lock */
- if (alm_unCode.bit.RotorLock != 0)
- {
- alm_stDecCt.slRotorLock = 0;
- alm_unCode.bit.RotorLock = 0;
- }
- /* Communication over time */
- if (alm_unCode.bit.CommOvrTm != 0)
- {
- alm_unCode.bit.CommOvrTm = 0;
- }
- if (alm_unCode.bit.ADCOffsetFlt != 0)
- {
- /* ADC init */
- adc_stDownOut.ulIdcRegSum = 0;
- adc_stDownOut.ulUaRegSum = 0;
- adc_stDownOut.ulUbRegSum = 0;
- adc_stDownOut.ulUcRegSum = 0;
- adc_stDownOut.uwADCCalibCt = 0;
- adc_stDownOut.blADCCalibFlg = FALSE;
- adc_stUpOut.uwADCCalibCt = 0;
- adc_stUpOut.blADCCalibFlg = FALSE;
- sysfsm_stFlg.blADCInitOvrFlg = FALSE;
- alm_unCode.bit.ADCOffsetFlt = 0;
- }
- }
- /*=======================================================================
- Alarm flag clear
- =======================================================================*/
- if (alm_unCode.all==0)
- {
- /* Clear alarm action */
- alm_unAction.all = 0;
- /* Clear stop count */
- alm_stStopCt.ulThrPhsShrtFrc = 0;
- alm_stStopCt.ulPWMOff = 0;
- alm_stStopCt.ulThrPhsShrt = 0;
- alm_stStopCt.uwRotorStopCnt = 0;
- alm_stStopCt.ulPWMOffShrtSw = 0;
- alm_stStopCt.ulShrtPWMOffSw = 0;
- /* Clear recover count */
- alm_stRecCt.ulGlbl = 0;
- alm_stRecCt.ulOvrVlt = 0;
- alm_stRecCt.ulOvrVlt1 = 0;
- alm_stRecCt.ulUndrVlt = 0;
- alm_stRecCt.ulUndrVlt1 = 0;
- alm_stRecCt.ulIPMOvrHeat = 0;
- alm_stRecCt.ulIPMOvrHeat1 = 0;
- alm_stRecCt.ulIPMOC = 0;
- /* Clear alarm flag */
- alm_blAlmOccrFlg = FALSE;
- alm_blAlmSingleRecordDoneFlg = FALSE;
- alm_blPowerDownFlg = FALSE;
- /* Clear speed command*/
- // cmd_swSpdRefPu = 0;
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voHandleRst(void)
- {
- alm_enFSMStatus = Alm_Stop;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voDetec200MSCoef(ALM_DETEC200MS_COFIN *in, ALM_DETEC200MS_COF *out)
- {
- if (in->uwFbHz < 1)
- {
- in->uwFbHz = 1;
- }
- out->swMotorSpdMinPu = (SWORD)(((SLONG)in->swMotorSpdMinRpm << 15) / (SWORD)60 * (SWORD)in->uwPairs / (SWORD)in->uwFbHz);
- out->uwBikeSpdFltCt = in->uwBikeSpdFltTs * in->uwFT200MSHz;
- out->uwCadenceFltCt = in->uwCadenceFltTs * in->uwFT200MSHz;
- out->uwTorqFltCt = in->uwTorqFltTs * in->uwFT200MSHz;
- out->uwThrottleFltCt = in->uwThrottleFltTs * in->uwFT200MSHz;
- out->uwPCBNTCFltCt = in->uwPCBNTCFltTs * in->uwFT200MSHz;
- out->uwMotorNTCFltCt = in->uwMotorNTCFltTs * in->uwFT200MSHz;
-
- out->uwTorqMaxReg = (UWORD)((ULONG)in->uwTorqMaxVol * 4096 / 33);
- out->uwTorqMinReg = (UWORD)((ULONG)in->uwTorqMinVol * 4096 / 33);
- out->uwThrottleMaxReg = (UWORD)((ULONG)in->uwThrottleMaxVol * 4096 / 33);
- out->uwThrottleMinReg = (UWORD)((ULONG)in->uwThrottleMinVol * 4096 / 33);
- out->uwNTCMaxReg = (UWORD)((ULONG)in->uwNTCMaxVol * 4096 / 33);
- out->uwNTCMinReg = (UWORD)((ULONG)in->uwNTCMinVol * 4096 / 33);
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voDetec200MS(const ALM_BIKE_IN *in, const ALM_DETEC200MS_COF *coef) /* parasoft-suppress METRICS-28 "本项目圈复杂度无法更改,后续避免" */
- {
- /** Bike sensors judge each other **/
- /* Bike speed sensor fault */
- if(in->uwCadenceFreqPu > 0)
- {
- if(in->uwBikeSpdPu == 0)
- {
- alm_stDecCt.uwBikeSpdFlt ++;
- if(alm_stDecCt.uwBikeSpdFlt >= coef->uwBikeSpdFltCt)
- {
- alm_stDecCt.uwBikeSpdFlt = coef->uwBikeSpdFltCt;
- alm_unBikeCode.bit.BikeSpdSen = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else if(in->blBikeSpdOvrFlg)
- {
- alm_unBikeCode.bit.BikeSpdSen = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- else
- {
- alm_stDecCt.uwBikeSpdFlt = 0;
- }
- }
- else
- {
- alm_stDecCt.uwBikeSpdFlt = 0;
- }
-
- /* Bike cadence sensor fault */
- if(in->uwBikeSpdPu > 0)
- {
- if(in->uwTroqPu > ass_stCalCoef.uwAssThreshold)
- {
- if(in->uwCadenceFreqPu == 0)
- {
- alm_stDecCt.uwCadenceFlt ++;
- if(alm_stDecCt.uwCadenceFlt >= coef->uwCadenceFltCt)
- {
- alm_stDecCt.uwCadenceFlt = coef->uwCadenceFltCt;
- alm_unBikeCode.bit.CadenceSen = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else if(in->blCadenceFreqOvrFlg)
- {
- alm_unBikeCode.bit.CadenceSen = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- else
- {
- alm_stDecCt.uwCadenceFlt = 0;
- }
- }
- else
- {
- alm_stDecCt.uwCadenceFlt = 0;
- }
- }
- else
- {
- alm_stDecCt.uwCadenceFlt = 0;
- }
-
- /* Bike torque sensor fault */
- if((in->uwTroqReg < coef->uwTorqMinReg) || (in->uwTroqReg >= coef->uwTorqMaxReg)) //Fault: U_Torq < 0.1V or >=3V
- {
- alm_stDecCt.uwTorqFlt ++;
- if(alm_stDecCt.uwTorqFlt >= coef->uwTorqFltCt)
- {
- alm_stDecCt.uwTorqFlt = coef->uwTorqFltCt;
- alm_unBikeCode.bit.TorqSen = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.uwTorqFlt = 0;
- }
-
- /* Bike throttle fault */
- if(in->blThrottleExistFlg)
- {
- if((in->uwThrottleReg < coef->uwThrottleMinReg) || (in->uwThrottleReg >= coef->uwThrottleMaxReg)) // Fault: U_Throttle < 0.1V or >=3V
- {
- alm_stDecCt.uwThrottleFlt ++;
- if(alm_stDecCt.uwThrottleFlt >= coef->uwThrottleFltCt)
- {
- alm_stDecCt.uwThrottleFlt = coef->uwThrottleFltCt;
- alm_unBikeCode.bit.Throttle = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.uwThrottleFlt = 0;
- }
- }
-
- /* PCB NTC fault */
- if((in->uwPCBNTCReg < coef->uwNTCMinReg) || (in->uwPCBNTCReg > coef->uwNTCMaxReg)) // Fault: NTC>100k or <0.032k
- {
- alm_stDecCt.uwPCBNTCFlt ++;
- if(alm_stDecCt.uwPCBNTCFlt >= coef->uwPCBNTCFltCt)
- {
- alm_stDecCt.uwPCBNTCFlt = coef->uwPCBNTCFltCt;
- alm_unBikeCode.bit.PCBNTC = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.uwPCBNTCFlt = 0;
- }
-
- /* Motor NTC fault */
- if(in->blMotorNTCExistFlg)
- {
- if((in->uwMotorNTCReg < coef->uwNTCMinReg) || (in->uwMotorNTCReg > coef->uwNTCMaxReg)) // Fault: NTC>100k or <0.032k
- {
- alm_stDecCt.uwMotorNTCFlt ++;
- if(alm_stDecCt.uwMotorNTCFlt >= coef->uwMotorNTCFltCt)
- {
- alm_stDecCt.uwMotorNTCFlt = coef->uwMotorNTCFltCt;
- alm_unBikeCode.bit.MotorNTC = 1;
- alm_unAction.bit.PWMOff = 1;
- }
- }
- else
- {
- alm_stDecCt.uwMotorNTCFlt = 0;
- }
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voHandle1MS(const ALM_BIKE_IN *in)
- {
- if(alm_unBikeCode.all != 0)
- {
- /* Alarm handle FSM */
- switch (alm_enBikeFSMStatus)
- {
- case Alm_Stop:
- if (alm_unAction.bit.PWMOff != 0)
- {
- alm_stStopCt.ulBikePWMOff++;
- hw_voPWMOff();
- if (alm_stStopCt.ulBikePWMOff > 200) // 200ms, SysFault_hook, Event 1ms
- {
- cmfsm_stFlg.blMotorStopFlg = TRUE;
- alm_stStopCt.ulBikePWMOff = 0;
- }
- }
-
- if (cmfsm_stFlg.blMotorStopFlg)
- {
- sysfsm_stFlg.blFSMRstOvrFlg = FALSE; // Enable control mode FSM reset
- sysfsm_stFlg.blCtrlMdVarClcOvrFlg = FALSE; // Enable control mode variable clear
- alm_enBikeFSMStatus = Alm_VarClc;
- }
- break;
- case Alm_VarClc:
- if (sysfsm_stFlg.blFSMRstOvrFlg && sysfsm_stFlg.blCtrlMdVarClcOvrFlg)
- {
- alm_enBikeFSMStatus = Alm_Reset;
- }
- break;
- case Alm_Reset:
- alm_voReset1MS(in, &alm_stReset1MSCoef, &alm_stDetect200MSCoef);
- break;
- default:
- break;
- }
-
- }
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voReset1MSCoef(const ALM_RESET1MS_COFIN *in, ALM_RESET1MS_COF *out)
- {
- out->ulRecAllValCt = (ULONG)in->uwBikeGlblTm * in->uwFT1MSHz / 1000;
- out->ulRecBikeSpdCt = (ULONG)in->uwBikeSpdFltTm * in->uwFT1MSHz / 1000;
- out->ulRecCadenceCt = (ULONG)in->uwCadenceFltTm * in->uwFT1MSHz / 1000;
- out->ulRecTorqCt = (ULONG)in->uwTorqFltTm * in->uwFT1MSHz / 1000;
- out->ulRecThrottleCt = (ULONG)in->uwThrottleFltTm * in->uwFT1MSHz / 1000;
- out->ulRecPCBNTCCt = (ULONG)in->uwPCBNTCFltTm * in->uwFT1MSHz / 1000;
- out->ulRecMotorNTCCt = (ULONG)in->uwMotorNTCFltTm * in->uwFT1MSHz / 1000;
- }
- /***************************************************************
- Function:
- Description:
- Call by:
- Input Variables:
- Output/Return Variables:
- Subroutine Call:
- Reference:
- ****************************************************************/
- void alm_voReset1MS(const ALM_BIKE_IN *in, const ALM_RESET1MS_COF *coef, const ALM_DETEC200MS_COF *detctcoef) /* parasoft-suppress METRICS-28 "本项目圈复杂度无法更改,后续避免" */
- {
- /*=======================================================================
- Recover condition
- =======================================================================*/
- /* Recover time of global */
- if (alm_stRecCt.ulBikeGlbl < coef->ulRecAllValCt) // 1s
- {
- alm_stRecCt.ulBikeGlbl++;
- }
- /* Recover time of bike speed sensor fault */
- if((!in->blBikeSpdOvrFlg) && (in->uwBikeSpdPu > 0))
- {
- if(alm_stRecCt.ulBikeSpdFlt < coef->ulRecBikeSpdCt)
- {
- alm_stRecCt.ulBikeSpdFlt++;
- }
- }
-
- /* Recover time of bike candence sensor fault */
- if((!in->blCadenceFreqOvrFlg) && (in->uwCadenceFreqPu > 0))
- {
- if (alm_stRecCt.ulCadenceFlt < coef->ulRecCadenceCt)
- {
- alm_stRecCt.ulCadenceFlt++;
- }
- }
-
- /* Recover time of bike torque sensor fault */
- if((in->uwTroqReg > detctcoef->uwTorqMinReg) && (in->uwTroqReg < detctcoef->uwTorqMaxReg))
- {
- if (alm_stRecCt.ulTorqFlt < coef->ulRecTorqCt)
- {
- alm_stRecCt.ulTorqFlt++;
- }
- }
- else
- {
- alm_stRecCt.ulTorqFlt = 0;
- }
-
- /* Recover time of bike throttle fault */
- if((in->uwThrottleReg > detctcoef->uwThrottleMinReg) && (in->uwThrottleReg < detctcoef->uwThrottleMaxReg))
- {
- if (alm_stRecCt.ulThrottleFlt < coef->ulRecThrottleCt)
- {
- alm_stRecCt.ulThrottleFlt++;
- }
- }
- else
- {
- alm_stRecCt.ulThrottleFlt = 0;
- }
-
- /* Recover time of PCB NTC fault */
- if((in->uwPCBNTCReg > detctcoef->uwNTCMinReg) && (in->uwThrottleReg < detctcoef->uwNTCMaxReg))
- {
- if (alm_stRecCt.ulPCBNTCFlt < coef->ulRecPCBNTCCt)
- {
- alm_stRecCt.ulPCBNTCFlt++;
- }
- }
- else
- {
- alm_stRecCt.ulPCBNTCFlt = 0;
- }
-
- /* Recover time of motor NTC fault */
- if((in->uwPCBNTCReg > detctcoef->uwNTCMinReg) && (in->uwThrottleReg < detctcoef->uwNTCMaxReg))
- {
- if (alm_stRecCt.ulMotorNTCFlt < coef->ulRecMotorNTCCt)
- {
- alm_stRecCt.ulMotorNTCFlt++;
- }
- }
- else
- {
- alm_stRecCt.ulMotorNTCFlt = 0;
- }
-
- /*=======================================================================
- Alarm code clear
- =======================================================================*/
- if (alm_stRecCt.ulBikeGlbl >= coef->ulRecAllValCt)
- {
- /* Bike speed sensor fault */
- if((alm_unBikeCode.bit.BikeSpdSen != 0) && (alm_stRecCt.ulBikeSpdFlt >= coef->ulRecBikeSpdCt))
- {
- alm_stDecCt.uwBikeSpdFlt = 0;
- alm_unBikeCode.bit.BikeSpdSen = 0;
- }
-
- /* Bike cadence sensor fault */
- if((alm_unBikeCode.bit.CadenceSen != 0) && (alm_stRecCt.ulCadenceFlt >= coef->ulRecCadenceCt))
- {
- alm_stDecCt.uwCadenceFlt = 0;
- alm_unBikeCode.bit.CadenceSen = 0;
- }
-
- /* Bike torque sensor fault */
- if((alm_unBikeCode.bit.TorqSen != 0) && (alm_stRecCt.ulTorqFlt >= coef->ulRecTorqCt))
- {
- alm_stDecCt.uwTorqFlt = 0;
- alm_unBikeCode.bit.TorqSen = 0;
- }
-
- /* Bike throttle fault */
- if((alm_unBikeCode.bit.Throttle != 0) && (alm_stRecCt.ulThrottleFlt >= coef->ulRecThrottleCt))
- {
- alm_stDecCt.uwThrottleFlt = 0;
- alm_unBikeCode.bit.Throttle = 0;
- }
-
- /* PCB NTC fault */
- if((alm_unBikeCode.bit.PCBNTC != 0) && (alm_stRecCt.ulPCBNTCFlt >= coef->ulRecPCBNTCCt))
- {
- alm_stDecCt.uwPCBNTCFlt = 0;
- alm_unBikeCode.bit.PCBNTC = 0;
- }
-
- /* Motor NTC fault */
- if((alm_unBikeCode.bit.MotorNTC != 0) && (alm_stRecCt.ulMotorNTCFlt >= coef->ulRecMotorNTCCt))
- {
- alm_stDecCt.uwMotorNTCFlt = 0;
- alm_unBikeCode.bit.MotorNTC = 0;
- }
-
- }
-
- /*=======================================================================
- Alarm flag clear
- =======================================================================*/
- if(alm_unBikeCode.all == 0)
- {
- /* Clear stop count */
- alm_stStopCt.ulBikePWMOff = 0;
-
- /* Clear recover count */
- alm_stRecCt.ulBikeGlbl = 0;
- alm_stRecCt.ulBikeSpdFlt = 0;
- alm_stRecCt.ulCadenceFlt = 0;
- alm_stRecCt.ulTorqFlt = 0;
- alm_stRecCt.ulThrottleFlt = 0;
- alm_stRecCt.ulPCBNTCFlt = 0;
- alm_stRecCt.ulMotorNTCFlt = 0;
- }
- }
- /*************************************************************************
- Local Functions (N/A)
- *************************************************************************/
- /************************************************************************
- Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
- All rights reserved.
- *************************************************************************/
- #ifdef _ALARM_C_
- #undef _ALARM_C_ /* parasoft-suppress MISRA2004-19_6 "本项目中无法更改,后续避免使用" */
- #endif
- /*************************************************************************
- End of this File (EOF):
- !!!!!!Do not put anything after this part!!!!!!!!!!!
- *************************************************************************/
|