I have tried to use a breakoutboard TFT/TS/SD designed for UNO on the DUE.
I faced an issue while having both YP (for TS) and TFT CS on the same A3 pin.
I tracked down to wiring_analog.c nd found out that whatever I could do from the outside, reading YP would keep the adc channel locked (even when use afterward in "digital" way for CS).
The effect was that the screen was first displayed well but never updated after trying to monitor the touchscreen (TS) location.
Thus, I'd like to propose the change to move the following code
if ( latestSelectedChannel != (uint32_t)-1 ) adc_disable_channel( ADC, latestSelectedChannel ); latestSelectedChannel = (uint32_t)-1 ;
down to after the
// Read the value
ulValue = adc_get_latest_value(ADC);
ulValue = mapResolution(ulValue, ADC_RESOLUTION, _readResolution);
on line 165.
At least, that solves my problem and the only side effect I see is if I would pull a lot of analog data in from the same pin, the code won't be that efficient.
Please let me know your thoughts you "old timer gurus" and if OK, how to commit?