diff --git a/KSM-Line-2.2.tpr b/KSM-Line-2.2.tpr index e1c2283..b610f2e 100644 --- a/KSM-Line-2.2.tpr +++ b/KSM-Line-2.2.tpr @@ -22,7 +22,7 @@ address=0.48.72.100.118.81 [address4] platform=TPP2W(G2) transport=udp_broadcast -address=0.36.119.82.255.193 +address=0.36.119.86.22.3 [file1] path=main.tc type=c diff --git a/encoder.tc b/encoder.tc index b31c27f..f07eab9 100644 --- a/encoder.tc +++ b/encoder.tc @@ -14,13 +14,21 @@ bool inited = false; int center; 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(){ count = 0; config.STORE_ENCODER = false; for (int i = 0; i< SENSORS;i++){ portVector[i]=-1; } - int intnum = ((int)(config.EncoderCfg.encoderPort/4)); + int intnum = interrupt[((int)(config.EncoderCfg.encoderPort/4))-1]; center = config.EncoderCfg.encoderInterval/2; for (char i = 0; i < ENCWORKER; i++){ works[i].Enabled = false; diff --git a/global.th b/global.th index 055901e..03fef44 100644 --- a/global.th +++ b/global.th @@ -9,7 +9,7 @@ #message "link global not defined" #endif -#define VERSION "2.0b_1904291745" +#define VERSION "2.0b_1905211755" #define MAX_FIFO_SIZE 20 #define BRAKER_COUNT 3 @@ -131,3 +131,4 @@ extern BrakerProcess brakers[BRAKER_COUNT]; +