Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: UIPEthernet_GSOE
Diff: main.cpp
- Revision:
- 9:6f63abd61de8
- Parent:
- 8:3bd85b731cca
--- a/main.cpp Fri Jun 30 20:07:32 2017 +0000
+++ b/main.cpp Tue Feb 05 14:15:05 2019 +0000
@@ -9,7 +9,6 @@
//#define TARGET_STM32F103C8T6 1 // uncomment this line when using STM32F103C8T6 boards!
#if defined(TARGET_STM32F103C8T6)
-#include "stm32f103c8t6.h"
#define LED_PIN PC_13
const int OFF = 1;
const int ON = 0;
@@ -27,33 +26,13 @@
using namespace std;
-Serial pc(USBTX, USBRX);
+Serial pc(PA_2, PA_3);
-#define DHCP 1 // if you'd like to use static IP address comment out this line
+//#define DHCP 1 // if you'd like to use static IP address comment out this line
// uIPEthernet is the name of a global instance of UIPEthernet.
// Do not change the name! It is used within the UIPEthernet library.
-#if defined(TARGET_LPC1768)
-UIPEthernet uIPEthernet(p11, p12, p13, p8); // mosi, miso, sck, cs
-#elif defined(TARGET_LPC1114)
-UIPEthernet uIPEthernet(dp2, dp1, dp6, dp25); // mosi, miso, sck, cs
-#elif defined(TARGET_LPC11U68)
-UIPEthernet uIPEthernet(P0_9, P0_8, P1_29, P0_2); // mosi, miso, sck, cs
-#elif defined(TARGET_NUCLEO_F103RB) || defined(TARGET_NUCLEO_L152RE) || defined(TARGET_NUCLEO_F030R8) \
- || defined(TARGET_NUCLEO_F401RE) || defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_L053R8) \
- || defined(TARGET_NUCLEO_F411RE) || defined(TARGET_NUCLEO_F334R8) || defined(TARGET_NUCLEO_F072RB) \
- || defined(TARGET_NUCLEO_F091RC) || defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F070RB)
-//UIPEthernet uIPEthernet(D4, D5, D3, D2); // mosi, miso, sck, cs
-//UIPEthernet uIPEthernet(D11, D12, D13, D10); // mosi, miso, sck, cs
-UIPEthernet uIPEthernet(PA_7, PA_6, PA_5, PB_6); // mosi, miso, sck, cs
-
-// If your board/plaform is not present yet then uncomment
-// the following two lines and replace TARGET_YOUR_BOARD as appropriate.
-
-//#elif defined(TARGET_YOUR_BOARD)
-//UIPEthernet uIPEthernet(SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS); // mosi, miso, sck, cs
-
-#endif
+UIPEthernet uIPEthernet(PB_5, PB_4, PB_3, PA_10); // mosi, miso, sck, cs
// Note:
// If it happends that any of the SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS pins collide with LED1 pin
@@ -213,7 +192,7 @@
uIPEthernet.begin(MY_MAC, MY_IP);
#endif
IPAddress localIP = uIPEthernet.localIP();
- pc.printf("Type %s secret/ into your web browser and hit ENTER\r\n", localIP.toString());
+ pc.printf("Type %s/secret/ into your web browser and hit ENTER\r\n", localIP.toString());
myServer.begin();
while(1) {
EthernetClient client = myServer.available();