#66 expected a “;“

本文探讨了编程中的一个常见错误——缺少半括号,并强调了在宏定义和变量声明中分号的必要性。通过实例展示了如何修正这些基本问题,以及它们在文档编写中的关键作用。

这是语法层面上的错误,

经查,少了半个括号,添加上就没事了。

另外,在文档的前面,

#define  变量   0x41                 是没有分号的

int  变量  ;      是有分号的。

Rebuild started: Project: fy_ecu_a009_10f_1key_3led *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\Keil\Leil5\ARM\ARMCC\Bin' Rebuild target 'N32G43x' assembling startup_n32g43x.s... compiling n32g43x_pwr.c... compiling n32g43x_exti.c... compiling n32g43x_gpio.c... compiling system_n32g43x.c... compiling n32g43x_flash.c... compiling n32g43x_rcc.c... compiling misc.c... compiling n32g43x_adc.c... compiling n32g43x_usart.c... compiling n32g43x_lpuart.c... compiling util.c... compiling n32g43x_tim.c... compiling main.c... ..\src\main.c(40): error: #268: declaration may not appear after executable statement in block ScheduleTask inflate_task = { ..\src\main.c(40): error: #20: identifier "ScheduleTask" is undefined ScheduleTask inflate_task = { ..\src\main.c(41): error: #29: expected an expression .IsUsed = 1, ..\src\main.c(42): error: #29: expected an expression .InDuration = 2000, // 鍏呮皵2绉? ..\src\main.c(43): error: #29: expected an expression .OutDuration = 0, ..\src\main.c(44): error: #29: expected an expression .NextOpDuration = 0, ..\src\main.c(45): error: #29: expected an expression .OpAirBagGroup = 0xFF // 鎵€鏈夋皵鍥婄粍 ..\src\main.c(52): error: #268: declaration may not appear after executable statement in block ScheduleTask deflate_task = { ..\src\main.c(52): error: #20: identifier "ScheduleTask" is undefined ScheduleTask deflate_task = { ..\src\main.c(53): error: #29: expected an expression .IsUsed = 1, ..\src\main.c(54): error: #29: expected an expression .InDuration = 0, ..\src\main.c(55): error: #29: expected an expression .OutDuration = 3000, // 鏀炬皵3绉? ..\src\main.c(56): error: #29: expected an expression .NextOpDuration = 0, ..\src\main.c(57): error: #29: expected an expression .OpAirBagGroup = 0xFF // 鎵€鏈夋皵鍥婄粍 ..\src\main.c(64): error: #268: declaration may not appear after executable statement in block ScheduleTask cycle_tasks[] = { ..\src\main.c(64): error: #20: identifier "ScheduleTask" is undefined ScheduleTask cycle_tasks[] = { ..\src\main.c(65): error: #29: expected an expression {.InDuration=1000, .OutDuration=0, .NextOpDuration=500,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鍏呮皵 ..\src\main.c(65): error: #29: expected an expression {.InDuration=1000, .OutDuration=0, .NextOpDuration=500,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鍏呮皵 ..\src\main.c(65): error: #29: expected an expression {.InDuration=1000, .OutDuration=0, .NextOpDuration=500,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鍏呮皵 ..\src\main.c(65): error: #29: expected an expression {.InDuration=1000, .OutDuration=0, .NextOpDuration=500,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鍏呮皵 ..\src\main.c(66): error: #29: expected an expression {.InDuration=0, .OutDuration=800, .NextOpDuration=300,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鏀炬皵 ..\src\main.c(66): error: #29: expected an expression {.InDuration=0, .OutDuration=800, .NextOpDuration=300,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鏀炬皵 ..\src\main.c(66): error: #29: expected an expression {.InDuration=0, .OutDuration=800, .NextOpDuration=300,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鏀炬皵 ..\src\main.c(66): error: #29: expected an expression {.InDuration=0, .OutDuration=800, .NextOpDuration=300,.OpAirBagGroup=0x01}, // 姘斿泭缁?1鏀炬皵 ..\src\main.c(67): error: #29: expected an expression {.InDuration=1200, .OutDuration=0, .NextOpDuration=400,.OpAirBagGroup=0x02}, // 姘斿泭缁?2鍏呮皵 ..\src\main.c(67): error: #29: expected an expression {.InDuration=1200, .OutDuration=0, .NextOpDuration=400,.OpAirBagGroup=0x02}, // 姘斿泭缁?2鍏呮皵 ..\src\main.c(67): error: #29: expected an expression {.InDuration=1200, .OutDuration=0, .NextOpDuration=400,.OpAirBagGroup=0x02}, // 姘斿泭缁?2鍏呮皵 ..\src\main.c(67): error: #29: expected an expression {.InDuration=1200, .OutDuration=0, .NextOpDuration=400,.OpAirBagGroup=0x02}, // 姘斿泭缁?2鍏呮皵 ..\src\main.c(68): error: #29: expected an expression {.InDuration=0, .OutDuration=1000, .NextOpDuration=0,.OpAirBagGroup=0x02} // 姘斿泭缁?2鏀炬皵 ..\src\main.c(68): error: #29: expected an expression {.InDuration=0, .OutDuration=1000, .NextOpDuration=0,.OpAirBagGroup=0x02} // 姘斿泭缁?2鏀炬皵 ..\src\main.c: 0 warnings, 30 errors compiling n32g43x_wwdg.c... compiling n32g43x_it.c... compiling sys_var.c... compiling bsp.c... compiling key.c... compiling app.c... ".\Objects\fy_ecu_a009_10f_1key_3led.axf" - 30 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:45
10-30
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值