Cast ts to u32_t could cause an overflow in that multiplication, since
time_t is 8 bytes it is not necessary to cast the multiplication's
result too.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When converted to time_t, RTC init date was missing 100 years
offset, as time_t starts in 1900 while RTC starts in 2000.
Besides, tm_mon calculation was wrong by 1 month as allowed range
is 0-11 and provided in range 1-12.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following upgrade of newlib version in SDK 0.10.0,
time_t changed from 4 to 8 bytes structure.
As a consequence, ts requires a cast to u32_t before conversion
to us to avoid overflow.
Additionally, add a comment on RTC init value and
fix a minor alignment issue.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The function to set channel alarm is called counter_set_channel_alarm.
To match the name of the function performing the reverse operation this
commit renames counter_disable_channel_alarm() function to
counter_cancel_channel_alarm().
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Provides a STM32 RTC driver using new counter API.
Driver does not support wrap related functions (set, get, ..)
Fixes#11373
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>