aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c')
-rw-r--r--demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c b/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c
index 1c0ea7c03..46aac872f 100644
--- a/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c
+++ b/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/web/web.c
@@ -87,7 +87,7 @@ THD_WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE);
/**
* HTTP server thread.
*/
-msg_t http_server(void *p) {
+THD_FUNCTION(http_server, p) {
struct netconn *conn, *newconn;
err_t err;
@@ -96,7 +96,7 @@ msg_t http_server(void *p) {
/* Create a new TCP connection handle */
conn = netconn_new(NETCONN_TCP);
- LWIP_ERROR("http_server: invalid conn", (conn != NULL), return MSG_RESET;);
+ LWIP_ERROR("http_server: invalid conn", (conn != NULL), chThdExit(MSG_RESET););
/* Bind to port 80 (HTTP) with default IP address */
netconn_bind(conn, NULL, WEB_THREAD_PORT);
@@ -107,14 +107,13 @@ msg_t http_server(void *p) {
/* Goes to the final priority after initialization.*/
chThdSetPriority(WEB_THREAD_PRIORITY);
- while(1) {
+ while (true) {
err = netconn_accept(conn, &newconn);
if (err != ERR_OK)
continue;
http_server_serve(newconn);
netconn_delete(newconn);
}
- return MSG_OK;
}
#endif /* LWIP_NETCONN */