From 16475b3c9231305a929d98ebd27e1ea77b33284d Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 26 Nov 2024 14:57:15 +0800 Subject: [PATCH] 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 --- bsp/cvitek/drivers/drv_rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/cvitek/drivers/drv_rtc.c b/bsp/cvitek/drivers/drv_rtc.c index 93f2b07082..65927ab4bb 100644 --- a/bsp/cvitek/drivers/drv_rtc.c +++ b/bsp/cvitek/drivers/drv_rtc.c @@ -317,7 +317,6 @@ static void rt_hw_rtc_isr(int irqno, void *param) rt_interrupt_leave(); } -#endif static rt_err_t _rtc_get_alarm(struct rt_rtc_wkalarm *alarm) { @@ -367,6 +366,7 @@ static rt_err_t _rtc_set_alarm(struct rt_rtc_wkalarm *alarm) return RT_EOK; } +#endif static const struct rt_rtc_ops _rtc_ops = {