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.
Fork of TFTPServerTest by
Revision 2:228ce0f5c9c8, committed 2018-03-16
- Comitter:
- hudakz
- Date:
- Fri Mar 16 19:34:42 2018 +0000
- Parent:
- 1:698437bcd48d
- Child:
- 3:77497b352c3f
- Commit message:
- Updated.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Mar 16 19:28:34 2018 +0000
+++ b/main.cpp Fri Mar 16 19:34:42 2018 +0000
@@ -54,7 +54,6 @@
{
// Try to mount the filesystem. This should work without the Ethernet.
pc.printf("Mounting the filesystem... \r\n");
-// fflush(stdout);
int err = fs.mount(&bd);
pc.printf("%s\r\n", (err ? "Failed :(\r\n" : "OK\r\n"));
@@ -64,7 +63,6 @@
// Open a file. This should work without the Ethernet, too.
pc.printf("Opening \"/fs/test.txt\"... \r\n");
-// fflush(stdout);
FILE* fp = fopen("/fs/test.txt", "r+");
pc.printf("%s\r\n", (!fp ? "Failed :(\r\n" : "OK\r\n"));
@@ -73,8 +71,7 @@
{
// Create the test file if it doesn't exist
pc.printf("No file found, creating a new file ...\r\n");
-// fflush(stdout);
- fp = fopen("/fs/test.txt", "w+");
+ fp = fopen("/fs/test.txt", "w+");
pc.printf("%s\r\n", (!fp ? "Fail :(" : "OK"));
if (!fp)
error("error: %s (%d)\r\n", strerror(errno), -errno);
@@ -82,7 +79,6 @@
for (int i = 0; i < 10; i++)
{
pc.printf("\rWriting numbers (%d/%d)... ", i, 10);
-// fflush(stdout);
err = fprintf(fp, " %d\n", i);
if (err < 0)
{
@@ -94,7 +90,6 @@
pc.printf("\rWriting numbers (%d/%d)... OK\r\n", 10, 10);
pc.printf("Seeking file ...\r\n");
-// fflush(stdout);
err = fseek(fp, 0, SEEK_SET);
pc.printf("%s\r\n", (err < 0 ? "Fail :(" : "OK"));
if (err < 0)
