2021-09-11 14:31:30 索煒達電子 2181
項目編號:E1044
文件大小:6.7M
源碼說明:帶中文注釋
開發(fā)環(huán)境: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開發(fā)板及用安信可的測試軟件TCPUDPDbg.exe給開發(fā)板發(fā)0-----15(十六進制)數(shù)據。目前沒有掉包,偶爾延時有1秒。可能還需要優(yōu)化。后面再說。^_^……
目錄│文件列表:
└ 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