2021-09-11 14:31:30 索炜达电子 2175
项目编号:E1044
文件大小:6.7M
源码说明:带中文注释
开发环境:C编译器
简要概述:
今天把前面移植的FreeRTOS和W5500例程集成到一起。新建了一个任务:InterNetServer_task。这样,两个LED闪烁任务,加上InterNetServer_task任务一起跑。
经过两个小时的时间,集成成功了。不过集成过程中还是遇到了问题,一个从来都没有遇到过的问题(不过自己也很少编程哈),这里把这个问题记录一下,往后自己又遇到或者有网友遇到了也可以提供参考。编译提示信息如下:
compiling queue.c...
compiling tasks.c...
compiling timers.c...
compiling heap_4.c...
compiling port.c...
compiling socket.c...
compiling spi.c...
compiling wizchip_conf.c...
..\HARDWARE\Ethernet\wizchip_conf.c(113): error: #29: expected an expression
.id = _WIZCHIP_ID_,
..\HARDWARE\Ethernet\wizchip_conf.c(114): error: #29: expected an expression
.if_mode = _WIZCHIP_IO_MODE_,
..\HARDWARE\Ethernet\wizchip_conf.c(115): error: #29: expected an expression
.CRIS._enter = wizchip_cris_enter,
..\HARDWARE\Ethernet\wizchip_conf.c(116): error: #29: expected an expression
.CRIS._exit = wizchip_cris_exit,
..\HARDWARE\Ethernet\wizchip_conf.c(117): error: #29: expected an expression
.CS._select = wizchip_cs_select,
..\HARDWARE\Ethernet\wizchip_conf.c(118): error: #29: expected an expression
.CS._deselect = wizchip_cs_deselect,
..\HARDWARE\Ethernet\wizchip_conf.c(119): error: #29: expected an expression
.IF.BUS._read_byte = wizchip_bus_readbyte,
..\HARDWARE\Ethernet\wizchip_conf.c(120): error: #29: expected an expression
.IF.BUS._write_byte = wizchip_bus_writebyte
..\HARDWARE\Ethernet\wizchip_conf.c(123): warning: #12-D: parsing restarts here after previous syntax error
};
..\HARDWARE\Ethernet\wizchip_conf.c: 1 warning, 8 errors
compiling w5500.c...
compiling dhcp.c...
compiling dns.c...
"..\OBJ\LED.axf" - 14 Error(s), 2 Warning(s).
Target not created.
Build Time Elapsed: 00:00:25
开始不知道哪里的问题,后来在网上查了一下,网上是这样解释的:主要原因是Keil MDK默认设置不支持按照结构体名称初始化结构体的原因导致。
按照错误定位到 了wizchip_conf.c中。
/**
* @\ref _WIZCHIP instance
*/
_WIZCHIP WIZCHIP =
{
.id = _WIZCHIP_ID_,
.if_mode = _WIZCHIP_IO_MODE_,
.CRIS._enter = wizchip_cris_enter,
.CRIS._exit = wizchip_cris_exit,
.CS._select = wizchip_cs_select,
.CS._deselect = wizchip_cs_deselect,
.IF.BUS._read_byte = wizchip_bus_readbyte,
.IF.BUS._write_byte = wizchip_bus_writebyte
// .IF.SPI._read_byte = wizchip_spi_readbyte,
// .IF.SPI._write_byte = wizchip_spi_writebyte
};
后来按照网友提示,进入工程属性中的“C/C++”选项卡中把“C99 Mode”勾选,再次编译,问题就不存在了。
下面把测试的图片贴上,有图有真像。桌面很乱哈,^_^……
硬件还是同前面几个贴子一样,同时用电脑PING开发板及用安信可的测试软件TCPUDPDbg.exe给开发板发0-----15(十六进制)数据。目前没有掉包,偶尔延时有1秒。可能还需要优化。后面再说。^_^……
目录│文件列表:
└ Rental_house_control
│ keilkilll.bat
│ readme.txt
├ CORE
│ │ core_cm3.c
│ │ core_cm3.h
│ └ startup_stm32f10x_hd.s
├ FreeRTOS
│ │ croutine.c
│ │ event_groups.c
│ │ list.c
│ │ queue.c
│ │ readme.txt
│ │ tasks.c
│ │ timers.c
│ ├ include
│ │ │ croutine.h
│ │ │ deprecated_definitions.h
│ │ │ event_groups.h
│ │ │ FreeRTOS.h
│ │ │ FreeRTOSConfig.h
│ │ │ list.h
│ │ │ mpu_prototypes.h
│ │ │ mpu_wrappers.h
│ │ │ portable.h
│ │ │ projdefs.h
│ │ │ queue.h
│ │ │ semphr.h
│ │ │ StackMacros.h