/[avr-libc]/avr-libc/include/avr/boot.h
ViewVC logotype

Diff of /avr-libc/include/avr/boot.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by joerg_wunsch, Thu Sep 8 21:16:59 2005 UTC revision 1.19 by aesok, Thu Sep 29 16:14:36 2005 UTC
# Line 566  Line 566 
566    
567  #endif  #endif
568    
 #define __boot_eeprom_spm_safe(func, address, data) \  
 do { \  
     boot_spm_busy_wait();                       \  
     eeprom_busy_wait();                         \  
     func (address, data);                       \  
 } while (0)  
   
569  /** \ingroup avr_boot  /** \ingroup avr_boot
570    
571      Same as boot_page_fill() except it waits for eeprom and spm operations to      Same as boot_page_fill() except it waits for eeprom and spm operations to
572      complete before filling the page. */      complete before filling the page. */
573    
574  #define boot_page_fill_safe(address, data) \  #define boot_page_fill_safe(address, data) \
575      __boot_eeprom_spm_safe (boot_page_fill, address, data)  do { \
576        boot_spm_busy_wait();                       \
577        eeprom_busy_wait();                         \
578        boot_page_fill(address, data);              \
579    } while (0)
580    
581  /** \ingroup avr_boot  /** \ingroup avr_boot
582    
583      Same as boot_page_erase() except it waits for eeprom and spm operations to      Same as boot_page_erase() except it waits for eeprom and spm operations to
584      complete before erasing the page. */      complete before erasing the page. */
585    
586  #define boot_page_erase_safe(address, data) \  #define boot_page_erase_safe(address) \
587      __boot_eeprom_spm_safe (boot_page_erase, address, data)  do { \
588        boot_spm_busy_wait();                       \
589        eeprom_busy_wait();                         \
590        boot_page_erase (address);                  \
591    } while (0)
592    
593  /** \ingroup avr_boot  /** \ingroup avr_boot
594    
595      Same as boot_page_write() except it waits for eeprom and spm operations to      Same as boot_page_write() except it waits for eeprom and spm operations to
596      complete before writing the page. */      complete before writing the page. */
597    
598  #define boot_page_write_safe(address, data) \  #define boot_page_write_safe(address) \
599      __boot_eeprom_spm_safe (boot_page_wrte, address, data)  do { \
600        boot_spm_busy_wait();                       \
601        eeprom_busy_wait();                         \
602        boot_page_write (address);                  \
603    } while (0)
604    
605  /** \ingroup avr_boot  /** \ingroup avr_boot
606    
607      Same as boot_rww_enable() except waits for eeprom and spm operations to      Same as boot_rww_enable() except waits for eeprom and spm operations to
608      complete before enabling the RWW mameory. */      complete before enabling the RWW mameory. */
609    
610  #define boot_rww_enable_safe(address, data) \  #define boot_rww_enable_safe() \
611      __boot_eeprom_spm_safe (boot_rww_enable, address, data)  do { \
612        boot_spm_busy_wait();                       \
613        eeprom_busy_wait();                         \
614        boot_rww_enable();                          \
615    } while (0)
616    
617  /** \ingroup avr_boot  /** \ingroup avr_boot
618    
619      Same as boot_lock_bits_set() except waits for eeprom and spm operations to      Same as boot_lock_bits_set() except waits for eeprom and spm operations to
620      complete before setting the lock bits. */      complete before setting the lock bits. */
621    
622  #define boot_lock_bits_set_safe(address, data) \  #define boot_lock_bits_set_safe(lock_bits) \
623      __boot_eeprom_spm_safe (boot_lock_bits_set, address, data)  do { \
624        boot_spm_busy_wait();                       \
625        eeprom_busy_wait();                         \
626        boot_lock_bits_set (lock_bits);             \
627    } while (0)
628    
629  #endif /* _AVR_BOOT_H_ */  #endif /* _AVR_BOOT_H_ */

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26