less resolver ref delay

This commit is contained in:
Rene Hopf
2014-11-25 03:38:32 +01:00
parent 79b77ee78b
commit 66abf50734
+6 -2
View File
@@ -31,6 +31,12 @@ INIT(
);
FRT(
//noch auf enable prüfen?
if(ref){//eine halbwelle
GPIO_SetBits(GPIOC,GPIO_Pin_2);//erreger
}else{//andere halbwelle
GPIO_ResetBits(GPIOC,GPIO_Pin_2);//erreger
}
float t1;
float t2;
t1 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1)
@@ -51,13 +57,11 @@ FRT(
if(PIN(enable) > 0.0){//erreger signal aktiv
if(ref){//eine halbwelle
GPIO_SetBits(GPIOC,GPIO_Pin_2);//erreger
a1 = ((t1-t1_mid)*(t1-t1_mid)+(t2-t2_mid)*(t2-t2_mid)) * 0.1 + a1 * 0.9;
data[k][0][0] = t1 - t1_mid;
data[k][0][1] = t2 - t2_mid;
k++;
}else{//andere halbwelle
GPIO_ResetBits(GPIOC,GPIO_Pin_2);//erreger
a2 = ((t1_mid-t1)*(t1_mid-t1)+(t2_mid-t2)*(t2_mid-t2)) * 0.1 + a2 * 0.9;
data[l][1][0] = t1_mid - t1;
data[l][1][1] = t2_mid - t2;