|
@@ -33,7 +33,6 @@ BIKETHROTTLE_OUT bikethrottle_stBikeThrottleOut = BIKETHROTTLE_OUT_DEFAUL
|
|
|
* extern Parameter
|
|
|
*
|
|
|
******************************/
|
|
|
-UWORD Bikethrottle_uwDMAReg = 0;
|
|
|
|
|
|
/***************************************************************
|
|
|
Function: bikethrottle_voBikeThrottleCof;
|
|
@@ -81,9 +80,10 @@ void bikethrottle_voBikeThrottleInit(void)
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolReg = 0;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolPu = 0;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = 0;
|
|
|
- bikethrottle_stBikeThrottleOut.blThrottleErrorFlg = FALSE;
|
|
|
+ bikethrottle_stBikeThrottleOut.uwThrottlePercent = 0;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt = 0;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleRecoverCnt = 0;
|
|
|
+ bikethrottle_stBikeThrottleOut.blThrottleErrorFlg = FALSE;
|
|
|
}
|
|
|
|
|
|
/***************************************************************
|
|
@@ -101,6 +101,7 @@ void bikethrottle_voBikeThrottleADC(void) // need to match ADC_StartConversion(A
|
|
|
{
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolPu = 0;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = 0;
|
|
|
+ bikethrottle_stBikeThrottleOut.uwThrottlePercent = 0;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleRecoverCnt++;
|
|
|
if (bikethrottle_stBikeThrottleOut.uwThrottleRecoverCnt == bikethrottle_stBikeThrottleCof.uwThrottleRecoverCnt)
|
|
|
{
|
|
@@ -116,7 +117,7 @@ void bikethrottle_voBikeThrottleADC(void) // need to match ADC_StartConversion(A
|
|
|
mth_voLPFilter((SWORD)bikethrottle_stBikeThrottleOut.uwThrottleVolPu, &scm_stBikeThrottleLpf);
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = scm_stBikeThrottleLpf.slY.sw.hi;
|
|
|
|
|
|
- if (bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu < bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu)
|
|
|
+ if (bikethrottle_stBikeThrottleOut.uwThrottleVolPu < bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu)
|
|
|
{
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = bikethrottle_stBikeThrottleCof.uwMinThrottleVolOutputPu;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt++;
|
|
@@ -126,7 +127,7 @@ void bikethrottle_voBikeThrottleADC(void) // need to match ADC_StartConversion(A
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt = 0;
|
|
|
}
|
|
|
}
|
|
|
- else if (bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu > bikethrottle_stBikeThrottleCof.uwMaxThrottleVolOutputPu)
|
|
|
+ else if (bikethrottle_stBikeThrottleOut.uwThrottleVolPu > bikethrottle_stBikeThrottleCof.uwMaxThrottleVolOutputPu)
|
|
|
{
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleVolLPFPu = bikethrottle_stBikeThrottleCof.uwMaxThrottleVolOutputPu;
|
|
|
bikethrottle_stBikeThrottleOut.uwThrottleErrorCnt++;
|