/[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.12.4.4 by joerg_wunsch, Thu Sep 8 21:19:34 2005 UTC revision 1.12.4.5 by aesok, Thu Sep 29 16:21:02 2005 UTC
# Line 565  Line 565 
565    
566  #endif  #endif
567    
 #define __boot_eeprom_spm_safe(func, address, data) \  
 do { \  
     boot_spm_busy_wait();                       \  
     eeprom_busy_wait();                         \  
     func (address, data);                       \  
 } while (0)  
   
568  /** \ingroup avr_boot  /** \ingroup avr_boot
569    
570      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
571      complete before filling the page. */      complete before filling the page. */
572    
573  #define boot_page_fill_safe(address, data) \  #define boot_page_fill_safe(address, data) \
574      __boot_eeprom_spm_safe (boot_page_fill, address, data)  do { \
575        boot_spm_busy_wait();                       \
576        eeprom_busy_wait();                         \
577        boot_page_fill(address, data);              \
578    } while (0)
579    
580  /** \ingroup avr_boot  /** \ingroup avr_boot
581    
582      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
583      complete before erasing the page. */      complete before erasing the page. */
584    
585  #define boot_page_erase_safe(address, data) \  #define boot_page_erase_safe(address) \
586      __boot_eeprom_spm_safe (boot_page_erase, address, data)  do { \
587        boot_spm_busy_wait();                       \
588        eeprom_busy_wait();                         \
589        boot_page_erase (address);                  \
590    } while (0)
591    
592  /** \ingroup avr_boot  /** \ingroup avr_boot
593    
594      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
595      complete before writing the page. */      complete before writing the page. */
596    
597  #define boot_page_write_safe(address, data) \  #define boot_page_write_safe(address) \
598      __boot_eeprom_spm_safe (boot_page_wrte, address, data)  do { \
599        boot_spm_busy_wait();                       \
600        eeprom_busy_wait();                         \
601        boot_page_write (address);                  \
602    } while (0)
603    
604  /** \ingroup avr_boot  /** \ingroup avr_boot
605    
606      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
607      complete before enabling the RWW mameory. */      complete before enabling the RWW mameory. */
608    
609  #define boot_rww_enable_safe(address, data) \  #define boot_rww_enable_safe() \
610      __boot_eeprom_spm_safe (boot_rww_enable, address, data)  do { \
611        boot_spm_busy_wait();                       \
612        eeprom_busy_wait();                         \
613        boot_rww_enable();                          \
614    } while (0)
615    
616  /** \ingroup avr_boot  /** \ingroup avr_boot
617    
618      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
619      complete before setting the lock bits. */      complete before setting the lock bits. */
620    
621  #define boot_lock_bits_set_safe(address, data) \  #define boot_lock_bits_set_safe(lock_bits) \
622      __boot_eeprom_spm_safe (boot_lock_bits_set, address, data)  do { \
623        boot_spm_busy_wait();                       \
624        eeprom_busy_wait();                         \
625        boot_lock_bits_set (lock_bits);             \
626    } while (0)
627    
628  #endif /* _AVR_BOOT_H_ */  #endif /* _AVR_BOOT_H_ */

Legend:
Removed from v.1.12.4.4  
changed lines
  Added in v.1.12.4.5

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