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: NTPClient W5500Interface Watchdog device_configuration eeprom_flash mbed-rpc-nucleo mbed-rtos mbed
Fork of F103-Serial-to-Ethernet by
Revision 33:c906ccc220ba, committed 2015-01-25
- Comitter:
- olympux
- Date:
- Sun Jan 25 14:04:04 2015 +0000
- Parent:
- 32:db2e8ea06ee1
- Child:
- 34:32299b819067
- Commit message:
- Auto reset after configured
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| readme.txt | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Jan 25 11:49:44 2015 +0000
+++ b/main.cpp Sun Jan 25 14:04:04 2015 +0000
@@ -296,9 +296,7 @@
/*
* UI threads
*/
- if (auto_transmit_flag == 0xA5A5) {
- Thread t2(auto_update_timer_thread);
- }
+ Thread t2(auto_update_timer_thread);
Thread t3(wdt_reset_thread);
/*
@@ -338,7 +336,7 @@
*/
while (true) {
#ifdef TCP_CLIENT // auto update device status to a remote TCP server
- if (auto_transmit_flag == 0xA5A5) {
+ if (auto_transmit_flag == DEFAULT_ENABLE_FLAG_VALUE) {
// connect to TCP server if required
if (!tcp_sock.is_connected()) {
ret = tcp_sock.connect(str_server_ip_addr, u16tcp_server_port); // timeout is default in connect() in W5500.h
@@ -564,6 +562,7 @@
DBG("Received user configuration");
write_eeprom_network(&received_buffer[strlen(DEVICE_CONFIG_CODE)]); // parameters from 5th char, 15-bytes
+ NVIC_SystemReset();
break;
}
// length = 12, SET TCP SERVER CONFIGURATION
@@ -579,6 +578,7 @@
DBG("Received TCP server configuration");
write_eeprom_tcpserver(&received_buffer[strlen(DEVICE_CONFIG_CODE)]); // parameters from 5th char
+ NVIC_SystemReset();
break;
}
default:
--- a/readme.txt Sun Jan 25 11:49:44 2015 +0000
+++ b/readme.txt Sun Jan 25 14:04:04 2015 +0000
@@ -17,4 +17,6 @@
v1.1 (24/01/2015)
+ Modified: control command is able to be processed by both TCP and UDP.
Only one network output buffer is used for RPC-style and NNIO protocols.
- + Modified: process RPC-style command in tcp client, similar to TCP/UDP server.
\ No newline at end of file
+ + Modified: process RPC-style command in tcp client, similar to TCP/UDP server.
+ Start auto_update_timer_thread() only if auto transmit is enabled.
+ + Updated: automatically reset after setting network configuration or setting TCP server for auto update mode.
\ No newline at end of file
