- Fix typos for alarm field identification
- Fix a bug where an alarm interrupt starts
update interrupts
- Rework interrupt code to reduce code size
and complexity
Signed-off-by: Daniel Kampert <danielkampert@kampis-elektroecke.de>
1. tm_mon in rtc_time structure has a range [0, 11],
while the RTC expects [1, 12]. Add missing
increasing / decreasing of this value.
2. Fix typo in debug log
Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
Fixing 3 issues:
1. The mask can be wrong if the alarm register is
set to a MAX value because the alarm bit is the
highest in the alarm register. The mask is now
generated by checking the AE_x bits in the time
registers.
2. Fixing possible NULL pointer exception in
alarm_set_time API. timeptr can be set to NULL
with mask 0 in the alarm_set_time function.
The regs variable for the I2C communication
is written with the correct value from timeptr
only when the right bit in the mask is set.
3. rv8263c8_alarm_set_time() now resets the
alarm status.
4. Interrupts are now enabled by using
rv8263c8_alarm_set_time() rather than when
setting an alarm callback.
Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>