Update of bug #43828 (project avr-libc):

                  Status:                    None => In Progress            
             Assigned to:                    None => pitchumani             

    _______________________________________________________

Follow-up Comment #1:

Below is the patch to fix this issue.

diff --git a/avr-libc/include/avr/wdt.h b/avr-libc/include/avr/wdt.h
index fc15885..3130e67 100644
--- a/avr-libc/include/avr/wdt.h
+++ b/avr-libc/include/avr/wdt.h
@@ -148,25 +148,24 @@
 */
 #define wdt_enable(timeout) \
 do { \
-uint8_t temp = 0; \
+uint8_t temp; \
 __asm__ __volatile__ (         \
     "in __tmp_reg__, %[rampd]"              "\n\t" \
     "out %[rampd], __zero_reg__"            "\n\t" \
     "out %[ccp_reg], %[ioreg_cen_mask]"     "\n\t" \
     "sts %[wdt_reg], %[wdt_enable_timeout]" "\n\t" \
     "1:lds %[tmp], %[wdt_status_reg]"       "\n\t" \
-    "sbrc  %[tmp], %[wdt_syncbusy_bit]"     "\n\t" \
+    "sbrc %[tmp], %[wdt_syncbusy_bit]"     "\n\t" \
     "rjmp 1b"                               "\n\t" \
     "out %[rampd], __tmp_reg__"             "\n\t" \
-    : "=r" (temp) \
+    : [tmp]                "=r" (temp) \
     : [rampd]              "M" (_SFR_MEM_ADDR(RAMPD)),      \
       [ccp_reg]            "I" (_SFR_MEM_ADDR(CCP)),        \
       [ioreg_cen_mask]     "r" ((uint8_t)CCP_IOREG_gc),     \
       [wdt_reg]            "M" (_SFR_MEM_ADDR(WDT_CTRL)),   \
       [wdt_enable_timeout] "r" ((uint8_t)(WDT_CEN_bm | WDT_ENABLE_bm |
timeout)), \
       [wdt_status_reg]     "M" (_SFR_MEM_ADDR(WDT_STATUS)), \
-      [wdt_syncbusy_bit]   "I" (WDT_SYNCBUSY_bm),           \
-      [tmp]                "r" (temp)                       \
+      [wdt_syncbusy_bit]   "I" (WDT_SYNCBUSY_bm)            \
     : "r0" \
 ); \
 } while(0)

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?43828>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to