diff --git a/encoder.tc b/encoder.tc index 3d1096b..8ecaf3e 100644 --- a/encoder.tc +++ b/encoder.tc @@ -12,8 +12,10 @@ unsigned long calibrate_count[ENCWORKER]; char z[ENCWORKER]; bool inited = false; int center; +unsigned long count; void encoder_init(){ + count = 0; config.STORE_ENCODER = false; for (int i = 0; i< SENSORS;i++){ portVector[i]=-1; @@ -88,6 +90,8 @@ bool getEncEnabled(unsigned char port,bool value){ if (config.debug.EncoderDebug>2) d(str(port)+" не попал о окно "+str(works[portVector[port]].Count)); } t("enc_end"); + if (works[portVector[port]].State) + send_encoder_tick(port,count); return works[portVector[port]].State; } else{ @@ -99,8 +103,11 @@ bool getEncEnabled(unsigned char port,bool value){ } } + + void on_io_int(unsigned char linestate){ t("enc_int_start"); + count ++; string workers = vector[linestate-1]; if(calibrate_mode>0){ for (int i=0;i