Added lwip to the demo.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11767 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
d365babd21
commit
fa98e8c12b
|
@ -125,6 +125,7 @@ include $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/mk/port_generic.mk
|
||||||
include $(CHIBIOS)/test/lib/test.mk
|
include $(CHIBIOS)/test/lib/test.mk
|
||||||
include $(CHIBIOS)/test/rt/rt_test.mk
|
include $(CHIBIOS)/test/rt/rt_test.mk
|
||||||
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||||
|
include lwip.mk
|
||||||
|
|
||||||
# Define linker script file here
|
# Define linker script file here
|
||||||
LDSCRIPT= $(STARTUPLD)/SAMA5D2ddr.ld
|
LDSCRIPT= $(STARTUPLD)/SAMA5D2ddr.ld
|
||||||
|
@ -138,9 +139,13 @@ CSRC = $(STARTUPSRC) \
|
||||||
$(HALSRC) \
|
$(HALSRC) \
|
||||||
$(PLATFORMSRC) \
|
$(PLATFORMSRC) \
|
||||||
$(BOARDSRC) \
|
$(BOARDSRC) \
|
||||||
|
$(LWSRC) \
|
||||||
$(TESTSRC) \
|
$(TESTSRC) \
|
||||||
|
$(CHIBIOS)/os/various/evtimer.c \
|
||||||
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
|
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
|
||||||
|
daemons/tssockskel.c \
|
||||||
tsclient.c \
|
tsclient.c \
|
||||||
|
lwipthread.c \
|
||||||
main.c
|
main.c
|
||||||
|
|
||||||
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
||||||
|
@ -174,6 +179,7 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
||||||
INCDIR = $(CHIBIOS)/os/license \
|
INCDIR = $(CHIBIOS)/os/license \
|
||||||
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
||||||
|
$(LWINC) \
|
||||||
$(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
|
$(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -17,9 +17,12 @@
|
||||||
#include "ch.h"
|
#include "ch.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "tsclient.h"
|
#include "tsclient.h"
|
||||||
|
#include "daemons/tssockskel.h"
|
||||||
#include "rt_test_root.h"
|
#include "rt_test_root.h"
|
||||||
#include "oslib_test_root.h"
|
#include "oslib_test_root.h"
|
||||||
#include "chprintf.h"
|
#include "chprintf.h"
|
||||||
|
#include "lwipthread.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LED blinker thread, times are in milliseconds.
|
* LED blinker thread, times are in milliseconds.
|
||||||
*/
|
*/
|
||||||
|
@ -65,6 +68,7 @@ int main(void) {
|
||||||
*/
|
*/
|
||||||
halInit();
|
halInit();
|
||||||
chSysInit();
|
chSysInit();
|
||||||
|
lwipInit(NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Activates the serial driver 0 using the driver default configuration.
|
* Activates the serial driver 0 using the driver default configuration.
|
||||||
|
@ -74,7 +78,10 @@ int main(void) {
|
||||||
/*
|
/*
|
||||||
* Creates the blinker thread.
|
* Creates the blinker thread.
|
||||||
*/
|
*/
|
||||||
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO-1, Thread1, NULL);
|
chThdCreateStatic(waThread1, sizeof waThread1, NORMALPRIO-1, Thread1, NULL);
|
||||||
|
|
||||||
|
chThdCreateStatic(waTsSockSkelDaemon, sizeof waTsSockSkelDaemon, NORMALPRIO,
|
||||||
|
TsSockSkelDaemon, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call the dummy secure service
|
* Call the dummy secure service
|
||||||
|
@ -82,9 +89,8 @@ int main(void) {
|
||||||
chprintf((BaseSequentialStream*)&SD0, "Calling the secure service\n\r");
|
chprintf((BaseSequentialStream*)&SD0, "Calling the secure service\n\r");
|
||||||
|
|
||||||
/* Retrieve the service handle by name */
|
/* Retrieve the service handle by name */
|
||||||
tssvc = (ts_service_t) tsInvokeService(
|
tssvc = (ts_service_t) tsInvokeServiceNoYield(TS_HND_DISCOVERY,
|
||||||
TS_HND_DISCOVERY, (ts_params_area_t)"TsSimpleService",
|
(ts_params_area_t)"TsSimpleService", sizeof "TsSimpleService");
|
||||||
sizeof "TsSimpleService", 0);
|
|
||||||
if ((int32_t)tssvc < 0) {
|
if ((int32_t)tssvc < 0) {
|
||||||
chprintf((BaseSequentialStream*)&SD0, "Cannot get the handle of '%s': %d\r\n",
|
chprintf((BaseSequentialStream*)&SD0, "Cannot get the handle of '%s': %d\r\n",
|
||||||
"TsSimpleService", tssvc);
|
"TsSimpleService", tssvc);
|
||||||
|
@ -97,14 +103,14 @@ int main(void) {
|
||||||
msg_t r;
|
msg_t r;
|
||||||
|
|
||||||
/* Invoke the service */
|
/* Invoke the service */
|
||||||
r = tsInvokeService(tssvc, (ts_params_area_t)"HELO", sizeof "HELO", TS_GRANTED_TIMESLICE);
|
r = tsInvokeServiceNoYield(tssvc, (ts_params_area_t)"HELO", sizeof "HELO");
|
||||||
chprintf((BaseSequentialStream*)&SD0, "Call result: %d\r\n", r);
|
chprintf((BaseSequentialStream*)&SD0, "Call result: %d\r\n", r);
|
||||||
if(!palReadPad(PIOB, PIOB_USER_PB)) {
|
|
||||||
#if 0
|
#if 0
|
||||||
|
if(!palReadPad(PIOB, PIOB_USER_PB)) {
|
||||||
test_execute((BaseSequentialStream *)&SD0, &rt_test_suite);
|
test_execute((BaseSequentialStream *)&SD0, &rt_test_suite);
|
||||||
test_execute((BaseSequentialStream *)&SD0, &oslib_test_suite);
|
test_execute((BaseSequentialStream *)&SD0, &oslib_test_suite);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue