Fix interrupt number 1905211755

This commit is contained in:
Иван Мокротоваров 2019-05-21 17:55:48 +03:00
parent 86a6ed85bd
commit 00f8e7bdcf
3 changed files with 12 additions and 3 deletions

View File

@ -22,7 +22,7 @@ address=0.48.72.100.118.81
[address4] [address4]
platform=TPP2W(G2) platform=TPP2W(G2)
transport=udp_broadcast transport=udp_broadcast
address=0.36.119.82.255.193 address=0.36.119.86.22.3
[file1] [file1]
path=main.tc path=main.tc
type=c type=c

View File

@ -14,13 +14,21 @@ bool inited = false;
int center; int center;
unsigned long count; unsigned long count;
#if PLATFORM_ID==TPP2WG2
int interrupt[4] = {1,2,1,2};
#endif
#if PLATFORM_ID==TPP3WG2
int interrupt[4] = {1,5,2,6};
#endif
void encoder_init(){ void encoder_init(){
count = 0; count = 0;
config.STORE_ENCODER = false; config.STORE_ENCODER = false;
for (int i = 0; i< SENSORS;i++){ for (int i = 0; i< SENSORS;i++){
portVector[i]=-1; portVector[i]=-1;
} }
int intnum = ((int)(config.EncoderCfg.encoderPort/4)); int intnum = interrupt[((int)(config.EncoderCfg.encoderPort/4))-1];
center = config.EncoderCfg.encoderInterval/2; center = config.EncoderCfg.encoderInterval/2;
for (char i = 0; i < ENCWORKER; i++){ for (char i = 0; i < ENCWORKER; i++){
works[i].Enabled = false; works[i].Enabled = false;

View File

@ -9,7 +9,7 @@
#message "link global not defined" #message "link global not defined"
#endif #endif
#define VERSION "2.0b_1904291745" #define VERSION "2.0b_1905211755"
#define MAX_FIFO_SIZE 20 #define MAX_FIFO_SIZE 20
#define BRAKER_COUNT 3 #define BRAKER_COUNT 3
@ -131,3 +131,4 @@ extern BrakerProcess brakers[BRAKER_COUNT];