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/01/30 23:42:20 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_r567338218



##########
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:
       Can we at least change this to still take the rtc pointer?  I know there is only one, but I don't think that should impact performance of this function (maybe paying for one add operation)  but keeps it more consistent with the other drivers (same with the `rtc_setcc`).
   ```
   return getreg32(((struct nrf52_rtc_priv_s *)dev)->base + NRF52_RTC_COUNTER_OFFSET);
   ```




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