/*\r
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.\r
- * All rights reserved. \r
- * \r
- * Redistribution and use in source and binary forms, with or without modification, \r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without modification,\r
* are permitted provided that the following conditions are met:\r
*\r
* 1. Redistributions of source code must retain the above copyright notice,\r
* this list of conditions and the following disclaimer in the documentation\r
* and/or other materials provided with the distribution.\r
* 3. The name of the author may not be used to endorse or promote products\r
- * derived from this software without specific prior written permission. \r
+ * derived from this software without specific prior written permission.\r
*\r
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED \r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF \r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT \r
- * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \r
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \r
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING \r
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY \r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\r
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\r
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\r
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\r
* OF SUCH DAMAGE.\r
*\r
* This file is part of the lwIP TCP/IP stack.\r
- * \r
+ *\r
* Author: Adam Dunkels <adam@sics.se>\r
*\r
*/\r
#define archMESG_QUEUE_LENGTH ( 6 )\r
#define archPOST_BLOCK_TIME_MS ( ( unsigned long ) 10000 )\r
\r
-struct timeoutlist \r
+struct timeoutlist\r
{\r
struct sys_timeouts timeouts;\r
xTaskHandle pid;\r
__asm volatile ( "NOP" );\r
}\r
\r
- vQueueDelete( mbox ); \r
+ vQueueDelete( mbox );\r
}\r
\r
/*-----------------------------------------------------------------------------------*/\r
// Posts the "msg" to the mailbox.\r
void\r
sys_mbox_post(sys_mbox_t mbox, void *data)\r
-{ \r
+{\r
xQueueSend( mbox, &data, ( portTickType ) ( archPOST_BLOCK_TIME_MS / portTICK_RATE_MS ) );\r
}\r
\r
timeout.\r
\r
Note that a function with a similar name, sys_mbox_fetch(), is\r
- implemented by lwIP. \r
+ implemented by lwIP.\r
*/\r
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)\r
{\r
{\r
msg = &dummyptr;\r
}\r
- \r
+\r
if( timeout != 0 )\r
{\r
if(pdTRUE == xQueueReceive( mbox, &(*msg), timeout ) )\r
{\r
Elapsed = 1;\r
}\r
- return ( Elapsed ); // return time blocked TBD test \r
+ return ( Elapsed ); // return time blocked TBD test\r
}\r
}\r
\r
{\r
Elapsed = 1;\r
}\r
- return (Elapsed); // return time blocked TBD test \r
+ return (Elapsed); // return time blocked TBD test\r
}\r
else\r
{\r
Elapsed = 1;\r
}\r
\r
- return ( Elapsed ); // return time blocked \r
- \r
+ return ( Elapsed ); // return time blocked\r
+\r
}\r
}\r
\r
void\r
sys_sem_free(sys_sem_t sem)\r
{\r
- vQueueDelete( sem ); \r
+ vQueueDelete( sem );\r
}\r
\r
/*-----------------------------------------------------------------------------------*/\r
each thread has a list of timeouts which is represented as a linked\r
list of sys_timeout structures. The sys_timeouts structure holds a\r
pointer to a linked list of timeouts. This function is called by\r
- the lwIP timeout scheduler and must not return a NULL value. \r
+ the lwIP timeout scheduler and must not return a NULL value.\r
\r
In a single threaded sys_arch implementation, this function will\r
simply return a pointer to a global sys_timeouts variable stored in\r
{\r
int i;\r
xTaskHandle pid;\r
-struct timeoutlist *tl; \r
+struct timeoutlist *tl;\r
\r
- pid = xTaskGetCurrentTaskHandle( ); \r
+ pid = xTaskGetCurrentTaskHandle( );\r
\r
- for(i = 0; i < nextthread; i++) \r
+ for(i = 0; i < nextthread; i++)\r
{\r
tl = &timeoutlist[i];\r
- if(tl->pid == pid) \r
+ if(tl->pid == pid)\r
{\r
return &(tl->timeouts);\r
}\r
\r
/*-----------------------------------------------------------------------------------*/\r
/*-----------------------------------------------------------------------------------*/\r
-// TBD \r
+// TBD\r
/*-----------------------------------------------------------------------------------*/\r
/*\r
Starts a new thread with priority "prio" that will begin its execution in the\r
if( iCall == 0 )\r
{\r
/* The first time this is called we are creating the lwIP handler. */\r
- result = xTaskCreate( thread, ( signed char * ) "lwIP", lwipTCP_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "lwIP", lwipTCP_STACK_SIZE, arg, prio, &CreatedTask );\r
iCall++;\r
}\r
else\r
{\r
- result = xTaskCreate( thread, ( signed char * ) "WEBSvr", lwipBASIC_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
+ result = xTaskCreate( thread, "WEBSvr", lwipBASIC_SERVER_STACK_SIZE, arg, prio, &CreatedTask );\r
}\r
\r
// For each task created, store the task handle (pid) in the timers array.\r
an operating system.\r
*/\r
void sys_arch_unprotect(sys_prot_t pval)\r
-{ \r
+{\r
( void ) pval;\r
vPortExitCritical();\r
}\r