|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
请教:
在32位带操作:
#define GPIO_OUT *((unsigned int *)((0x40010C0C & 0xF0000000) + 0x02000000 + ((0x40010C0C & 0x00FFFFFF)<<5) + (5<<2))) = 0;
在主函数中调用 GPIO_OUT 就可以
而定义
#define GPIO_OUT *((unsigned int *)((0x40010C0C & 0xF0000000) + 0x02000000 + ((0x40010C0C & 0x00FFFFFF)<<5) + (5<<2))) ;
在主函数中调用 GPIO_OUT = 0; 就显示
..\User\main.c(19): warning: #174-D: expression has no effect //表达没有影响
GPIO_OUT = 0;
..\User\main.c(19): error: #29: expected an expression //预期的表达
GPIO_OUT = 0;
这是为什么啊
以下是原程序
# include "stm32f10x.h"
# include "bsp_led.h"
#define GPIO_OUT *((unsigned int *)((0x40010C0C & 0xF0000000) + 0x02000000 + ((0x40010C0C & 0x00FFFFFF)<<5) + (5<<2))) ;
int main(void)
{
GPIO_LED();
GPIO_OUT = 0;
} |
|