-
Notifications
You must be signed in to change notification settings - Fork 78
Added Epoch Support #3
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
Conversation
Also added a one second delay in the begin() method. This is because the clock reading appears to be off until the first tick has elapsed.
Note in set hours the am_pm parameter is ignored if the hours > 12.
Also removed 1 second delay in begin(). It was unnecessary after all.
@GabrielNotman Sorry but I removed the H12/H24 time representation because was asked in an Arduino issue, so now this PR has conflicts |
What can we do about this? Having two begin function prototypes? |
@GabrielNotman can you please join the discussion in the referenced issue? |
I'm fine with removing the 12hr mode support. It complicates things and creates potential confusion. One note: I'm fairly certain that the RTC_MODE2_CTRL_CLKREP bit is asserted for 12h mode. You can test by setting the hours to 13, in 12 hour mode it will adjust that to 1pm. |
Nope if you set 13 you have 13! However have you seen this commit? It enables the standby mode and shows how to use it! |
The main reason I needed the alarm functionality was for a wake interrupt. May I suggest adding a conditional to check if the SerialUSB is present, I'm a bit confused about that mode bit. I will try and check it tonight One thing, I believe if you set out of range values, it will correct them. On 18 November 2015 at 11:33, Arturo Guadalupi [email protected]
Regards, Gabriel Notman Software Developer at SODAQ If our environment could speak, what would it say? Start connecting devices everywhere. |
Feel free to improve the examples and any related things as you wish ;) |
Do you need me to create a new PR using the current code, in order to On 18 November 2015 at 12:07, Arturo Guadalupi [email protected]
Regards, Gabriel Notman Software Developer at SODAQ If our environment could speak, what would it say? Start connecting devices everywhere. |
I don't know it depends on how you want to resolve them! |
Entering sleep mode when connected to the native USB port causes issues (USB device errors).
I've removed the conflicts and you should be able to merge it now. A few notes: Should the standbyMode() method be part of this clock class? |
Any update on when this pull request might be processed? |
This will return false even if the USB is connected. It only returns true if the COM port has been opened.
Updated 23/11/15
Removed: [Added full H12 AM/PM support for setting the hours value (also for querying).]
Previously the RTC_MODE2_CTRL_CLKREP bit was not being set correctly (inverted).
Added the ability to get or set the time and date using either a Epoch or Y2K timestamp.
Epoch timestamps are clamped to Y2K lower bound.
Removed: [A few other modifications including renaming the function pointer type to avoid possible
conflicts and moving the __time24 into the class.]