2021-09-11 14:31:30 索煒達(dá)電子 2167
項(xiàng)目編號(hào):E1044
文件大?。?.7M
源碼說明:帶中文注釋
開發(fā)環(huán)境:C編譯器
簡要概述:
今天把前面移植的FreeRTOS和W5500例程集成到一起。新建了一個(gè)任務(wù):InterNetServer_task。這樣,兩個(gè)LED閃爍任務(wù),加上InterNetServer_task任務(wù)一起跑。
經(jīng)過兩個(gè)小時(shí)的時(shí)間,集成成功了。不過集成過程中還是遇到了問題,一個(gè)從來都沒有遇到過的問題(不過自己也很少編程哈),這里把這個(gè)問題記錄一下,往后自己又遇到或者有網(wǎng)友遇到了也可以提供參考。編譯提示信息如下:
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
開始不知道哪里的問題,后來在網(wǎng)上查了一下,網(wǎng)上是這樣解釋的:主要原因是Keil MDK默認(rèn)設(shè)置不支持按照結(jié)構(gòu)體名稱初始化結(jié)構(gòu)體的原因?qū)е隆?/p>
按照錯(cuò)誤定位到 了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
};
后來按照網(wǎng)友提示,進(jìn)入工程屬性中的“C/C++”選項(xiàng)卡中把“C99 Mode”勾選,再次編譯,問題就不存在了。
下面把測(cè)試的圖片貼上,有圖有真像。桌面很亂哈,^_^……
硬件還是同前面幾個(gè)貼子一樣,同時(shí)用電腦PING開發(fā)板及用安信可的測(cè)試軟件TCPUDPDbg.exe給開發(fā)板發(fā)0-----15(十六進(jìn)制)數(shù)據(jù)。目前沒有掉包,偶爾延時(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