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 2022/01/25 09:01:02 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5333: drivers/timers: Add weak_function for up_ function

pkarashchenko commented on a change in pull request #5333:
URL: https://github.com/apache/incubator-nuttx/pull/5333#discussion_r791491502



##########
File path: drivers/timers/arch_alarm.c
##########
@@ -204,7 +204,7 @@ void up_alarm_set_lowerhalf(FAR struct oneshot_lowerhalf_s *lower)
  ****************************************************************************/
 
 #ifdef CONFIG_CLOCK_TIMEKEEPING
-int up_timer_getcounter(FAR uint64_t *cycles)
+int weak_function up_timer_getcounter(FAR uint64_t *cycles)

Review comment:
       If `up_timer_getcounter` becomes `weak`, then shouldn't we change
   ```
   ret = up_timer_getcounter(&counter);
   ```
   to
   ```
   if (up_timer_getcounter != NULL)
     {
       ret = up_timer_getcounter(&counter);
     }
   else
     {
       ret = ERROR;
     }
   ```
   ???




-- 
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-unsubscribe@nuttx.apache.org

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