初级会员

- 积分
- 182
- 金钱
- 182
- 注册时间
- 2019-11-6
- 在线时间
- 41 小时
|
1金钱
#define delay_OS_TICKS_PER_SEC configTICK_RATE_HZ
#define SYSCLK 72
#if Use_OS >= 1
#define RELOADTICKS (SYSCLK/8)*(1000000/delay_OS_TICKS_PER_SEC) //重装载值
#endif
#if RELOADTICKS >= 1<<24
#error Value illegal: delay_OS_TICKS_PER_SEC or SYSCLK
#endif
编译错误报告:
*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'D:\keil\ARM\ARMCC\Bin'
compiling sys.c...
Code\sys\sys.c(79): error: #18: expected a ")"
#if
ELOADTICKS >= 1<<24
Code\sys\sys.c(79): error: #39: division by zero
#if
ELOADTICKS >= 1<<24
Code\sys\sys.c: 0 warnings, 2 errors
"Code\sys\sys.c" - 2 Error(s), 0 Warning(s).
怎么回事呀,我在C++里面都没问题,在keil里面就报错
|
最佳答案
查看完整内容[请看2#楼]
找到原因了,由于FreeRTOS的configTICK_RATE_HZ定义为#define configTICK_RATE_HZ ( ( TickType_t ) 200 )
不是一个常数,导致条件编译出错
|