An example HTTP Server using new Ethernet Interface and localfilesystem.

Dependencies:   EthernetInterface HttpServer mbed-rpc mbed-rtos mbed

Fork of giken9_HTMLServer_Sample by Yasushi TAUCHI

Committer:
yueee_yt
Date:
Wed Mar 12 04:19:54 2014 +0000
Revision:
0:7766f6712673
???????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yueee_yt 0:7766f6712673 1 /*----------------------------------------------------------------------------
yueee_yt 0:7766f6712673 2 * RL-ARM - RTX
yueee_yt 0:7766f6712673 3 *----------------------------------------------------------------------------
yueee_yt 0:7766f6712673 4 * Name: RT_TIME.C
yueee_yt 0:7766f6712673 5 * Purpose: Delay and interval wait functions
yueee_yt 0:7766f6712673 6 * Rev.: V4.60
yueee_yt 0:7766f6712673 7 *----------------------------------------------------------------------------
yueee_yt 0:7766f6712673 8 *
yueee_yt 0:7766f6712673 9 * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
yueee_yt 0:7766f6712673 10 * All rights reserved.
yueee_yt 0:7766f6712673 11 * Redistribution and use in source and binary forms, with or without
yueee_yt 0:7766f6712673 12 * modification, are permitted provided that the following conditions are met:
yueee_yt 0:7766f6712673 13 * - Redistributions of source code must retain the above copyright
yueee_yt 0:7766f6712673 14 * notice, this list of conditions and the following disclaimer.
yueee_yt 0:7766f6712673 15 * - Redistributions in binary form must reproduce the above copyright
yueee_yt 0:7766f6712673 16 * notice, this list of conditions and the following disclaimer in the
yueee_yt 0:7766f6712673 17 * documentation and/or other materials provided with the distribution.
yueee_yt 0:7766f6712673 18 * - Neither the name of ARM nor the names of its contributors may be used
yueee_yt 0:7766f6712673 19 * to endorse or promote products derived from this software without
yueee_yt 0:7766f6712673 20 * specific prior written permission.
yueee_yt 0:7766f6712673 21 *
yueee_yt 0:7766f6712673 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
yueee_yt 0:7766f6712673 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
yueee_yt 0:7766f6712673 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
yueee_yt 0:7766f6712673 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
yueee_yt 0:7766f6712673 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
yueee_yt 0:7766f6712673 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
yueee_yt 0:7766f6712673 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
yueee_yt 0:7766f6712673 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
yueee_yt 0:7766f6712673 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
yueee_yt 0:7766f6712673 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
yueee_yt 0:7766f6712673 32 * POSSIBILITY OF SUCH DAMAGE.
yueee_yt 0:7766f6712673 33 *---------------------------------------------------------------------------*/
yueee_yt 0:7766f6712673 34
yueee_yt 0:7766f6712673 35 #include "rt_TypeDef.h"
yueee_yt 0:7766f6712673 36 #include "RTX_Conf.h"
yueee_yt 0:7766f6712673 37 #include "rt_Task.h"
yueee_yt 0:7766f6712673 38 #include "rt_Time.h"
yueee_yt 0:7766f6712673 39
yueee_yt 0:7766f6712673 40 /*----------------------------------------------------------------------------
yueee_yt 0:7766f6712673 41 * Global Variables
yueee_yt 0:7766f6712673 42 *---------------------------------------------------------------------------*/
yueee_yt 0:7766f6712673 43
yueee_yt 0:7766f6712673 44 /* Free running system tick counter */
yueee_yt 0:7766f6712673 45 U32 os_time;
yueee_yt 0:7766f6712673 46
yueee_yt 0:7766f6712673 47
yueee_yt 0:7766f6712673 48 /*----------------------------------------------------------------------------
yueee_yt 0:7766f6712673 49 * Functions
yueee_yt 0:7766f6712673 50 *---------------------------------------------------------------------------*/
yueee_yt 0:7766f6712673 51
yueee_yt 0:7766f6712673 52
yueee_yt 0:7766f6712673 53 /*--------------------------- rt_time_get -----------------------------------*/
yueee_yt 0:7766f6712673 54
yueee_yt 0:7766f6712673 55 U32 rt_time_get (void) {
yueee_yt 0:7766f6712673 56 /* Get system time tick */
yueee_yt 0:7766f6712673 57 return (os_time);
yueee_yt 0:7766f6712673 58 }
yueee_yt 0:7766f6712673 59
yueee_yt 0:7766f6712673 60
yueee_yt 0:7766f6712673 61 /*--------------------------- rt_dly_wait -----------------------------------*/
yueee_yt 0:7766f6712673 62
yueee_yt 0:7766f6712673 63 void rt_dly_wait (U16 delay_time) {
yueee_yt 0:7766f6712673 64 /* Delay task by "delay_time" */
yueee_yt 0:7766f6712673 65 rt_block (delay_time, WAIT_DLY);
yueee_yt 0:7766f6712673 66 }
yueee_yt 0:7766f6712673 67
yueee_yt 0:7766f6712673 68
yueee_yt 0:7766f6712673 69 /*--------------------------- rt_itv_set ------------------------------------*/
yueee_yt 0:7766f6712673 70
yueee_yt 0:7766f6712673 71 void rt_itv_set (U16 interval_time) {
yueee_yt 0:7766f6712673 72 /* Set interval length and define start of first interval */
yueee_yt 0:7766f6712673 73 os_tsk.run->interval_time = interval_time;
yueee_yt 0:7766f6712673 74 os_tsk.run->delta_time = interval_time + (U16)os_time;
yueee_yt 0:7766f6712673 75 }
yueee_yt 0:7766f6712673 76
yueee_yt 0:7766f6712673 77
yueee_yt 0:7766f6712673 78 /*--------------------------- rt_itv_wait -----------------------------------*/
yueee_yt 0:7766f6712673 79
yueee_yt 0:7766f6712673 80 void rt_itv_wait (void) {
yueee_yt 0:7766f6712673 81 /* Wait for interval end and define start of next one */
yueee_yt 0:7766f6712673 82 U16 delta;
yueee_yt 0:7766f6712673 83
yueee_yt 0:7766f6712673 84 delta = os_tsk.run->delta_time - (U16)os_time;
yueee_yt 0:7766f6712673 85 os_tsk.run->delta_time += os_tsk.run->interval_time;
yueee_yt 0:7766f6712673 86 if ((delta & 0x8000) == 0) {
yueee_yt 0:7766f6712673 87 rt_block (delta, WAIT_ITV);
yueee_yt 0:7766f6712673 88 }
yueee_yt 0:7766f6712673 89 }
yueee_yt 0:7766f6712673 90
yueee_yt 0:7766f6712673 91 /*----------------------------------------------------------------------------
yueee_yt 0:7766f6712673 92 * end of file
yueee_yt 0:7766f6712673 93 *---------------------------------------------------------------------------*/
yueee_yt 0:7766f6712673 94