From 66aca256625fda65ec23a142d30ea622a33c051b Mon Sep 17 00:00:00 2001 From: Alex Warm Date: Mon, 18 Feb 2019 18:05:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BE=20=D1=81?= =?UTF-8?q?=D1=87=D0=B5=D1=82=D1=87=D0=B8=D0=BA=D0=B5=20=D0=B5=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=D1=80=D0=B0=201902181804?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- encoder.tc | 7 +++++++ global.th | 3 ++- net.tc | 10 ++++++++++ net.th | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) 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