Trying to set RTC and get compilation problem

Hi All, I'm getting this error trying tu use simple examples of RTC library with 3231 rtc module and
arduino MKR WiFi 1010
I have no idea what is wrong but I've use these components before without any problems.. the error happens in online editor i'll checkit in the normal ide to see if it behaves differently

In file included from /home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,

from /home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105,

from /home/builder/.arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/Arduino.h:35,

from /tmp/arduino-build-D0F24A9F48D68B45801BA2C7984B5853/sketch/DS3231_Auto_copy.ino.cpp:1:

/home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:487:38: error: expected ')' before '*' token

#define RTC ((Rtc *)0x40001400UL) /**< \brief (RTC) APB Base Address */

^

/tmp/734976349/DS3231_Auto_copy/DS3231_Auto_copy.ino:5:15: note: in expansion of macro 'RTC'

static DS3231 RTC;

^~~

/home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:487:38: error: expected ')' before '*' token

#define RTC ((Rtc *)0x40001400UL) /**< \brief (RTC) APB Base Address */

^

/tmp/734976349/DS3231_Auto_copy/DS3231_Auto_copy.ino:5:15: note: in expansion of macro 'RTC'

static DS3231 RTC;

thanks in advance for any help on this

Sounds like "RTC" is defined as a macro in the Mkr WiFi 1010 core.

Try changing "RTC" throughout your code to something else such as "myRTC".

2 Likes

Yess, silly me i've not seen that!! Thankyou very much
rtc is defined for the onboard rtc clock and I reuse rtc for the external
Thanks again!