You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/02/01 19:41:04 UTC

[GitHub] [incubator-nuttx] btashton commented on a change in pull request #2782: nRF52 fixes

btashton commented on a change in pull request #2782:
URL: https://github.com/apache/incubator-nuttx/pull/2782#discussion_r568090321



##########
File path: arch/arm/src/nrf52/nrf52_tickless_rtc.c
##########
@@ -111,7 +111,17 @@ struct nrf52_tickless_dev_s g_tickless_dev;
  * Private Functions
  ****************************************************************************/
 
-static void rtc_counter_to_ts(uint32_t counter, struct timespec *now)
+static inline uint32_t rtc_getcounter(void)
+{
+  return getreg32(NRF52_RTC_BASE + NRF52_RTC_COUNTER_OFFSET);

Review comment:
       Why do you still have the inlines functions, they can be dropped and use the macro instead so you know it will be inlined.
   
   Also you are still hard coding the base. We need to fetch the base from the supplied rtc struct. I had recommended adding an API to the nrf_rtc.c to expose the base address which you can then pass to the macros. 




----------------------------------------------------------------
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.

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