Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TouchScreen.h does not work with Arduino UNO WiFi rev2 (__AVR_ATmega4809__) #27

Open
andrewjohnsen31 opened this issue Apr 22, 2020 · 3 comments

Comments

@andrewjohnsen31
Copy link
Contributor

This is a fairly simple issue that I think Could be easily fixed.
the defined for Rev2 is "AVR_ATmega4809" this in not included in current release.
I had purchased " 3.5" TFT 320X480 + TOUCHSCREEN BREAKOUT BOARD W/MICROSD SOCKET" and was following the setup instructions. Understanding that my rev2 board does not match the getting started instructions.

I went back a forth a bit, where this release works perfect with Arduino UNO, but not with rev2
Where the define is "AVR_ATmega328P"
Just switching boards give compile errors.

I spent a lot of time on this, so adding this board to TouchScreen.h could save someone else some time and frustration. Time is better spent playing with a really cool product.

Released Code
#if defined(AVR_ATmega328P) || defined(AVR_ATmega32U4) ||
defined(TEENSYDUINO) || defined(AVR_ATmega2560)
typedef volatile uint8_t RwReg;
#elif defined(ARDUINO_STM32_FEATHER)
typedef volatile uint32 RwReg;
#elif defined(NRF52_SERIES) || defined(ESP32) || defined(ESP8266) ||
defined(ARDUINO_ARCH_STM32)
typedef volatile uint32_t RwReg;
#else
typedef volatile uint32_t RwReg;
#endif

Recommended Change
#if defined(AVR_ATmega328P) || defined(AVR_ATmega32U4) ||
defined(TEENSYDUINO) || defined(AVR_ATmega2560) || defined(AVR_ATmega4809)
typedef volatile uint8_t RwReg;
#elif defined(ARDUINO_STM32_FEATHER)
typedef volatile uint32 RwReg;
#elif defined(NRF52_SERIES) || defined(ESP32) || defined(ESP8266) ||
defined(ARDUINO_ARCH_STM32)
typedef volatile uint32_t RwReg;
#else
typedef volatile uint32_t RwReg;
#endif

@ladyada
Copy link
Member

ladyada commented Apr 22, 2020

hi please try it and submit a working PR :)

@andrewjohnsen31
Copy link
Contributor Author

My first time with a pull request, yikes.
Its is an interesting song and dance, I like it and can only get better.

Let me know if more is needed.

@gluca
Copy link

gluca commented Jan 22, 2022

Same issue with Mega 1280 (and i guess same solution will work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants