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.
Revision 0:a1a5934e82aa, committed 2018-03-22
- Comitter:
- aktk
- Date:
- Thu Mar 22 20:18:38 2018 +0000
- Commit message:
- mbed freezes when fopen() after (EthernetInterface*)net->connet();
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Mar 22 20:18:38 2018 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+LocalFileSystem local("local");
+void func();
+EthernetInterface *net;
+
+int main()
+{
+ func();
+ net = new EthernetInterface();
+ func();
+ if(net->connect()) {
+ printf("Error!@EthernetInterface::connect()\r\n");
+ } else {
+ printf("IP Address is %s\r\n", net->get_ip_address());
+ }
+ func();
+}
+
+
+void func()
+{
+ static int i = 1;
+ printf("-------test of fopen()#%d----\r\n", i);
+ if(fopen("/local/test.txt", "r")==NULL)
+ printf("File could not open\r\n");
+ else
+ printf("File was opened successfully.\r\n");
+ i++;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Thu Mar 22 20:18:38 2018 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#16bac101a6b7b4724023dcf86ece1548e3a23cbf