OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3436|回复: 3

can过滤器组的问题

[复制链接]

8

主题

37

帖子

0

精华

初级会员

Rank: 2

积分
107
金钱
107
注册时间
2013-5-27
在线时间
6 小时
发表于 2015-8-10 13:35:52 | 显示全部楼层 |阅读模式
5金钱
最近看 can代码有这个情况
[mw_shl_code=c,true]#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) /* #define STM32F10X_LD */ /*!< STM32F10X_LD: STM32 Low density devices */ /* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */ /* #define STM32F10X_MD */ /*!< STM32F10X_MD: STM32 Medium density devices */ /* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */ /* #define STM32F10X_HD */ /*!< STM32F10X_HD: STM32 High density devices */ /* #define STM32F10X_HD_VL */ /*!< STM32F10X_HD_VL: STM32 High density value line devices */ /* #define STM32F10X_XL */ /*!< STM32F10X_XL: STM32 XL-density devices */ /* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these devices, you can define the device in your toolchain compiler preprocessor. - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Low-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. - Medium-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. - High-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. - High-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 512 and 1024 Kbytes. - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. */ [/mw_shl_code]


互联型是STM32F10X_CLStm32中文手册上说

Stm32中文手册上说
可是stm32f10x.h文件里

[mw_shl_code=c,true]typedef struct { __IO uint32_t MCR; __IO uint32_t MSR; __IO uint32_t TSR; __IO uint32_t RF0R; __IO uint32_t RF1R; __IO uint32_t IER; __IO uint32_t ESR; __IO uint32_t BTR; uint32_t RESERVED0[88]; CAN_TxMailBox_TypeDef sTxMailBox[3]; CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; uint32_t RESERVED1[12]; __IO uint32_t FMR; __IO uint32_t FM1R; uint32_t RESERVED2; __IO uint32_t FS1R; uint32_t RESERVED3; __IO uint32_t FFA1R; uint32_t RESERVED4; __IO uint32_t FA1R; uint32_t RESERVED5[8]; #ifndef STM32F10X_CL CAN_FilterRegister_TypeDef sFilterRegister[14]; #else CAN_FilterRegister_TypeDef sFilterRegister[28]; #endif /* STM32F10X_CL */ } CAN_TypeDef; [/mw_shl_code]


这段怎么理解

[mw_shl_code=c,true]#ifndef STM32F10X_CL CAN_FilterRegister_TypeDef sFilterRegister[14]; #else CAN_FilterRegister_TypeDef sFilterRegister[28]; #endif /* STM32F10X_CL */ [/mw_shl_code]


这段怎么理解

最佳答案

查看完整内容[请看2#楼]

ifndef ,去百度这个啥意思,就知道了。
留下的终将被留下 明天的总是被明天
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2015-8-10 13:35:53 | 显示全部楼层
ifndef ,去百度这个啥意思,就知道了。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

8

主题

37

帖子

0

精华

初级会员

Rank: 2

积分
107
金钱
107
注册时间
2013-5-27
在线时间
6 小时
 楼主| 发表于 2015-8-10 15:02:51 | 显示全部楼层
我要用 stm32f107芯片 
就要有STM32F10X_CL宏
留下的终将被留下 明天的总是被明天
回复

使用道具 举报

8

主题

37

帖子

0

精华

初级会员

Rank: 2

积分
107
金钱
107
注册时间
2013-5-27
在线时间
6 小时
 楼主| 发表于 2015-8-13 10:20:48 | 显示全部楼层
回复【3楼】正点原子:
---------------------------------
⊙﹏⊙b汗⊙﹏⊙b汗⊙﹏⊙b汗⊙﹏⊙b汗
我要说我看代码 #ifndef 看漏个字母"n" 
⊙﹏⊙b汗⊙﹏⊙b汗⊙﹏⊙b汗⊙﹏⊙b汗
你信吗
⊙﹏⊙b汗⊙﹏⊙b汗⊙﹏⊙b汗⊙﹏⊙b汗
留下的终将被留下 明天的总是被明天
回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-18 13:39

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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