macros.h

#ifndef __MACROS_H
#define __MACROS_H 1

#if !defined(_AVR)
#error "This file should only be used with ICCV7 for AVR"
#endif

/* FOR ATMEL AVR and TINY AVR ONLY! */

#ifndef BIT
#define BIT(x) (1 << (x))
#endif

#if defined(_AVR) && !defined(flash)
#define flash const  /* IAR compatibility */
#endif

#ifndef C_task
#define C_task
#endif

#define _asm asm   /* old style */

#define WDR()  asm("wdr")
#define SLEEP() asm("sleep")
#define SEI() asm("sei")
#define CLI() asm("cli")
#define NOP() asm("nop")
#define _WDR()  asm("wdr")
#define _SEI() asm("sei")
#define _CLI() asm("cli")
#define _NOP() asm("nop")

#ifdef _AVR
/* Serial Port Macros
 * for 4 Mhz crystal!
 *
 * USE THE AppBuilder for UART initialization!!!
 */
#define BAUD9600 25
#define BAUD19K  12

/* NOT ALL (new) AVRs define these. Use the AppBuilder!!
 */
#define UART_TRANSMIT_ON() UCR |= 0x8
#define UART_TRANSMIT_OFF() UCR &= ~0x8
#define UART_RECEIVE_ON() UCR |= 0x10
#define UART_RECEIVE_OFF() UCR &= ~0x10

#define COMPRESS_DISABLE  NOCC_START()
#define COMPRESS_REENABLE  NOCC_END()

#define NOCC_START() asm(".nocc_start")
#define NOCC_END() asm(".nocc_end")

void _StackCheck(void);
void _StackOverflowed(char);

#endif

#endif

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值