LPC1768 DOESN'T freeze while processing this program, even when fopen() is called after EthernetInterface.connect() (with MBED OS 2) see also https://os.mbed.com/users/aktk/code/eth-filesystem-sample/
Dependencies: EthernetInterface mbed-rtos mbed
Fork of eth-filesystem-sample by
main.cpp
- Committer:
- aktk
- Date:
- 2018-03-22
- Revision:
- 1:4de86c361e68
- Parent:
- 0:a1a5934e82aa
File content as of revision 1:4de86c361e68:
#include "mbed.h"
#include "EthernetInterface.h"
LocalFileSystem local("local");
void func();
EthernetInterface *net;
int main()
{
func();
net = new EthernetInterface();
func();
net->init();
if(net->connect()) {
printf("Error!@EthernetInterface::connect()\r\n");
} else {
printf("IP Address is %s\r\n", net->getIPAddress());
}
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++;
}
