PaulStoffregen / Time

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

error with DCF77 library: 'now' was not declared ..... in version 1.6.1 #162

Closed ednieuw closed 2 years ago

ednieuw commented 3 years ago

Description

My program uses the TimeLib library for the DCF77 library and other time purposes. After updating from 1.6.0 to 1.6.1 I get many errors. Due to some header file missing? I compiled for the Nano Every and MEGA2560 resulting in the same errors

The program compiles fine with Time 1.6.0

Hardware & Software

Board: Nano every and ATMEGA2560 Shields / modules used: none Arduino IDE version 1.8.15 and IDE 2.0.0 beta 9

Version info & package name (from Tools > Boards > Board Manager) Operating system & version Windows 10

Arduino Sketch

https://github.com/ednieuw/Word-Colour-Clock-SK6812-WS2812/blob/master/Character_Colour_Clock_V068.ino

Errors or Incorrect Output

C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::finalizeBuffer()': C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:159:21: error: 'now' was not declared in this scope filledTimestamp = now(); ^~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:159:21: note: suggested alternative: 'pow' filledTimestamp = now(); ^~~ pow C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::receivedTimeUpdate()': C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:188:46: error: 'now' was not declared in this scope time_t processedTime = latestupdatedTime + (now() - processingTimestamp); ^~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:188:46: note: suggested alternative: 'pow' time_t processedTime = latestupdatedTime + (now() - processingTimestamp); ^~~ pow C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:196:20: error: 'SECS_PER_MIN' was not declared in this scope if(difference < 2SECS_PER_MIN) { ^~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:196:20: note: suggested alternative: 'WCHAR_MIN' if(difference < 2SECS_PER_MIN) { ^~~~ WCHAR_MIN C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:208:25: error: 'SECS_PER_MIN' was not declared in this scope if(shiftDifference < 2SECS_PER_MIN) { ^~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:208:25: note: suggested alternative: 'WCHAR_MIN' if(shiftDifference < 2SECS_PER_MIN) { ^~~~ WCHAR_MIN C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::processBuffer()': C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:270:2: error: 'tmElements_t' was not declared in this scope tmElements_t time; ^~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:284:12: error: request for member 'Second' in 'time', which is of non-class type 'time_t(time_t) {aka long unsigned int(long unsigned int)}' time.Second = 0; ^~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:285:9: error: request for member 'Minute' in 'time', which is of non-class type 'time_t(time_t) {aka long unsigned int(long unsigned int)}' time.Minute = rx_buffer->Min-((rx_buffer->Min/16)6); ^~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:286:12: error: request for member 'Hour' in 'time', which is of non-class type 'time_t(time_t) {aka long unsigned int(long unsigned int)}' time.Hour = rx_buffer->Hour-((rx_buffer->Hour/16)6); ^~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:287:12: error: request for member 'Day' in 'time', which is of non-class type 'time_t(time_t) {aka long unsigned int(long unsigned int)}' time.Day = rx_buffer->Day-((rx_buffer->Day/16)6); ^~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:288:12: error: request for member 'Month' in 'time', which is of non-class type 'time_t(time_t) {aka long unsigned int(long unsigned int)}' time.Month = rx_buffer->Month-((rx_buffer->Month/16)6); ^~~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:289:12: error: request for member 'Year' in 'time', which is of non-class type 'time_t(time_t) {aka long unsigned int(long unsigned int)}' time.Year = 2000 + rx_buffer->Year-((rx_buffer->Year/16)6) -1970; ^~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:290:24: error: 'makeTime' was not declared in this scope latestupdatedTime = makeTime(time); ^~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:290:24: note: suggested alternative: 'mktime' latestupdatedTime = makeTime(time); ^~~~ mktime C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getTime()': C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:310:44: error: 'now' was not declared in this scope time_t currentTime =latestupdatedTime + (now() - processingTimestamp); ^~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:310:44: note: suggested alternative: 'pow' time_t currentTime =latestupdatedTime + (now() - processingTimestamp); ^~~ pow C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getUTCTime()': C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:325:42: error: 'SECS_PER_HOUR' was not declared in this scope int UTCTimeDifference = (CEST ? 2 : 1)SECS_PER_HOUR; ^~~~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:326:64: error: 'now' was not declared in this scope time_t currentTime =latestupdatedTime - UTCTimeDifference + (now() - processingTimestamp); ^~~ C:\Users\ednie\Documents\Files\Arduino\libraries\DCF77\DCF77.cpp:326:64: note: suggested alternative: 'pow' time_t currentTime =latestupdatedTime - UTCTimeDifference + (now() - processingTimestamp); ^~~ pow exit status 1 Error compiling for board Arduino Nano Every.

PaulStoffregen commented 3 years ago

Maybe you're trying to include Time.h. It should be TimeLib.h.