Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in minutesToTime_t macros #179

Open
rob040 opened this issue Mar 28, 2023 · 2 comments
Open

bug in minutesToTime_t macros #179

rob040 opened this issue Mar 28, 2023 · 2 comments

Comments

@rob040
Copy link

rob040 commented Mar 28, 2023

Please use this form only to report code defects or bugs.

Description

In timeLib.h, there are 4 usefull macros that in its current state are not useable"

/* Useful Macros for converting elapsed time to a time_t */
#define minutesToTime_t ((M)) ( (M) * SECS_PER_MIN)  
#define hoursToTime_t   ((H)) ( (H) * SECS_PER_HOUR)  
#define daysToTime_t    ((D)) ( (D) * SECS_PER_DAY) // fixed on Jul 22 2011
#define weeksToTime_t   ((W)) ( (W) * SECS_PER_WEEK)  

The Space between macro name and its argument list is not allowed, and must be removed. Also the double braces in arglist should be changed to singe.

Steps To Reproduce Problem

Use in code and try to compile. It fails.

Hardware & Software

unrelated.

Arduino Sketch

// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
#include <Arduino.h>
#include "TimeLib.h"

void setup() {
 time_t tt = minutesToTime_t(60);
}

void loop() {
}

Errors or Incorrect Output

@rob040
Copy link
Author

rob040 commented Mar 28, 2023

Since there is no maintenance on this library, everyone has to fix this on its own or do not use the listed macros.

@rob040
Copy link
Author

rob040 commented Mar 29, 2023

This ticket appears to be a duplicate if ticket #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant