This commit is contained in:
Rene Hopf
2017-01-09 15:01:05 +01:00
parent 45321fe590
commit 930b079a38

View File

@@ -84,6 +84,7 @@ RT_DEINIT(
FRT(
float p = mod(TIM_GetCounter(ENC1_TIM) * 2.0f * M_PI / (float)e_res);
PIN(pos) = p;
//TODO: this gets triggered by wire saving abs encoders. add timeout?
if(RISING_EDGE(!GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_11)) && PIN(isabs) != 1.0){
absoffset = -p;
PIN(isabs) = 1.0;