我刚开始自学STM8S,求大神帮助!
while(1)
{ PA_ODR^=0X01;
delay_ms(500);
PA_ODR^=0X02;
delay_ms(500);
PA_ODR^=0X04;
delay_ms(500);
}
为什么出现以下错误!求解!!
Error[Pe020]: identifier "PA_ODR" is undefined E:2015-07-17彭愿球IARstm8s105 - 副本stm8s105k4t6代码工程Usermain.c 32
Error[Pe020]: identifier "PA_DDR" is undefined E:2015-07-17彭愿球IARstm8s105 - 副本stm8s105k4t6代码工程Usermain.c 58
Error[Pe020]: identifier "PA_CR1" is undefined E:2015-07-17彭愿球IARstm8s105 - 副本stm8s105k4t6代码工程Usermain.c 59
Error[Pe020]: identifier "PA_CR2" is undefined E:2015-07-17彭愿球IARstm8s105 - 副本stm8s105k4t6代码工程Usermain.c 60
Error while running C/C++ Compiler
Done. 4 error(s), 0 warning(s)
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
//端口初始化
void GPIO_Init(void)
{
//初始化端口A
PA_DDR |= 0xf7;
PA_ODR |= 0x00;
PA_CR1 |= 0xff;
PA_CR2 |= 0x00;
//初始化端口B
PB_DDR |= 0xdf;
PB_ODR |= 0x00;
PB_CR1 |= 0xff;
PB_CR2 |= 0x00;
//初始化端口C
PC_DDR |= 0xef;
PC_ODR |= 0x00;
PC_CR1 |= 0xef;
PC_CR2 |= 0x00;
//初始化端口D
PD_DDR |= 0xbf;
PD_ODR |= 0x00;
PD_CR1 |= 0xb7;
PD_CR2 |= 0x00;
}
一周热门 更多>