2004-02-25 Theodore A. Roth * NEWS: Add note about new eeprom macro. * include/avr/boot.h: Update copyright year. (__boot_page_fill_normal): Replace while loop with eeprom_busy_wait. (__boot_page_fill_alternate): Ditto. (__boot_page_fill_extended): Ditto. (__boot_page_erase_normal): Ditto. (__boot_page_erase_alternate): Ditto. (__boot_page_erase_extended): Ditto. (__boot_page_write_normal): Ditto. (__boot_page_write_alternate): Ditto. (__boot_page_write_extended): Ditto. (__boot_rww_enable): Ditto. (__boot_rww_enable_alternate): Ditto. (__boot_lock_bits_set): Ditto. (__boot_lock_bits_set_alternate): Ditto. * include/avr/eeprom.h: Update copyright year. (eeprom_busy_wait): New macro interface. Index: include/avr/boot.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/boot.h,v retrieving revision 1.8 diff -u -p -p -r1.8 boot.h --- include/avr/boot.h 18 Sep 2003 22:46:39 -0000 1.8 +++ include/avr/boot.h 25 Feb 2004 23:28:08 -0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2002-2003, Eric B. Weddington +/* Copyright (c) 2002, 2003, 2004 Eric B. Weddington All rights reserved. Redistribution and use in source and binary forms, with or without @@ -181,7 +181,7 @@ #define __boot_page_fill_normal(address, data) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r0, %3\n\t" \ @@ -200,7 +200,7 @@ #define __boot_page_fill_alternate(address, data)\ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r0, %3\n\t" \ @@ -221,7 +221,7 @@ #define __boot_page_fill_extended(address, data) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r0, %4\n\t" \ @@ -242,7 +242,7 @@ #define __boot_page_erase_normal(address) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r30, %2\n\t" \ @@ -258,7 +258,7 @@ #define __boot_page_erase_alternate(address) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r30, %2\n\t" \ @@ -276,7 +276,7 @@ #define __boot_page_erase_extended(address) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r30, %A3\n\t" \ @@ -294,7 +294,7 @@ #define __boot_page_write_normal(address) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r30, %2\n\t" \ @@ -310,7 +310,7 @@ #define __boot_page_write_alternate(address) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r30, %2\n\t" \ @@ -328,7 +328,7 @@ #define __boot_page_write_extended(address) \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "movw r30, %A3\n\t" \ @@ -346,7 +346,7 @@ #define __boot_rww_enable() \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "sts %0, %1\n\t" \ @@ -359,7 +359,7 @@ #define __boot_rww_enable_alternate() \ ({ \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "sts %0, %1\n\t" \ @@ -375,7 +375,7 @@ ({ \ uint8_t value = (uint8_t)(lock_bits | __BOOT_LOCK_BITS_MASK); \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "ldi r30, 1\n\t" \ @@ -394,7 +394,7 @@ ({ \ uint8_t value = (uint8_t)(lock_bits | __BOOT_LOCK_BITS_MASK); \ boot_spm_busy_wait(); \ - while(!eeprom_is_ready()); \ + eeprom_busy_wait(); \ __asm__ __volatile__ \ ( \ "ldi r30, 1\n\t" \ Index: include/avr/eeprom.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/eeprom.h,v retrieving revision 1.8 diff -u -p -p -r1.8 eeprom.h --- include/avr/eeprom.h 17 Jul 2003 19:52:23 -0000 1.8 +++ include/avr/eeprom.h 25 Feb 2004 23:28:08 -0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, Marek Michalkiewicz +/* Copyright (c) 2002, 2003, 2004 Marek Michalkiewicz All rights reserved. Redistribution and use in source and binary forms, with or without @@ -73,6 +73,15 @@ #define eeprom_is_ready() bit_is_clear(EECR, EEWE) +/** \def eeprom_busy_wait + \ingroup avr_eeprom + + Loops until the eeprom is no longer busy. + + \returns Nothing. */ + +#define eeprom_busy_wait() do { while (!eeprom_is_ready ()); } while (0) + #ifdef __cplusplus extern "C" { #endif Index: NEWS =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/NEWS,v retrieving revision 1.21 diff -u -p -p -r1.21 NEWS --- NEWS 18 Nov 2003 19:03:53 -0000 1.21 +++ NEWS 25 Feb 2004 23:55:00 -0000 @@ -1,5 +1,10 @@ *** Changes since avr-libc-1.0: +* Extend eeprom API. + +New macro: + eeprom_busy_wait + * Extend crc16 API. New functions: