Git Product home page Git Product logo

Comments (5)

SV-Zanshin avatar SV-Zanshin commented on June 14, 2024

That certainly looks like bug! I'm not sure I need to dig out a MCP7940 to debug this issue, it looks like the issue is in the time classes and not the hardware.

from mcp7940.

obdevel avatar obdevel commented on June 14, 2024

My current project is not urgent so there is no rush for a fix.

from mcp7940.

SV-Zanshin avatar SV-Zanshin commented on June 14, 2024

The library uses a fork of Jeelabs RTC, which is now maintained by a fork at https://github.com/adafruit/RTClib

This DateTime class is limited to dates starting at 2000-01-01. Passing a UnixTime less than that date causes library underflow errors which explains the output you are seeing. I've changed the call to DateTime() to not allow any date lower than that value.

Changing the library to allow for the full UnixTime range would mean increasing data types everywhere and adding logic. Considering that the MCP7940 can't deal with dates before 2000 the library doesn't need changing.

I will update the wiki as well.

from mcp7940.

obdevel avatar obdevel commented on June 14, 2024

Thanks Arnd. I don't need dates/times before 2000. I guess I was led astray by the naming of the unixtime() method and assumed it used the Unix epoch like time_t based libraries.

I'll let you close this issue once you've made the update.

from mcp7940.

SV-Zanshin avatar SV-Zanshin commented on June 14, 2024

The library does use UnixTime starting at the correct epoch date, it just doesn't any values less than the number of seconds defined at:

const uint32_t SECS_1970_TO_2000{946684800}; ///< Seconds between year 1970 and 2000

from mcp7940.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.