野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2557|回复: 2

keil5 编译头文件总是出现错误,请问大家这个有什么问题...

[复制链接]
发表于 2023-4-11 11:29:54 | 显示全部楼层 |阅读模式
本帖最后由 fize 于 2023-4-11 11:34 编辑

keil5  编译头文件总是出现错误,请问大家这个有什么问题吗?


  1. #define APB1_base  0x40000000
  2. #define APB2_base  0x40010000
  3. #define AHB_base  0x40018400


  4. #define  GPIOA_base  (unsigned int *)APB2_base + 0x800
  5. #define  GPIOB_base  ((unsigned int )APB2_base + 0xC00)
  6. #define  GPIOC_base   ((unsigned int *)GPIOB_base + 0x400)
  7. #define  GPIOD_base  (unsigned int *)GPIOC_base + 0x400
  8. #define  GPIOE_base  (unsigned int *)GPIOD_base + 0x400
  9. #define  GPIOF_base  (unsigned int *)GPIOE_base + 0x400
  10. #define  GPIOG_base  (unsigned int *)GPIOF_base + 0x400


  11. typedef  (unsigned int)  uint_32;


  12. typedef  struct
  13. {
  14.   uint_32         CRL;
  15.         uint_32         CRH;
  16.         uint_32         IDR;
  17.         uint_32         ODR;
  18.         uint_32         BSRR;
  19.         uint_32         BSR;
  20.         uint_32         LCKR;
  21. } GPIO_TYPR;


  22. #define  GPIO_B  ((GPIO_TYPR *) GPIOB_base)


  23. #define   RCC_base  (unsigned int )0x40021000
  24. #define   RCC_ENR  (*(unsigned int *)RCC_base + 0x18)
  25.         




  26. <div class="blockcode"><blockquote>#include "stm32F103.h"


  27. void SystemInit(void);


  28. int main(void)
  29. {
  30.   GPIO_B->CRL &= ~(0x1111);
  31.         GPIO_B->CRL |= (1);
  32.         GPIO_B->BSRR |= (1<<16);
  33.         RCC_ENR |= (1<<3);
  34.         return 0;
  35.         
  36. }


  37. void SystemInit(void)
  38. {
  39. }
复制代码








问题.rar

15.42 KB, 下载次数: 2

回复

使用道具 举报

发表于 2023-4-11 18:01:23 | 显示全部楼层
野火论坛202304111801192231..png
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-4-11 21:44:23 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-5-9 08:23 , Processed in 0.060194 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表