Follow-up Comment #1, bug #25929 (project avr-libc):

Problem is most likely not limited to ATtiny48/88. As far as I can tell it
affect also:
ATmega8/16HVA
ATtiny13/13a
ATtiny167
ATtiny2313
ATtiny43
ATtiny87
ATtiny24/44/84
ATtiny25/45/85
ATtiny261/461/861

The following seems to work. Might consider it as a temporary patch.

#include <avr/io.h>
#include <avr/boot.h>

#define __READ_FUSE_LOCK_BIT_SET (_BV(__SPM_ENABLE) | _BV(RFLB))

#define boot_lock_fuse_bits_get_tiny(address)              
(__extension__({                                           
    uint8_t __result;                                      
    __asm__ __volatile__                                   
    (                                                      
        "ldi r30, %3nt"                                  
        "ldi r31, 0nt"                                   
        "sts %1, %2nt"                                   
        "lpm %0, Znt"                                    
        : "=r" (__result)                                  
        : "i" (_SFR_MEM_ADDR(__SPM_REG)),                  
          "r" ((uint8_t)__READ_FUSE_LOCK_BIT_SET),         
          "M" (address)                                    
        : "r0", "r30", "r31"                               
    );                                                     
    __result;                                              
}))

I don't have the required chips to test the above, but it match the
datasheet.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/



_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to