xiaoxiang781216 commented on issue #7089:
URL: 
https://github.com/apache/incubator-nuttx/issues/7089#issuecomment-1247514988

   > @xiaoxiang781216
   > 
   > Thank you for your kind explanation! I understand your idea.
   > 
   > But many internal RTC lower-half drivers are enabled with each 
`up_rtc_xxx()` implementations at the same time.
   > 
   > For example: `/arch/arm/src/stm32/Make.defs`
   > 
   > ```
   > ifeq ($(CONFIG_STM32_RTC),y)
   > CHIP_CSRCS += stm32_rtc.c
   > ifeq ($(CONFIG_RTC_ALARM),y)
   > CHIP_CSRCS += stm32_exti_alarm.c
   > endif
   > ifeq ($(CONFIG_RTC_PERIODIC),y)
   > CHIP_CSRCS += stm32_exti_wakeup.c
   > endif
   > ifeq ($(CONFIG_RTC_DRIVER),y)
   > CHIP_CSRCS += stm32_rtc_lowerhalf.c
   > endif
   > endif
   > ```
   > 
   > In this case, I think that `stm32_rtc.c`(`up_rtc_xxx()` implementations) 
and `arch_rtc.c` conflict because of same function names.
   > 
   > Should I modify each `Make.defs` to build only lower-half drivers and 
`arch_rtc.c`?
   
   Yes, you can:
   
   1. Enable CONFIG_RTC_DRIVER but disable CONFIG_STM32_RTC to include stm32 
lower-half driver only
   2. Enable your external RTC driver
   3. Enable arch_rtc driver
   4. Check which hardware exist in your board file, and pass the exist 
instance to up_rtc_set_lowerhalf
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to