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: EthernetInterface-1 MaxbotixDriver Presence HTU21D_TEMP_HUMID_SENSOR_SAMPLE Resources SHARPIR mbed-rtos mbed-src WDT_K64F nsdl_lib
Fork of Trenton_Switch_LPC1768_ETH by
Revision 46:807e9cf63f4c, committed 2015-07-16
- Comitter:
- andcor02
- Date:
- Thu Jul 16 13:28:49 2015 +0000
- Parent:
- 45:d7b4b57574a0
- Commit message:
- Added Serial VCOM debug over USB.
Changed in this revision
--- a/NSDL/nsdl_support.h Mon Jun 29 09:05:06 2015 +0000 +++ b/NSDL/nsdl_support.h Thu Jul 16 13:28:49 2015 +0000 @@ -9,7 +9,7 @@ #include "sn_coap_header.h" #include "sn_coap_protocol.h" #include "sn_nsdl_lib.h" - +extern Serial pc; typedef uint8_t (*sn_grs_dyn_res_callback_t)(sn_coap_hdr_s *, sn_nsdl_addr_s *, sn_proto_info_s *); extern "C" void *nsdl_alloc(uint16_t size);
--- a/Resources.lib Mon Jun 29 09:05:06 2015 +0000 +++ b/Resources.lib Thu Jul 16 13:28:49 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/ASE/code/Resources/#a708d3686f4b +http://developer.mbed.org/teams/ASE/code/Resources/#bc54f10b3234
--- a/main.cpp Mon Jun 29 09:05:06 2015 +0000
+++ b/main.cpp Thu Jul 16 13:28:49 2015 +0000
@@ -22,7 +22,7 @@
#include "Watchdog.h"
-//Serial pc(USBTX, USBRX);
+Serial pc(PTC17,PTC16);
#define WATCHDOG_TIMEOUT_SEC 30 //30 seconds
#define HEARTBEAT_PERIOD_MS 1000 //1 second...
@@ -32,20 +32,20 @@
{
/* Initialize network */
#ifdef DHCP
- printf("DHCP in use\r\n");
+ pc.printf("DHCP in use\r\n");
eth.init();
#else
eth.init(IP, MASK, GW);
#endif
if(eth.connect(30000) == 0)
- printf("Connect OK\n\r");
- printf("IP Address:%s ", eth.getIPAddress());
+ pc.printf("Connect OK\n\r");
+ pc.printf("IP Address:%s ", eth.getIPAddress());
}
//Hard Fault Handler (Watchdog)
extern "C" void HardFault_Handler() {
- printf("Hard Fault!\r\n");
+ pc.printf("Hard Fault!\r\n");
NVIC_SystemReset();
}
@@ -137,9 +137,9 @@
} else {
//UDP
//wait(0.25); //Waiting seems to increase reliability of comms...
- printf("Received %d bytes\r\n", n);
+ pc.printf("Received %d bytes\r\n", n);
nsdl_result = sn_nsdl_process_coap((uint8_t*)buffer, n, &received_packet_address);
- printf("Processed COAP Packet: %d\r\n", nsdl_result);
+ pc.printf("Processed COAP Packet: %d\r\n", nsdl_result);
n = 0;
}
@@ -151,7 +151,7 @@
//
//Registration Tick
if(registrationTimer.read_ms() >= RD_UPDATE_PERIOD_MS) {
- printf("Time to register...\r\n");
+ pc.printf("Time to register...\r\n");
NSP_registration();
registrationTimer.reset();
}
@@ -217,10 +217,10 @@
* \return int
*/
int main() {
- printf("Initialising Ethernet...\r\n");
+ pc.printf("Initialising Ethernet...\r\n");
// Initialize Ethernet interface first
ethernet_init();
- printf("Initialising NSDL...\r\n");
+ pc.printf("Initialising NSDL...\r\n");
//Run NSDL...
nsdl_run();
//Init Sensors
--- a/mbed-rtos.lib Mon Jun 29 09:05:06 2015 +0000 +++ b/mbed-rtos.lib Thu Jul 16 13:28:49 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#ef0a22cdf839 +http://mbed.org/users/mbed_official/code/mbed-rtos/#5aed8bae1001
--- a/mbed-src.lib Mon Jun 29 09:05:06 2015 +0000 +++ b/mbed-src.lib Thu Jul 16 13:28:49 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-src/#30f9462b5296 +http://mbed.org/users/mbed_official/code/mbed-src/#474d026f7d79
--- a/node_cfg.h Mon Jun 29 09:05:06 2015 +0000
+++ b/node_cfg.h Thu Jul 16 13:28:49 2015 +0000
@@ -46,7 +46,7 @@
//Ethernet Sensors...
#define ENDPOINT_TYPE {"mbed-sensor-Ethernet"}
-#define NODE_NAME "mbed-sensor-demo-1"
+#define NODE_NAME "mbed-sensor-demo-eth"
//#define NODE_NAME "mbed-sensor-demo-2"
//#define NODE_NAME "mbed-sensor-demo-3"
//#define NODE_NAME "mbed-sensor-demo-4"
@@ -69,7 +69,7 @@
#define DHCP
/* Manual IP configurations, if DHCP not defined */
-#define IP "192.168.1.10"
+#define IP "192.168.1.100"
#define MASK "255.255.255.0"
#define GW "10.45.0.1"
#endif //ETHERNET
