PaulStoffregen / Time

Time library for Arduino
http://playground.arduino.cc/code/time
1.24k stars 664 forks source link

Time library version 1.6.0 not compatible with TimeLib.h #141

Open ChrisB-1 opened 4 years ago

ChrisB-1 commented 4 years ago

Description

Describe your problem.

Update from 1.5.0 to 1.6.0 causes compile error, no longer compatible with TimeLib.h

Steps To Reproduce Problem

Install/Update Time library to 1.6.0 and include TimeLib.h

Downgrade Time library to 1.5.0 fixes it.

Hardware & Software

Board Industruino D21G IND.I/O with Ethernet Expansion Module Shields / modules used Arduino IDE version 1.8.10 Teensyduino version (if using Teensy) Version info & package name (from Tools > Boards > Board Manager) Operating system & version Windows 10 Any other software or hardware?

Arduino Sketch

The sketch is irrelevant, but FWIW:


// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
// libraries: give links/details so anyone can compile your code for the same result

#include <TimeLib.h>

void setup() {
  // put your setup code here, to run once:

  SerialUSB.begin(115200);
  while(!SerialUSB);
  SerialUSB.println("Hello World"); 
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(1000);
  SerialUSB.println("Hello World");  
}

### Errors or Incorrect Output
Arduino: 1.8.10 (Windows 10), Board: "Industruino D21G"

In file included from C:\Users\user\AppData\Local\Arduino15\packages\industruino\hardware\samd\1.0.1\cores\industruino/Arduino.h:36:0,

                 from C:\Users\user\Documents\Arduino\libraries\Time\DateStrings.cpp:12:

C:\Users\user\Documents\Arduino\libraries\Time\DateStrings.cpp: In function 'char* monthStr(uint8_t)':

C:\Users\user\AppData\Local\Arduino15\packages\industruino\hardware\samd\1.0.1\cores\industruino/avr/pgmspace.h:106:49: error: 'const void*' is not a pointer-to-object type

 #define pgm_read_ptr(addr) (*(const void *)(addr))

                                                 ^

C:\Users\user\AppData\Local\Arduino15\packages\industruino\hardware\samd\1.0.1\cores\industruino/avr/pgmspace.h:63:45: note: in definition of macro 'strcpy_P'

 #define strcpy_P(dest, src) strcpy((dest), (src))

                                             ^

C:\Users\user\Documents\Arduino\libraries\Time\DateStrings.cpp:72:29: note: in expansion of macro 'pgm_read_ptr'

     strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(monthNames_P[month])));

                             ^

C:\Users\user\Documents\Arduino\libraries\Time\DateStrings.cpp: In function 'char* dayStr(uint8_t)':

C:\Users\user\AppData\Local\Arduino15\packages\industruino\hardware\samd\1.0.1\cores\industruino/avr/pgmspace.h:106:49: error: 'const void*' is not a pointer-to-object type

 #define pgm_read_ptr(addr) (*(const void *)(addr))

                                                 ^

C:\Users\user\AppData\Local\Arduino15\packages\industruino\hardware\samd\1.0.1\cores\industruino/avr/pgmspace.h:63:45: note: in definition of macro 'strcpy_P'

 #define strcpy_P(dest, src) strcpy((dest), (src))

                                             ^

C:\Users\user\Documents\Arduino\libraries\Time\DateStrings.cpp:86:28: note: in expansion of macro 'pgm_read_ptr'

    strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(dayNames_P[day])));

                            ^

Multiple libraries were found for "TimeLib.h"
 Used: C:\Users\user\Documents\Arduino\libraries\Time
exit status 1
Error compiling for board Industruino D21G.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.