Skip to content

Commit 16475b3

Browse files
unicornxmysterywolf
authored andcommitted
bsp: cvitek: fix warning on rtc driver
When RTC is enabled, a warning appear during compiling: warning: implicit declaration of function 'rtc_alarm_enable' [-Wimplicit-function-declaration] 366 | rtc_alarm_enable(alarm->enable); | ^~~~~~~~~~~~~~~~ It's due to _rtc_set_alarm is not covered by RT_USING_ALARM. It's wrong. Solution: cover all functions including _rtc_get_alarm & _rtc_set_alarm under RT_USING_ALARM macro conditional defintion. Signed-off-by: Chen Wang <[email protected]>
1 parent 0c910e7 commit 16475b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bsp/cvitek/drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ static void rt_hw_rtc_isr(int irqno, void *param)
317317

318318
rt_interrupt_leave();
319319
}
320-
#endif
321320

322321
static rt_err_t _rtc_get_alarm(struct rt_rtc_wkalarm *alarm)
323322
{
@@ -367,6 +366,7 @@ static rt_err_t _rtc_set_alarm(struct rt_rtc_wkalarm *alarm)
367366

368367
return RT_EOK;
369368
}
369+
#endif
370370

371371
static const struct rt_rtc_ops _rtc_ops =
372372
{

0 commit comments

Comments
 (0)