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:
isiora 2018-03-15 12:20:20 +00:00
parent d365babd21
commit fa98e8c12b
2 changed files with 19 additions and 7 deletions

View File

@ -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/rt/rt_test.mk
include $(CHIBIOS)/test/oslib/oslib_test.mk
include lwip.mk
# Define linker script file here
LDSCRIPT= $(STARTUPLD)/SAMA5D2ddr.ld
@ -138,9 +139,13 @@ CSRC = $(STARTUPSRC) \
$(HALSRC) \
$(PLATFORMSRC) \
$(BOARDSRC) \
$(LWSRC) \
$(TESTSRC) \
$(CHIBIOS)/os/various/evtimer.c \
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
daemons/tssockskel.c \
tsclient.c \
lwipthread.c \
main.c
# 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 \
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
$(LWINC) \
$(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
#

View File

@ -17,9 +17,12 @@
#include "ch.h"
#include "hal.h"
#include "tsclient.h"
#include "daemons/tssockskel.h"
#include "rt_test_root.h"
#include "oslib_test_root.h"
#include "chprintf.h"
#include "lwipthread.h"
/*
* LED blinker thread, times are in milliseconds.
*/
@ -65,6 +68,7 @@ int main(void) {
*/
halInit();
chSysInit();
lwipInit(NULL);
/*
* Activates the serial driver 0 using the driver default configuration.
@ -74,7 +78,10 @@ int main(void) {
/*
* 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
@ -82,9 +89,8 @@ int main(void) {
chprintf((BaseSequentialStream*)&SD0, "Calling the secure service\n\r");
/* Retrieve the service handle by name */
tssvc = (ts_service_t) tsInvokeService(
TS_HND_DISCOVERY, (ts_params_area_t)"TsSimpleService",
sizeof "TsSimpleService", 0);
tssvc = (ts_service_t) tsInvokeServiceNoYield(TS_HND_DISCOVERY,
(ts_params_area_t)"TsSimpleService", sizeof "TsSimpleService");
if ((int32_t)tssvc < 0) {
chprintf((BaseSequentialStream*)&SD0, "Cannot get the handle of '%s': %d\r\n",
"TsSimpleService", tssvc);
@ -97,14 +103,14 @@ int main(void) {
msg_t r;
/* 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);
if(!palReadPad(PIOB, PIOB_USER_PB)) {
#if 0
if(!palReadPad(PIOB, PIOB_USER_PB)) {
test_execute((BaseSequentialStream *)&SD0, &rt_test_suite);
test_execute((BaseSequentialStream *)&SD0, &oslib_test_suite);
#endif
}
#endif
chThdSleepMilliseconds(500);
}
}