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 <unicorn_wang@outlook.com>
This commit is contained in:
Chen Wang 2024-11-26 14:57:15 +08:00 committed by Meco Man
parent 0c910e755d
commit 16475b3c92
1 changed files with 1 additions and 1 deletions

View File

@ -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 =
{