tant 发表于 2023-3-30 14:37:52

新手求助

*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Keil_5\MDK5\ARM\ARMCC\Bin'
compiling main.c...
User\stm32f10x.h(20): warning:#1-D: last line of file ends without a newline
       
User\main.c(10): error:#20: identifier "AHBPRIPH_BASE" is undefined
        RCC_APB2ENR |= 1<<3;
User\main.c(11): error:#20: identifier "ABP2PERIPH_BASE" is undefined
        GPIOB_CRL &= ~(0x0F<<(4*5));
User\main.c: 1 warning, 2 errors
"User\main.c" - 2 Error(s), 1 Warning(s).
我按照教程敲的,请问这个错误是什么原因。
代码:
#include "stm32f10x.h"

void SystemInit(void)
{

}

int main()
{
        RCC_APB2ENR |= 1<<3;
        GPIOB_CRL &= ~(0x0F<<(4*5));
        GPIOB_CRL |= (3<<4*5);
        GPIOB_BSRR = (1<<(16+5));
        while(1)
        {
       
        }
}


页: [1]
查看完整版本: 新手求助