indented using indent.sh script to get uniform looking code for release
This commit is contained in:
@@ -11,11 +11,11 @@
|
||||
#if (__GNUC__ <= 4) && (__GNUC_MINOR__ < 3)
|
||||
|
||||
#if !defined(EEWE) && defined(EEPE)
|
||||
# define EEWE EEPE
|
||||
#define EEWE EEPE
|
||||
#endif
|
||||
|
||||
#if !defined(EEMWE) && defined(EEMPE)
|
||||
# define EEMWE EEMPE
|
||||
#define EEMWE EEMPE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,55 +20,55 @@
|
||||
#if defined(__ICCAVR__)
|
||||
|
||||
/* IAR Embedded Workbench */
|
||||
# include <inavr.h>
|
||||
#include <inavr.h>
|
||||
|
||||
# define _GET_LOCK_BITS() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0001, 0x09 )
|
||||
# define _GET_LOW_FUSES() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0000, 0x09 )
|
||||
# define _GET_HIGH_FUSES() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0003, 0x09 )
|
||||
# define _GET_EXTENDED_FUSES() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0002, 0x09 )
|
||||
# define _SET_LOCK_BITS(data) __DataToR0ByteToSPMCR_SPM( data, 0x09 )
|
||||
# define _ENABLE_RWW_SECTION() __DataToR0ByteToSPMCR_SPM( 0x00, 0x11 )
|
||||
#define _GET_LOCK_BITS() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0001, 0x09 )
|
||||
#define _GET_LOW_FUSES() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0000, 0x09 )
|
||||
#define _GET_HIGH_FUSES() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0003, 0x09 )
|
||||
#define _GET_EXTENDED_FUSES() __AddrToZByteToSPMCR_LPM( (void __flash *) 0x0002, 0x09 )
|
||||
#define _SET_LOCK_BITS(data) __DataToR0ByteToSPMCR_SPM( data, 0x09 )
|
||||
#define _ENABLE_RWW_SECTION() __DataToR0ByteToSPMCR_SPM( 0x00, 0x11 )
|
||||
|
||||
# define _WAIT_FOR_SPM() while( SPMCR_REG & (1<<SPMEN) );
|
||||
#define _WAIT_FOR_SPM() while( SPMCR_REG & (1<<SPMEN) );
|
||||
|
||||
# ifndef LARGE_MEMORY
|
||||
# define _LOAD_PROGRAM_MEMORY(addr) __load_program_memory( (const unsigned char __flash *) (addr) )
|
||||
# define _FILL_TEMP_WORD(addr,data) __AddrToZWordToR1R0ByteToSPMCR_SPM( (void __flash *) (addr), data, 0x01 )
|
||||
# define _PAGE_ERASE(addr) __AddrToZByteToSPMCR_SPM( (void __flash *) (addr), 0x03 )
|
||||
# define _PAGE_WRITE(addr) __AddrToZByteToSPMCR_SPM( (void __flash *) (addr), 0x05 )
|
||||
# else /* LARGE_MEMORY */
|
||||
# define _LOAD_PROGRAM_MEMORY(addr) __extended_load_program_memory( (const unsigned char __farflash *) (addr) )
|
||||
# define _FILL_TEMP_WORD(addr,data) __AddrToZ24WordToR1R0ByteToSPMCR_SPM( (void __farflash *) (addr), data, 0x01 )
|
||||
# define _PAGE_ERASE(addr) __AddrToZ24ByteToSPMCR_SPM( (void __farflash *) (addr), 0x03 )
|
||||
# define _PAGE_WRITE(addr) __AddrToZ24ByteToSPMCR_SPM( (void __farflash *) (addr), 0x05 )
|
||||
# endif /* LARGE_MEMORY */
|
||||
#ifndef LARGE_MEMORY
|
||||
#define _LOAD_PROGRAM_MEMORY(addr) __load_program_memory( (const unsigned char __flash *) (addr) )
|
||||
#define _FILL_TEMP_WORD(addr,data) __AddrToZWordToR1R0ByteToSPMCR_SPM( (void __flash *) (addr), data, 0x01 )
|
||||
#define _PAGE_ERASE(addr) __AddrToZByteToSPMCR_SPM( (void __flash *) (addr), 0x03 )
|
||||
#define _PAGE_WRITE(addr) __AddrToZByteToSPMCR_SPM( (void __flash *) (addr), 0x05 )
|
||||
#else /* LARGE_MEMORY */
|
||||
#define _LOAD_PROGRAM_MEMORY(addr) __extended_load_program_memory( (const unsigned char __farflash *) (addr) )
|
||||
#define _FILL_TEMP_WORD(addr,data) __AddrToZ24WordToR1R0ByteToSPMCR_SPM( (void __farflash *) (addr), data, 0x01 )
|
||||
#define _PAGE_ERASE(addr) __AddrToZ24ByteToSPMCR_SPM( (void __farflash *) (addr), 0x03 )
|
||||
#define _PAGE_WRITE(addr) __AddrToZ24ByteToSPMCR_SPM( (void __farflash *) (addr), 0x05 )
|
||||
#endif /* LARGE_MEMORY */
|
||||
|
||||
#elif __GNUC__ > 0
|
||||
|
||||
/* AVR-GCC/avr-libc */
|
||||
# include <avr/boot.h>
|
||||
# include <avr/pgmspace.h>
|
||||
#include <avr/boot.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
# if defined(GET_LOCK_BITS) /* avr-libc >= 1.2.5 */
|
||||
# define _GET_LOCK_BITS() boot_lock_fuse_bits_get(GET_LOCK_BITS)
|
||||
# define _GET_LOW_FUSES() boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS)
|
||||
# define _GET_HIGH_FUSES() boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS)
|
||||
# define _GET_EXTENDED_FUSES() boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS)
|
||||
# endif /* defined(GET_LOCK_BITS) */
|
||||
# define _SET_LOCK_BITS(data) boot_lock_bits_set(~data)
|
||||
# define _ENABLE_RWW_SECTION() boot_rww_enable()
|
||||
#if defined(GET_LOCK_BITS) /* avr-libc >= 1.2.5 */
|
||||
#define _GET_LOCK_BITS() boot_lock_fuse_bits_get(GET_LOCK_BITS)
|
||||
#define _GET_LOW_FUSES() boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS)
|
||||
#define _GET_HIGH_FUSES() boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS)
|
||||
#define _GET_EXTENDED_FUSES() boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS)
|
||||
#endif /* defined(GET_LOCK_BITS) */
|
||||
#define _SET_LOCK_BITS(data) boot_lock_bits_set(~data)
|
||||
#define _ENABLE_RWW_SECTION() boot_rww_enable()
|
||||
|
||||
# define _WAIT_FOR_SPM() boot_spm_busy_wait()
|
||||
#define _WAIT_FOR_SPM() boot_spm_busy_wait()
|
||||
|
||||
# ifndef LARGE_MEMORY
|
||||
# define _LOAD_PROGRAM_MEMORY(addr) pgm_read_byte_near(addr)
|
||||
# else /* LARGE_MEMORY */
|
||||
# define _LOAD_PROGRAM_MEMORY(addr) pgm_read_byte_far(addr)
|
||||
# endif /* LARGE_MEMORY */
|
||||
# define _FILL_TEMP_WORD(addr,data) boot_page_fill(addr, data)
|
||||
# define _PAGE_ERASE(addr) boot_page_erase(addr)
|
||||
# define _PAGE_WRITE(addr) boot_page_write(addr)
|
||||
#ifndef LARGE_MEMORY
|
||||
#define _LOAD_PROGRAM_MEMORY(addr) pgm_read_byte_near(addr)
|
||||
#else /* LARGE_MEMORY */
|
||||
#define _LOAD_PROGRAM_MEMORY(addr) pgm_read_byte_far(addr)
|
||||
#endif /* LARGE_MEMORY */
|
||||
#define _FILL_TEMP_WORD(addr,data) boot_page_fill(addr, data)
|
||||
#define _PAGE_ERASE(addr) boot_page_erase(addr)
|
||||
#define _PAGE_WRITE(addr) boot_page_write(addr)
|
||||
|
||||
#else
|
||||
# error "Don't know your compiler."
|
||||
#error "Don't know your compiler."
|
||||
#endif
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
* smaller devices.
|
||||
*/
|
||||
#ifdef LARGE_MEMORY
|
||||
# define ADDR_T unsigned long
|
||||
#define ADDR_T unsigned long
|
||||
#else /* !LARGE_MEMORY */
|
||||
# define ADDR_T unsigned int
|
||||
#define ADDR_T unsigned int
|
||||
#endif /* LARGE_MEMORY */
|
||||
|
||||
#ifndef REMOVE_BLOCK_SUPPORT
|
||||
|
||||
Reference in New Issue
Block a user