a
Dependencies: BSP_B-L475E-IOT01
Revision 2:6bc8f96eb54f, committed 2018-12-07
- Comitter:
- lucaspennati
- Date:
- Fri Dec 07 00:44:39 2018 +0000
- Parent:
- 1:57a53e16f6e6
- Commit message:
- aa
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Dec 06 16:30:27 2018 +0000 +++ b/main.cpp Fri Dec 07 00:44:39 2018 +0000 @@ -85,50 +85,47 @@ printf("--- Mbed OS filesystem example ---\n"); - // Try to mount the filesystem - printf("Mounting the filesystem... "); + // Mount the filesystem + printf("Mounting the filesystem\n"); fflush(stdout); int err = fs.mount(&bd); printf("%s\n", (err ? "Fail :(" : "OK")); if (err) { // Reformat if we can't mount the filesystem // this should only happen on the first boot - printf("No filesystem found, formatting... "); + printf("ERROR -> Formatting due to no filesystem exists"); fflush(stdout); err = fs.reformat(&bd); printf("%s\n", (err ? "Fail :(" : "OK")); if (err) { - error("error: %s (%d)\n", strerror(-err), err); + error("ERROR -> %s (%d)\n", strerror(-err), err); } } // Open the numbers file - printf("Opening \"/fs/numbers.txt\"... "); + printf("Opening \"/fs/numbers.txt\"\n"); fflush(stdout); file = fopen("/fs/numbers.txt", "r+"); printf("%s\n", (!file ? "Fail :(" : "OK")); if (!file) { // Create the numbers file if it doesn't exist - printf("No file found, creating a new file... "); + printf("Creating a new file\n"); fflush(stdout); file = fopen("/fs/numbers.txt", "w+"); printf("%s\n", (!file ? "Fail :(" : "OK")); if (!file) { - error("error: %s (%d)\n", strerror(errno), -errno); + error("ERROR -> %s (%d)\n", strerror(errno), -errno); } - printf("Seeking file... "); + printf("Seeking file\n"); fflush(stdout); err = fseek(file, 0, SEEK_SET); printf("%s\n", (err < 0 ? "Fail :(" : "OK")); if (err < 0) { - error("error: %s (%d)\n", strerror(errno), -errno); + error("ERROR -> %s (%d)\n", strerror(errno), -errno); } } - - + ticker.attach(&readData, 60); - - }