cpu/lpc2387: rtc: set rtc callback arg
`_cb_arg` was never set, it was simply ignored in `rtc_set_alarm()`. The fix is trivial: just set `_cb_arg` to the assigned argument.
This commit is contained in:
parent
844aa43288
commit
c24fb242ef
@ -114,7 +114,6 @@ int rtc_get_time(struct tm *localt)
|
|||||||
|
|
||||||
int rtc_set_alarm(struct tm *localt, rtc_alarm_cb_t cb, void *arg)
|
int rtc_set_alarm(struct tm *localt, rtc_alarm_cb_t cb, void *arg)
|
||||||
{
|
{
|
||||||
(void) arg;
|
|
||||||
if (localt != NULL) {
|
if (localt != NULL) {
|
||||||
/* normalize input */
|
/* normalize input */
|
||||||
rtc_tm_normalize(localt);
|
rtc_tm_normalize(localt);
|
||||||
@ -132,6 +131,7 @@ int rtc_set_alarm(struct tm *localt, rtc_alarm_cb_t cb, void *arg)
|
|||||||
RTC_ALDOM, RTC_ALMON, RTC_ALYEAR, RTC_ALHOUR, RTC_ALMIN, RTC_ALSEC);
|
RTC_ALDOM, RTC_ALMON, RTC_ALYEAR, RTC_ALHOUR, RTC_ALMIN, RTC_ALSEC);
|
||||||
|
|
||||||
_cb = cb;
|
_cb = cb;
|
||||||
|
_cb_arg = arg;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (cb == NULL) {
|
else if (cb == NULL) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user