etisserant@375: /* etisserant@375: This file is part of CanFestival, a library implementing CanOpen Stack. etisserant@375: etisserant@375: Copyright (C): Edouard TISSERANT and Francis DUPIN etisserant@375: Copyright (C): AVR Port Andreas GLAUSER and Peter CHRISTEN etisserant@375: etisserant@375: See COPYING file for copyrights details. etisserant@375: etisserant@375: This library is free software; you can redistribute it and/or etisserant@375: modify it under the terms of the GNU Lesser General Public etisserant@375: License as published by the Free Software Foundation; either etisserant@375: version 2.1 of the License, or (at your option) any later version. etisserant@375: etisserant@375: This library is distributed in the hope that it will be useful, etisserant@375: but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@375: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@375: Lesser General Public License for more details. etisserant@375: etisserant@375: You should have received a copy of the GNU Lesser General Public etisserant@375: License along with this library; if not, write to the Free Software etisserant@375: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@375: */ etisserant@375: etisserant@375: #ifndef _IAR_H_ etisserant@375: #define _IAR_H_ etisserant@375: etisserant@375: #ifdef __IAR_SYSTEMS_ICC__ // IAR Compiler etisserant@375: etisserant@375: /* etisserant@375: #define ISR(vect) \ etisserant@375: _Pragma("vector="vect) \ etisserant@375: __interrupt void Interrupt_##vect (void) etisserant@375: */ etisserant@375: #define sei() __enable_interrupt() etisserant@375: #define cli() __disable_interrupt() etisserant@375: #define sleep_enable() SMCR = 1 << SE etisserant@375: #define sleep_cpu() __sleep() etisserant@375: #define wdt_reset() __watchdog_reset() etisserant@375: #define wdt_enable(val) {WDTCSR = 1 << WDCE | 1 << WDE; \ etisserant@375: WDTCSR = 1 << WDE | (val);} etisserant@375: etisserant@375: #else etisserant@375: #error Not an IAR Compiler! etisserant@375: #endif // IAR Compiler etisserant@375: etisserant@375: #endif // _IAR_H_