STM8S103编译出错 bad struct/union operand
来源:互联网 发布:haproxy acl 端口复用 编辑:程序博客网 时间:2024/06/10 01:39
STM8s103P 编译出现以下结果
bad struct/union operand
是由于未宏定义芯片类型
解决方法一 在project setting里面 C Compiler 更改 Preprocessor Definitions
方法二 更改stm8s.h
将下面的
/* #define STM8S208 */ /*!< STM8S High density devices with CAN */
/* #define STM8S207 */ /*!< STM8S High density devices without CAN */
/* #define STM8AF52Ax */ /*!< STM8A High density devices with CAN */
/* #define STM8AF62Ax */ /*!< STM8A High density devices without CAN */
/* #define STM8S105 */ /*!< STM8S Medium density devices */
/* #define STM8AF626x */ /*!< STM8A Medium density devices */
/*#define STM8S103 */ /* !< STM8S Low density devices */
/* #define STM8S903 */ /*!< STM8S Low density devices */
更改为
/* #define STM8S208 */ /*!< STM8S High density devices with CAN */
/* #define STM8S207 */ /*!< STM8S High density devices without CAN */
/* #define STM8AF52Ax */ /*!< STM8A High density devices with CAN */
/* #define STM8AF62Ax */ /*!< STM8A High density devices without CAN */
/* #define STM8S105 */ /*!< STM8S Medium density devices */
/* #define STM8AF626x */ /*!< STM8A Medium density devices */
#define STM8S103 /* !< STM8S Low density devices */
/* #define STM8S903 */ /*!< STM8S Low density devices */
同时更改
注销stmflash.h 里面的
芯片falsh的大小
#if defined (STM8S103) || defined(STM8S903)
// #define FLASH_PROG_END_PHYSICAL_ADDRESS ((uint32_t)0x9FFF) /*!< Program memory: end address */
//#define FLASH_PROG_BLOCKS_NUMBER ((uint16_t)128) /*!< Program memory: total number of blocks */
// #define FLASH_DATA_START_PHYSICAL_ADDRESS ((uint32_t)0x004000) /*!< Data EEPROM memory: start address */
// #define FLASH_DATA_END_PHYSICAL_ADDRESS ((uint32_t)0x00427F) /*!< Data EEPROM memory: end address */
//#define FLASH_DATA_BLOCKS_NUMBER ((uint16_t)10) /*!< Data EEPROM memory: total number of blocks */
// #define FLASH_BLOCK_SIZE ((uint8_t)64) /*!< Number of bytes in a block (common for Program and Data memories) */
#endif /* STM8S103, STM8S903 */
两个方法不能同时使用 建议使用方法一
- STM8S103编译出错 bad struct/union operand
- union , struct
- Struct & Union
- struct union
- struct, union
- struct union
- struct union
- Struct&Union
- struct、union
- struct,union
- Bad operand types for binary operator '&&'
- union与struct(转载)
- union 与 struct 区别
- Union和Struct
- [c++笔记] struct union
- c union & struct
- sizeof struct&union
- sizeof union和struct
- opencv calibration demo 阅读笔记
- BZOJ 3208 花神的秒题计划Ⅰ
- 形参个数可变, NSNumber和NSValue,获得Class
- 银行家算法的数组方式实现
- MyEclipse设置注释格式
- STM8S103编译出错 bad struct/union operand
- Bitmap 二次采样实现
- CES 2016逛展攻略:三大展区万家展台 你不能错过!
- Blob
- MyEclipse 2015 stable2安装注册及配置说明
- IOS生成二维码、扫二维码
- Office文档在线预览
- java13.语言进阶------本地文件操作---文件夹的创建、重命名、删除
- 水仙花数