Отправка данных о счетчике енкодера 1902181804
This commit is contained in:
parent
5904a3045a
commit
66aca25662
|
|
@ -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<len(config.EncoderCfg.workedPorts);i++){
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#message "link global not defined"
|
||||
#endif
|
||||
|
||||
#define VERSION "2.0b_1902121725"
|
||||
#define VERSION "2.0b_1902181804"
|
||||
#define MAX_FIFO_SIZE 20
|
||||
#define BRAKER_COUNT 3
|
||||
|
||||
|
|
@ -125,3 +125,4 @@ extern BrakerProcess brakers[BRAKER_COUNT];
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
10
net.tc
10
net.tc
|
|
@ -124,6 +124,16 @@ void send_sensor(int number, bool state){
|
|||
sock.send();
|
||||
}
|
||||
}
|
||||
void send_encoder_tick(int number, unsigned long count){
|
||||
sock.num = 0;
|
||||
if (sock.statesimple == PL_SSTS_EST){
|
||||
if (config.debug.SensorsLook)
|
||||
d("Send sensor tick "+str(number)+" : "+stri(count));
|
||||
sock.setdata("enc="+str(number)+":"+(lstri(count))+chr(13)+chr(10));
|
||||
sock.send();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void net_send_data(int sock_num,string data){
|
||||
int n = sock.num;
|
||||
|
|
|
|||
Loading…
Reference in New Issue