Lab2_web / Mbed 2 deprecated webserverBlinky

Dependencies:   mbed

Fork of webserverBlinky by RealTimeCompLab2

Revision:
109:644a59ebb5b1
Parent:
108:f77ec4605945
Child:
110:baec959e1915
--- a/main.cpp	Fri Aug 04 03:34:11 2017 +0000
+++ b/main.cpp	Fri Aug 04 07:30:52 2017 +0000
@@ -17,7 +17,7 @@
 
 // Handy tools
 // https://ttssh2.osdn.jp/index.html.en - Tera Term, a good terminal program to monitor the debug output from the second serial port with!
-// https://www.microsoft.com/en-us/download/details.aspx?id=4865 - Microsoft network monitor - real-time monitoring of PPP packets -
+// https://www.microsoft.com/en-us/download/details.aspx?id=4865 - Microsoft network monitor - real-time monitoring of PPP packets
 // http://pingtester.net/ - nice tool for high rate ping testing
 // http://www.sunshine2k.de/coding/javascript/crc/crc_js.html - Correctly calculates the 16-bit FCS (crc) on our frames (Choose CRC16_CCITT_FALSE), then custom relected-in=1, reflected-out=1
 // https://technet.microsoft.com/en-us/sysinternals/pstools.aspx - psping for fast testing of ICMP ping function
@@ -44,7 +44,7 @@
 // insert your target board's port here if it's not in yet - if it works, please send it to me - thanks!!!
 #if defined(TARGET_LPC1768)
 Serial xx(p9, p10); // Second serial port on LPC1768 - not required to run, if you get compile error here, change #define SERIAL_PORT_MONITOR_YES to #define SERIAL_PORT_MONITOR_NO
-#elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_L152RE)
+#elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_L152RE) || defined(TARGET_NUCLEO_L053R8) || defined(TARGET_NUCLEO_L476RG)
 Serial xx(PC_10, PC_11); // Second serial port on NUCLEO boards - not required to run, if you get compile error here, change #define SERIAL_PORT_MONITOR_YES to #define SERIAL_PORT_MONITOR_NO
 #else
 #error Add your target board's second serial port here if you want to use debugging - or choose SERIAL_PORT_MONITOR_NO
@@ -272,7 +272,6 @@
     pc.putc(0x7e); // hdlc start-of-frame "flag"
     for(int i=0; i<ppp.pkt.len; i++) {
         hdlcPut( ppp.pkt.buf[i] ); // send a character
-        if((i&0x7f)==0) fillbuf(); // handle received characters every 128 sent
     }
     pc.putc(0x7e); // hdlc end-of-frame "flag"
 }
@@ -581,7 +580,7 @@
         memcpy(n+dataStart,rootWebPage,sizeof(rootWebPage));
         n = n + sizeof(rootWebPage);
     } else {
-        if (xFetch == 0) { // the request started with "GET /x"
+        if (xFetch == 0) { // the page request started with "GET /x"
 
 #define W3C_COMPLIANT_RESPONSE_NO
 // change the above to W3C_COMPLIANT_RESPONSE_YES if you want a W3C.org compliant HTTP response
@@ -589,9 +588,9 @@
             n=n+sprintf(n+dataStart,"<!DOCTYPE html><title>mbed-ppp-blinky</title>"); // html title (W3C.org required elements)
             n=n+sprintf(n+dataStart,"<body>%d</body>",ppp.httpPageCount); // body = the http frame count
 #else
-#define BENCHMARK_USING_BROWSER_NO /* set to _YES if you want to use your browser as a benchmark tool of http fetches */
+#define BENCHMARK_USING_BROWSER_NO /* set to _YES if you want to use your browser as a benchmark tool */
 #ifndef BENCHMARK_USING_BROWSER_NO
-            // a small script that reloads the page after 10 ms - handy for benchmarking using your web browser
+            // a small script that reloads the page after 10 ms - handy for benchmarking using your web browser, use http://172.10.10.2/x
             n=n+sprintf(n+dataStart, "<script>setTimeout(function(){location.reload();},10);</script><body>%d</body>",ppp.httpPageCount);
 #else
             n=n+sprintf(n+dataStart,"%d",ppp.httpPageCount); // not valid html but fast, most browsers and curl are ok with it
@@ -982,7 +981,6 @@
 
 
 
-
 int main()
 {
     pc.baud(115200); // USB virtual serial port