Merge pull request #180 from Autohome2/dec18_master
Auxin bug patch dec18
This commit is contained in:
commit
b35f9ad10f
|
@ -181,7 +181,7 @@
|
||||||
#define PIN_OUT16inv = "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
#define PIN_OUT16inv = "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||||
#define PIN_16inv = "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
#define PIN_16inv = "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||||
|
|
||||||
#define ANALOG_PIN = "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A8", "A10", "A11", "A12", "A13", "A14", "A15", $PIN_16inv, $PIN_16inv, $PIN_16inv
|
#define ANALOG_PIN = "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", $PIN_16inv, $PIN_16inv, $PIN_16inv
|
||||||
#define DIGITAL_PIN = "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
#define DIGITAL_PIN = "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||||
#define ANALOG_DIG_PIN_LIST = $DIGITAL_PIN, $ANALOG_PIN
|
#define ANALOG_DIG_PIN_LIST = $DIGITAL_PIN, $ANALOG_PIN
|
||||||
#define tsCanId_list = "CAN ID 0", "CAN ID 1", "CAN ID 2", "CAN ID 3", "CAN ID 4", "CAN ID 5", "CAN ID 6", "CAN ID 7", "CAN ID 8", "CAN ID 9", "CAN ID 10","CAN ID 11","CAN ID 12","CAN ID 13","CAN ID 14","INVALID"
|
#define tsCanId_list = "CAN ID 0", "CAN ID 1", "CAN ID 2", "CAN ID 3", "CAN ID 4", "CAN ID 5", "CAN ID 6", "CAN ID 7", "CAN ID 8", "CAN ID 9", "CAN ID 10","CAN ID 11","CAN ID 12","CAN ID 13","CAN ID 14","INVALID"
|
||||||
|
@ -2482,7 +2482,7 @@ menuDialog = main
|
||||||
displayOnlyField = "Off 1", blankfield, {},{(caninput_sel1a == 0 && (!enable_secondarySerial && (!enable_intcan || (enable_intcan && intcan_available == 0)))) || (caninput_sel1b == 0 && ((enable_secondarySerial && enable_intcan) || (enable_secondarySerial && !enable_intcan) || (!enable_secondarySerial && enable_intcan)))}
|
displayOnlyField = "Off 1", blankfield, {},{(caninput_sel1a == 0 && (!enable_secondarySerial && (!enable_intcan || (enable_intcan && intcan_available == 0)))) || (caninput_sel1b == 0 && ((enable_secondarySerial && enable_intcan) || (enable_secondarySerial && !enable_intcan) || (!enable_secondarySerial && enable_intcan)))}
|
||||||
displayOnlyField = "External Source 1 Via Secondary Serial", blankfield, {},{(caninput_sel1b == 1 && enable_secondarySerial && ((enable_intcan && intcan_available == 0) || !enable_intcan)) || (caninput_sel1b == 1 && enable_secondarySerial && (enable_intcan && intcan_available) && caninput_sel1extsourceb == 0)}
|
displayOnlyField = "External Source 1 Via Secondary Serial", blankfield, {},{(caninput_sel1b == 1 && enable_secondarySerial && ((enable_intcan && intcan_available == 0) || !enable_intcan)) || (caninput_sel1b == 1 && enable_secondarySerial && (enable_intcan && intcan_available) && caninput_sel1extsourceb == 0)}
|
||||||
displayOnlyField = "External Source 1 Via Internal CAN", blankfield, {},{(caninput_sel1b == 1 && enable_secondarySerial && (enable_intcan && intcan_available) && caninput_sel1extsourceb == 1) ||(caninput_sel1b == 1 && !enable_secondarySerial && (enable_intcan && intcan_available) && caninput_sel1extsourcec == 1)}
|
displayOnlyField = "External Source 1 Via Internal CAN", blankfield, {},{(caninput_sel1b == 1 && enable_secondarySerial && (enable_intcan && intcan_available) && caninput_sel1extsourceb == 1) ||(caninput_sel1b == 1 && !enable_secondarySerial && (enable_intcan && intcan_available) && caninput_sel1extsourcec == 1)}
|
||||||
field = "Local Analog Source 1 Pin No:", Auxin1pina , {}, {(caninput_sel1a == 2 && (!enable_secondarySerial && (!enable_intcan || (enable_intcan && intcan_available == 0)) || (caninput_sel1b == 2 && (enable_secondarySerial || enable_intcan))}
|
field = "Local Analog Source 1 Pin No:", Auxin1pina , {}, {(caninput_sel1a == 2 && (!enable_secondarySerial && (!enable_intcan || (enable_intcan && intcan_available == 0)))) || (caninput_sel1b == 2 && (enable_secondarySerial || (enable_intcan && intcan_available == 1 )))}
|
||||||
field = "Local Digital Source 1 Pin No:", Auxin1pinb , {}, {(caninput_sel1a == 3 && (!enable_secondarySerial && (!enable_intcan || (enable_intcan && intcan_available == 0)))) || (caninput_sel1b == 3 && (enable_secondarySerial || (enable_intcan && intcan_available == 1 )))}
|
field = "Local Digital Source 1 Pin No:", Auxin1pinb , {}, {(caninput_sel1a == 3 && (!enable_secondarySerial && (!enable_intcan || (enable_intcan && intcan_available == 0)))) || (caninput_sel1b == 3 && (enable_secondarySerial || (enable_intcan && intcan_available == 1 )))}
|
||||||
|
|
||||||
displayOnlyField = "Off 2", blankfield, {},{(caninput_sel2a == 0 && (!enable_secondarySerial && !enable_intcan)) || (caninput_sel2b == 0 && (enable_secondarySerial && enable_intcan)) || (caninput_sel2b == 0 && (enable_secondarySerial && !enable_intcan)) || (caninput_sel2b == 0 && (!enable_secondarySerial && enable_intcan))}
|
displayOnlyField = "Off 2", blankfield, {},{(caninput_sel2a == 0 && (!enable_secondarySerial && !enable_intcan)) || (caninput_sel2b == 0 && (enable_secondarySerial && enable_intcan)) || (caninput_sel2b == 0 && (enable_secondarySerial && !enable_intcan)) || (caninput_sel2b == 0 && (!enable_secondarySerial && enable_intcan))}
|
||||||
|
|
|
@ -83,6 +83,11 @@ void initialiseIdle()
|
||||||
//Enable channel compare interrupt (This is currently disabled as not in use)
|
//Enable channel compare interrupt (This is currently disabled as not in use)
|
||||||
//FTM2_C1SC |= FTM_CSC_CHIE;
|
//FTM2_C1SC |= FTM_CSC_CHIE;
|
||||||
|
|
||||||
|
FTM2_C1SC &= ~FTM_CSC_MSB; //According to Pg 965 of the K64 datasheet, this should not be needed as MSB is reset to 0 upon reset, but the channel interrupt fails to fire without it
|
||||||
|
FTM2_C1SC |= FTM_CSC_MSA; //Enable Compare mode
|
||||||
|
//Enable channel compare interrupt (This is currently disabled as not in use)
|
||||||
|
//FTM2_C1SC |= FTM_CSC_CHIE;
|
||||||
|
|
||||||
//Enable IRQ Interrupt
|
//Enable IRQ Interrupt
|
||||||
NVIC_ENABLE_IRQ(IRQ_FTM2);
|
NVIC_ENABLE_IRQ(IRQ_FTM2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -408,10 +408,11 @@ uint16_t readAuxanalog(uint8_t analogPin)
|
||||||
//read the Aux analog value for pin set by analogPin
|
//read the Aux analog value for pin set by analogPin
|
||||||
unsigned int tempReading;
|
unsigned int tempReading;
|
||||||
#if defined(ANALOG_ISR)
|
#if defined(ANALOG_ISR)
|
||||||
tempReading = fastMap1023toX(AnChannel[analogPin-A0], 511); //Get the current raw Auxanalog value
|
tempReading = fastMap1023toX(AnChannel[analogPin-A0], 1023); //Get the current raw Auxanalog value
|
||||||
#else
|
#else
|
||||||
tempReading = analogRead(analogPin);
|
tempReading = analogRead(analogPin);
|
||||||
tempReading = fastMap1023toX(analogRead(analogPin), 511); //Get the current raw Auxanalog value
|
tempReading = analogRead(analogPin);
|
||||||
|
//tempReading = fastMap1023toX(analogRead(analogPin), 511); Get the current raw Auxanalog value
|
||||||
#endif
|
#endif
|
||||||
return tempReading;
|
return tempReading;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1074,16 +1074,16 @@ void loop()
|
||||||
|| (((configPage9.enable_secondarySerial == 0) && (configPage9.enable_intcan == 0)) && ((configPage9.caninput_sel[currentStatus.current_caninchannel]&3) == 2)))
|
|| (((configPage9.enable_secondarySerial == 0) && (configPage9.enable_intcan == 0)) && ((configPage9.caninput_sel[currentStatus.current_caninchannel]&3) == 2)))
|
||||||
{ //if current input channel is enabled as analog local pin
|
{ //if current input channel is enabled as analog local pin
|
||||||
//read analog channel specified
|
//read analog channel specified
|
||||||
//currentStatus.canin[13] = 13; Dev test use only!
|
//currentStatus.canin[13] = (configPage9.Auxinpina[currentStatus.current_caninchannel]&63); Dev test use only!127
|
||||||
currentStatus.canin[currentStatus.current_caninchannel] = readAuxanalog(configPage9.Auxinpina[currentStatus.current_caninchannel]&127);
|
currentStatus.canin[currentStatus.current_caninchannel] = readAuxanalog(configPage9.Auxinpina[currentStatus.current_caninchannel]&63);
|
||||||
}
|
}
|
||||||
else if ((((configPage9.enable_secondarySerial == 1) || ((configPage9.enable_intcan == 1) && (configPage9.intcan_available == 1))) && (configPage9.caninput_sel[currentStatus.current_caninchannel]&12) == 12)
|
else if ((((configPage9.enable_secondarySerial == 1) || ((configPage9.enable_intcan == 1) && (configPage9.intcan_available == 1))) && (configPage9.caninput_sel[currentStatus.current_caninchannel]&12) == 12)
|
||||||
|| (((configPage9.enable_secondarySerial == 0) && ( (configPage9.enable_intcan == 1) && (configPage9.intcan_available == 0) )) && (configPage9.caninput_sel[currentStatus.current_caninchannel]&3) == 3)
|
|| (((configPage9.enable_secondarySerial == 0) && ( (configPage9.enable_intcan == 1) && (configPage9.intcan_available == 0) )) && (configPage9.caninput_sel[currentStatus.current_caninchannel]&3) == 3)
|
||||||
|| (((configPage9.enable_secondarySerial == 0) && (configPage9.enable_intcan == 0)) && ((configPage9.caninput_sel[currentStatus.current_caninchannel]&3) == 3)))
|
|| (((configPage9.enable_secondarySerial == 0) && (configPage9.enable_intcan == 0)) && ((configPage9.caninput_sel[currentStatus.current_caninchannel]&3) == 3)))
|
||||||
{ //if current input channel is enabled as digital local pin
|
{ //if current input channel is enabled as digital local pin
|
||||||
//read digital channel specified
|
//read digital channel specified
|
||||||
//currentStatus.canin[13] = 14; Dev test use only!
|
//currentStatus.canin[14] = ((configPage9.Auxinpinb[currentStatus.current_caninchannel]&63)+1); Dev test use only!127+1
|
||||||
currentStatus.canin[currentStatus.current_caninchannel] = readAuxdigital((configPage9.Auxinpinb[currentStatus.current_caninchannel]&127)+1);
|
currentStatus.canin[currentStatus.current_caninchannel] = readAuxdigital((configPage9.Auxinpinb[currentStatus.current_caninchannel]&63)+1);
|
||||||
} //Channel type
|
} //Channel type
|
||||||
} //For loop going through each channel
|
} //For loop going through each channel
|
||||||
} //aux channels are enabled
|
} //aux channels are enabled
|
||||||
|
|
Loading…
Reference in New Issue