MajicDesigns / MD_DS1307

DS1307 Real Time Clock Library
GNU Lesser General Public License v2.1
16 stars 8 forks source link

Using with M0 processor #6

Closed trlafleur closed 5 years ago

trlafleur commented 5 years ago

The pre-declaration of RTC cause error with M0 processors as RTC is predefined in the Atmel CMSIS-Atmel libraries...

I might suggest: or leave it to the user to create the instance define in his program.

class MD_DS1307 RTCLOCK;  // one instance created when the library is included

/Users/lafleur/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os  -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10805 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD  -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS  -DADAFRUIT_FEATHER_M0 -D__SAMD21G18A__ -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSBCON '-DUSB_MANUFACTURER="Adafruit"' '-DUSB_PRODUCT="Feather M0"'  "-I/Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/" "-I/Users/lafleur/Library/Arduino15/packages/adafruit/hardware/samd/1.2.7/cores/arduino" "-I/Users/lafleur/Library/Arduino15/packages/adafruit/hardware/samd/1.2.7/variants/feather_m0" "-I/Users/lafleur/Desktop/MySensor-Arduino-development/MCCI/libraries/Adafruit_GFX_Library" "-I/Users/lafleur/Desktop/MySensor-Arduino-development/MCCI/libraries/RGB_matrix_Panel" "-I/Users/lafleur/Desktop/MySensor-Arduino-development/MCCI/libraries/MD_DS1307/src" "-I/Users/lafleur/Library/Arduino15/packages/adafruit/hardware/samd/1.2.7/libraries/Wire" "-I/Users/lafleur/Library/Arduino15/packages/adafruit/hardware/samd/1.2.7/libraries/SPI" "/var/folders/53/f8mlg0xn1xv3fsm58phqmtb40000gn/T/arduino_build_327706/sketch/LED-Clock.ino.cpp" -o "/var/folders/53/f8mlg0xn1xv3fsm58phqmtb40000gn/T/arduino_build_327706/sketch/LED-Clock.ino.cpp.o"
In file included from /Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
                 from /Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105,
                 from /Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/sam.h:540,
                 from /Users/lafleur/Library/Arduino15/packages/adafruit/hardware/samd/1.2.7/cores/arduino/Arduino.h:48,
                 from /var/folders/53/f8mlg0xn1xv3fsm58phqmtb40000gn/T/arduino_build_327706/sketch/LED-Clock.ino.cpp:1:
/Users/lafleur/Library/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 */

~~
MajicDesigns commented 5 years ago

Fixed version 1.3.5