bxparks / AceTime

Date and time classes for Arduino supporting the IANA TZ Database time zones to convert epoch seconds to date and time components in different time zones.
MIT License
77 stars 15 forks source link

Add support for other HW RTCs #21

Closed Naguissa closed 5 years ago

Naguissa commented 5 years ago

Hello,

I've seen your project has DS3231 support.

I want to suggest to add DS3232 support. It uses same control registers so you can use same files or simply add a note about supporting this RTC.

Also you can add DS1307 support; works the same as DS3232 but you may need to change addresses a little.

I've developed a minimal RTC library where you can see how they work, and there I have the three RTCs datasheets: https://github.com/Naguissa/uRTCLib/tree/master/extras

Cheers!

bxparks commented 5 years ago

Hi, Thanks for the suggestions! Unfortunately, I don't have the DS1307 or the DS3232, and I don't feel comfortable adding untested code. But if someone who can actually test on those chips wants to contribute some code, I'd be happy to look at the PR.

Naguissa commented 5 years ago

Hello again,

I don't have none of them, but if you check datasheets DS3232 have just same control registers as DS3231, the only change is that it adds some SRAM after all control registers (same kind of SRAM as old DS1307 has).

Cheers!

bxparks commented 5 years ago

Yeah... I don't work like that, I only publish tested code. I'll keep this issue open in case I get my hands on one of these other chips, or someone else contributes some code. If these other chips are as close to the DS3231 as you say, then it should be easy for someone to modify my current code for those chips.

Naguissa commented 5 years ago

Perfect!

Let's hope anyone can test it, it'squite simple but you need the real hardware.

But one note, the identical one is DS3232, the other one changes a little.

Cheers!

Naguissa commented 5 years ago

Other thing: I'll try to add the code and make a PR, but I cannot test it.

bxparks commented 5 years ago

But if you can't test it yourself, I'd be reluctant to accept that PR...

Naguissa commented 5 years ago

Can'tyou make a branch and ask any user to test it?

bxparks commented 5 years ago

But why would I want to deal with the extra hassle and support requests from the users, for a chip that I don't have and can't test on? I wrote this for fun and for what I need, not because I want to provide free support for users.

I'd be willing to accept your PR if you put a big warning "THIS IS UNTESTED", and you placed your email address in it so that people can send you support requests. :-)

Naguissa commented 5 years ago

I'll do! even adding a compiler message.

PS: I'm CTO in a company, Arduino and electronics is only my hobby.

Naguissa commented 5 years ago

Checked. No code change is needed, only adding compatibility info.

Naguissa commented 5 years ago

(Oh! And I've made a PR. Consider changing the texts to fit your wishes)

bxparks commented 5 years ago

Merged 834fe7a. I think we can close this?