IAR For AVR 關于 comp_a90.h 頭文件的使用
/**************************************************************
** - INAVR.H -
**
** Backwards compatibility macros for iccAVR
**
** Used with iccAVR.
**
** Copyright IAR Systems 1999. All rights reserved.
**
** File version: $Revision: 1.3 $
**
**************************************************************/
#ifdef __IAR_SYSTEMS_ICC__
#ifndef _SYSTEM_BUILD
#pragma system_include
#endif
#endif
#ifndef __COMP_A90_H
#define __COMP_A90_H
#ifdef __ICCAVR__
#define tiny __tiny
#define near __near
#define far __far
#define huge __huge
#define flash const __flash
#define farflash const __farflash
#define nearfunc __nearfunc
#define farfunc __farfunc
#define sfrb int int int Cannot use sfrb keyword in iccAVR;
#define sfrw int int int Cannot use sfrw keyword in iccAVR;
#define monitor __monitor
#define C_task __C_task
#define no_init __no_init
#ifndef _CLI
#define_CLI()__disable_interrupt() //清總中斷
#endif
#ifndef disable_interrupt
#define disable_interrupt() __disable_interrupt()
#endif
#ifndef _SEI
#define_SEI()__enable_interrupt()//開總中斷
#endif
#ifndef enable_interrupt
#define enable_interrupt() __enable_interrupt()
#endif
#ifndef _NOP
#define_NOP()__no_operation()//一個時鐘周期的延時
#endif
#ifndef _SLEEP
#define_SLEEP()__sleep()#endif//芯片進入休眠
#ifndef _LPM
#define _LPM(ADDR) __load_program_memory(ADDR)
#endif
#ifdef __HAS_ELPM__
#ifndef _ELPM
#define _ELPM(ADDR) __extended_load_program_memory(ADDR)
#endif
#endif
#ifndef _WDR
#define_WDR()__watchdog_reset()//喂狗
#endif
#ifndef _OPC
#define _OPC(opCode) __insert_opcode(opCode)
#endif
#ifndef _EEPUT
#define_EEPUT(V,A)__EEPUT(V,A)//寫EEPROM
#endif
#ifndef _EEGET
#define_EEGET(V,A)__EEGET(V,A) //讀EEPROM
#endif
#endif /* __ICCAVR__ */
#endif /* __COMP_A90_H */
評論