eldruin / ds323x-rs

Platform-agnostic Rust driver for the DS3231, DS3232 and DS3234 extremely accurate real-time clocks (RTC).
Apache License 2.0
12 stars 6 forks source link

NaiveTime can't be used on ATmega boards #7

Open mgrrx opened 3 years ago

mgrrx commented 3 years ago

When running get_time() on an Arduino Nano all methods of the NaiveTime object (hour(), minute(), second()) return 1.

Calling .get_hours(), get_minutes() and get_seconds() returns the correct values.

eldruin commented 3 years ago

Interesting. Is the date and time set in the device correct? Can you set a time and/or date/time with set_time() / set_datetime()? How about get_datetime()?

I would suggest experimenting a bit with NaiveTime / NaiveDate and the related methods to see if you can find a cause.

imla commented 1 year ago

When using NaiveDateTime, it bring many big data table related to date and time to the code!! The weird thing that happen is even the total .data, .bss surpassed the arduino nano capacity the code was flashed with no error I checked it with avr-size -A --mcu=atmega328p ...