Skip to content

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

@andrewjohnsen31

Description

@andrewjohnsen31

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions