Отключил необрабатываемый фолт
This commit is contained in:
parent
0238bb6a93
commit
9061a9aab7
@ -59,7 +59,7 @@ void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc)
|
||||
PWM_motor.UB = PERIOD_2 + B_proc;
|
||||
PWM_motor.UC = PERIOD_2 - C_proc;
|
||||
|
||||
FaultABC = FaultPWM;
|
||||
// FaultABC = FaultPWM;
|
||||
if(FaultABC) FaultABCFix = FaultABC;
|
||||
|
||||
if((FaultABC)||(FaultABCFix))
|
||||
|
@ -314,7 +314,7 @@ void SdfmInit(void)
|
||||
|
||||
|
||||
|
||||
void sdfmGet(uint16_t N)
|
||||
void sdfmGetResult(uint16_t N)
|
||||
{
|
||||
uint16_t i = 0;
|
||||
int32_t OffsetCount = 0;
|
||||
@ -323,7 +323,7 @@ void sdfmGet(uint16_t N)
|
||||
|
||||
FilterResult[N][loopCounter[N]] = *SdfmReadData[N];
|
||||
sdfmAdc[N] = FilterResult[N][loopCounter[N]] - sdfmOffset[N];
|
||||
if(N != 5) {
|
||||
if(N != SDFM_U_DC) {
|
||||
if(loopCounter[N] < MAX_SAMPLES) loopCounter[N]++;
|
||||
else
|
||||
{
|
||||
@ -333,6 +333,7 @@ void sdfmGet(uint16_t N)
|
||||
for(i = 0; i <= (MAX_SAMPLES-1); i++) OffsetCount += FilterResult[N][i];
|
||||
sdfmOffset[N] = OffsetCount>>FILTER_BIT;
|
||||
initDone[N] = 0xFF;
|
||||
if( (initDone[SDFM_IA] == 0xFF) && (initDone[SDFM_IB] == 0xFF) && (initDone[SDFM_IC] == 0xFF)) AllInitDone = 1;
|
||||
}
|
||||
else if(initDone[N] != 0xFF) initDone[N]--;
|
||||
}
|
||||
@ -369,11 +370,7 @@ void sdfm_check_all_current_measurements_was_done(void)
|
||||
if((sdfmIndex & SDFM_ALL_CURRENTS) == SDFM_ALL_CURRENTS)
|
||||
{
|
||||
sdfmIndex = 0;
|
||||
if(!AllInitDone)
|
||||
{
|
||||
if((initDone[SDFM_IA] == 0xFF)&&(initDone[SDFM_IB] == 0xFF)&&(initDone[SDFM_IC] == 0xFF)) AllInitDone = 1;
|
||||
}
|
||||
else
|
||||
if(AllInitDone)
|
||||
{
|
||||
vectorControl(sdfmAdc[SDFM_IA],sdfmAdc[SDFM_IB],sdfmAdc[SDFM_IC],sdfmAdc[SDFM_U_DC]);
|
||||
}
|
||||
@ -389,7 +386,7 @@ uint32_t IntFlags;
|
||||
IntFlags = Sdfm_readFlagRegister(SDFM1);
|
||||
sdfmIndex |= (IntFlags & 0xF000)>>12;
|
||||
|
||||
for(i = 0; i < 4; i++) if((uint16_t)IntFlags & (0x1000 << i)) sdfmGet(i);
|
||||
for(i = 0; i < 4; i++) if((uint16_t)IntFlags & (0x1000 << i)) sdfmGetResult(i);
|
||||
for(i = 0; i < 4; i++) if((uint16_t)IntFlags & (0x100 << i)) sdfmErr(i);
|
||||
|
||||
Sdfm_clearFlagRegister(SDFM1,IntFlags);
|
||||
@ -407,7 +404,7 @@ uint32_t IntFlags;
|
||||
IntFlags = Sdfm_readFlagRegister(SDFM2);
|
||||
sdfmIndex |= (IntFlags & 0xF000)>>8;
|
||||
|
||||
for(i = 0; i < 4; i++) if((uint16_t)IntFlags & (0x1000 << i)) sdfmGet(i+4);
|
||||
for(i = 0; i < 4; i++) if((uint16_t)IntFlags & (0x1000 << i)) sdfmGetResult(i+4);
|
||||
for(i = 0; i < 4; i++) if((uint16_t)IntFlags & (0x100 << i)) sdfmErr(i+4);
|
||||
|
||||
Sdfm_clearFlagRegister(SDFM2,IntFlags);
|
||||
|
Loading…
Reference in New Issue
Block a user