This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 0a8be84033e arch/avr/src/avrdx: remove unused variable and update 
comment
0a8be84033e is described below

commit 0a8be84033e7d93e8757465aff0bb005c06daade
Author: Kerogit <[email protected]>
AuthorDate: Wed Jan 7 07:50:12 2026 +0100

    arch/avr/src/avrdx: remove unused variable and update comment
    
    Commit e5db83d7dbb0 introduced a change to the file updated by this patch
    which caused a build-time warning about unused variable. This patch
    removes declaration of the variable from the code.
    
    This patch also updates comment that relates to what was changed
    in the commit.
    
    Patch was tested by building breadxavr:nsh - resulting binary is identical
    (by SHA256 checksum) and the warning is no longer present.
    
    Signed-off-by: Kerogit <[email protected]>
---
 arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c 
b/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c
index 070dc00f345..323bcd8e53c 100644
--- a/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c
+++ b/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c
@@ -233,7 +233,6 @@ static void avrdx_deactivate_alarm(void)
 
 static void avrdx_check_alarm_expired(uint8_t context)
 {
-  struct timespec tv;
   int32_t sec_diff;
   uint32_t nsec_diff;
   int16_t interval;
@@ -270,10 +269,17 @@ static void avrdx_check_alarm_expired(uint8_t context)
        * context. Remove non-interrupt flags from the context before
        * using it.
        *
-       * This possibly incurs small error (delay between alarm expiration
-       * and time read) but alarm must be deactivated first. up_timer_gettime
-       * will attempt to update time and that method in turn calls this one
-       * and the program will run into recursion loop
+       * Deactivate alarm first. Call to nxsched_timer_expiration()
+       * in turns calls up_timer_gettick(), that one calls
+       * up_timer_gettime() which calls this method through
+       * avrdx_increment_uptime(), causing a recursion loop.
+       *
+       * (Note that previous version of this code called
+       * nxsched_alarm_expiration() which does not exist now.
+       * That function needed struct timespec as a parameter which
+       * we obtained using up_timer_gettime (here), causing the same loop.
+       * Therefore, we always deactivate the alarm first before calling
+       * common code, even if it incurs a small timing error.)
        */
 
       avrdx_deactivate_alarm();

Reply via email to