From f92e55e791be318715042793778ac96725b5772d Mon Sep 17 00:00:00 2001 From: Ali Jahangiri <75624145+aliphys@users.noreply.github.com> Date: Fri, 1 Sep 2023 13:32:08 +0200 Subject: [PATCH 1/2] Fix spelling --- README.md | 8 ++++---- docs/api.md | 12 ++++++------ .../TestRepeatedFormatMount.ino | 2 +- extras/tests/TestUnified/TestUnified.ino | 10 +++++----- src/Folder.h | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 3c0c0d0..ec8d214 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ The Arduino_UnifiedStorage library provides a unified interface to access differ ## Examples * [**examples/SimpleStorageWriteRead**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/SimpleStorageWriteRead/SimpleStorageWriteRead.ino) - this example is concerned with reading/writing and seeking -* [**examples/AdvancedUSBInternalOperations**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/AdvancedUSBInternalOperations/AdvancedUSBInternalOperations.ino) - this example is concerned with more advanced features like creating folders, traversing folder sturctures and moving/copying from one storage medium to another -* [**examples/PortentaH7Logger**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/PortentaH7Logger/PortentaH7Logger.ino) - this is more of a real life usecase, where this library is used to log sensor data to a file on the internal storage and check if a USB Mass Storage deviece is inserted. If it is detected it will backup the information on the internal storage, only copying the bytes that are new since the last update. +* [**examples/AdvancedUSBInternalOperations**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/AdvancedUSBInternalOperations/AdvancedUSBInternalOperations.ino) - this example is concerned with more advanced features like creating folders, traversing folder structures and moving/copying from one storage medium to another +* [**examples/PortentaH7Logger**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/PortentaH7Logger/PortentaH7Logger.ino) - this is more of a real life usecase, where this library is used to log sensor data to a file on the internal storage and check if a USB Mass Storage device is inserted. If it is detected it will backup the information on the internal storage, only copying the bytes that are new since the last update. * [**examples/BackupInternalPartitions**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/BackupInternalPartitions/BackupInternalPartitions.ino) - Another real life usecase, where this library is used to back-up all partitions on the internal storage to a USB Mass Storage device. ## Instructions @@ -18,13 +18,13 @@ The Arduino_UnifiedStorage library provides a unified interface to access differ * Flash the `QSPIFormat` example that can be found in the `STM32H747_System` folder (For Portenta H7/Opta/Giga) * Open the serial monitor and select answer with "n" when this appears "Do you want to use partition scheme 1? Y/[n]" * The sketch will warn you that the content of the QSPI flash will be erased. Answer with "Y". -* When asked if you'd like to use LittleFS on the data parition, select "n". Most of the examples assume that the drive is formatted as FAT. You can use the library to format to LittleFS later. +* When asked if you'd like to use LittleFS on the data partition, select "n". Most of the examples assume that the drive is formatted as FAT. You can use the library to format to LittleFS later. * Reboot the board ### Formatting the Portenta C33 Internal Storage * Flash the `QSPIFormat` example that can be found in the `Storage` folder for Portenta C33. * Open the Serial Monitor. The sketch will warn you that the content of the QSPI flash will be erased. Answer with "Y". -* When asked if you'd like to use LittleFS on the data parition, select "n". Most of the examples assume that the drive is formatted as FAT. You can use the library to format to LittleFS later. +* When asked if you'd like to use LittleFS on the data partition, select "n". Most of the examples assume that the drive is formatted as FAT. You can use the library to format to LittleFS later. * Reboot the board ## Features diff --git a/docs/api.md b/docs/api.md index 6dc2c15..60c1220 100644 --- a/docs/api.md +++ b/docs/api.md @@ -88,8 +88,8 @@ Class representing a directory. `public String ` [`getPathString`](#class_folder_1a30dd952da8ae977dca4e3dfde8fbd5be)`()` | Returns the path of the file. `public ` [`Folder`](#class_folder)` ` [`createSubfolder`](#class_folder_1a78f2f9b297f62b67c2e0656b15a95868)`(const char * subfolderName, bool overwrite)` | Creates a subfolder in the directory. `public ` [`Folder`](#class_folder)` ` [`createSubfolder`](#class_folder_1ab50743664becb7b2a1fb564b5513d69c)`(String subfolderName, bool overwrite)` | Creates a subfolder in the directory. -`public std::vector< ` [`UFile`](#class_u_file)` > ` [`getFiles`](#class_folder_1a3c2e01e19b48e3aa709cbdbb0acbdd78)`()` | Returns File objects for all files in the current dirctory. -`public std::vector< ` [`Folder`](#class_folder)` > ` [`getFolders`](#class_folder_1a69d3df42dacbd1d64d0f527e090f1fbb)`()` | Returns [Folder](#class_folder) objects for all files in the current dirctory. +`public std::vector< ` [`UFile`](#class_u_file)` > ` [`getFiles`](#class_folder_1a3c2e01e19b48e3aa709cbdbb0acbdd78)`()` | Returns File objects for all files in the current directory. +`public std::vector< ` [`Folder`](#class_folder)` > ` [`getFolders`](#class_folder_1a69d3df42dacbd1d64d0f527e090f1fbb)`()` | Returns [Folder](#class_folder) objects for all files in the current directory. `public bool ` [`copyTo`](#class_folder_1aabf0818b7ee45b2d871e82e86edb4ebd)`(` [`Folder`](#class_folder)` destination, bool overwrite)` | Copies the current directory. `public bool ` [`copyTo`](#class_folder_1a058d193f53c559eefe343b30797500eb)`(const char * destination, bool overwrite)` | Copies the current directory. `public bool ` [`copyTo`](#class_folder_1a3162979e4c679c7f5503cc4584949714)`(String destination, bool overwrite)` | Copies the current directory. @@ -128,7 +128,7 @@ Creates a file inside the directory. * `const` char * fileName - The name of the file to create. #### Returns -A File object if successfull, NULL if not. +A File object if successful, NULL if not. ### `public ` [`UFile`](#class_u_file)` ` [`createFile`](#class_folder_1a44255e2c0c4ffa37d7637a601bc590f6)`(String fileName, FileMode fmode)` @@ -138,7 +138,7 @@ Creates a file inside the directory. * `String` fileName - The name of the file to create. #### Returns -A File object if successfull, NULL if not. +A File object if successful, NULL if not. ### `public bool ` [`remove`](#class_folder_1aca893daac6c6747895d50987cf9cf34c)`()` @@ -217,14 +217,14 @@ The created subfolder. ### `public std::vector< ` [`UFile`](#class_u_file)` > ` [`getFiles`](#class_folder_1a3c2e01e19b48e3aa709cbdbb0acbdd78)`()` -Returns File objects for all files in the current dirctory. +Returns File objects for all files in the current directory. #### Returns A std::vector of File objects representing the files in the directory. ### `public std::vector< ` [`Folder`](#class_folder)` > ` [`getFolders`](#class_folder_1a69d3df42dacbd1d64d0f527e090f1fbb)`()` -Returns [Folder](#class_folder) objects for all files in the current dirctory. +Returns [Folder](#class_folder) objects for all files in the current directory. #### Returns A std::vector of [Folder](#class_folder) objects representing the files in the directory. diff --git a/extras/tests/TestRepeatedFormatMount/TestRepeatedFormatMount.ino b/extras/tests/TestRepeatedFormatMount/TestRepeatedFormatMount.ino index 0fb4bbd..7131da6 100644 --- a/extras/tests/TestRepeatedFormatMount/TestRepeatedFormatMount.ino +++ b/extras/tests/TestRepeatedFormatMount/TestRepeatedFormatMount.ino @@ -42,7 +42,7 @@ void runRepeatedMountTest(Arduino_UnifiedStorage * storage, String storageType, Serial.println(umountResult); Serial.println(getErrno()); } else { - Serial.println("Succesfully unmounted"); + Serial.println("Successfully unmounted"); } } } diff --git a/extras/tests/TestUnified/TestUnified.ino b/extras/tests/TestUnified/TestUnified.ino index 695642f..c408a98 100644 --- a/extras/tests/TestUnified/TestUnified.ino +++ b/extras/tests/TestUnified/TestUnified.ino @@ -17,9 +17,9 @@ InternalStorage * qspi = new InternalStorage(); #endif -void test(String opperation, Arduino_UnifiedStorage* sourceStorage, Arduino_UnifiedStorage* destinationStorage, const char* storageTypeA, const char* storageTypeB) { +void test(String operation, Arduino_UnifiedStorage* sourceStorage, Arduino_UnifiedStorage* destinationStorage, const char* storageTypeA, const char* storageTypeB) { Serial.println("----------------------------------------------------------"); - Serial.println("Running test for " + opperation + " from " + String(storageTypeA) + " to " + String(storageTypeB) + "\n"); + Serial.println("Running test for " + operation + " from " + String(storageTypeA) + " to " + String(storageTypeB) + "\n"); int mountSource = sourceStorage -> begin(); int mountDest = destinationStorage->begin(); @@ -36,18 +36,18 @@ void test(String opperation, Arduino_UnifiedStorage* sourceStorage, Arduino_Unif fileToMove.close(); int opperationResult = -1; - if (opperation == "move") { + if (operation == "move") { opperationResult = fileToMove.moveTo(destinationStorage->getRootFolder(), true); fileToMove.close(); fileToMove.remove(); - } else if(opperation == "copy"){ + } else if(operation == "copy"){ opperationResult = fileToMove.copyTo(destinationStorage->getRootFolder(), true); fileToMove.close(); fileToMove.remove(); } if (opperationResult) { - Serial.println(opperation + " from " + String(storageTypeA) + " to " + String(storageTypeB) + " successful"); + Serial.println(operation + " from " + String(storageTypeA) + " to " + String(storageTypeB) + " successful"); } diff --git a/src/Folder.h b/src/Folder.h index 9554d92..58d17df 100644 --- a/src/Folder.h +++ b/src/Folder.h @@ -34,14 +34,14 @@ class Folder { /** * @brief Creates a file inside the directory. * @param const char * fileName - The name of the file to create. - * @return A File object if successfull, NULL if not. + * @return A File object if successful, NULL if not. */ UFile createFile(const char * fileName, FileMode fmode); /** * @brief Creates a file inside the directory. * @param String fileName - The name of the file to create. - * @return A File object if successfull, NULL if not. + * @return A File object if successful, NULL if not. */ UFile createFile(String fileName, FileMode fmode); @@ -101,13 +101,13 @@ class Folder { Folder createSubfolder(String subfolderName, bool overwrite = false); /** - * @brief Returns File objects for all files in the current dirctory. + * @brief Returns File objects for all files in the current directory. * @return A std::vector of File objects representing the files in the directory. */ std::vector getFiles(); /** - * @brief Returns Folder objects for all files in the current dirctory. + * @brief Returns Folder objects for all files in the current directory. * @return A std::vector of Folder objects representing the files in the directory. */ std::vector getFolders(); From fad02f1a3cddc6ef03e6abbf8dc6f0eaa608fabe Mon Sep 17 00:00:00 2001 From: Ali Jahangiri <75624145+aliphys@users.noreply.github.com> Date: Fri, 1 Sep 2023 13:36:20 +0200 Subject: [PATCH 2/2] Two more fixes --- examples/PortentaH7Logger/PortentaH7Logger.ino | 2 +- extras/tests/TestFileOperations/TestFileOperations.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/PortentaH7Logger/PortentaH7Logger.ino b/examples/PortentaH7Logger/PortentaH7Logger.ino index 9a68c64..a7241bd 100644 --- a/examples/PortentaH7Logger/PortentaH7Logger.ino +++ b/examples/PortentaH7Logger/PortentaH7Logger.ino @@ -17,7 +17,7 @@ INSTRUCTIONS * This sketch will log data, and check if there is any USB MSD Device connected to the USB Port of the Opta. The USB device is mounted and unmounted after every update operation. The first status LED is on when the USB drive is mounted. So as long as the status LED is off you can safely remove the drive. - The skecth will log to internal storage in the meantime, and wait for the USB drive to be inserted again. + The sketch will log to internal storage in the meantime, and wait for the USB drive to be inserted again. */ #include "Arduino_UnifiedStorage.h" diff --git a/extras/tests/TestFileOperations/TestFileOperations.ino b/extras/tests/TestFileOperations/TestFileOperations.ino index 19bff6d..171c229 100644 --- a/extras/tests/TestFileOperations/TestFileOperations.ino +++ b/extras/tests/TestFileOperations/TestFileOperations.ino @@ -298,7 +298,7 @@ void runTests(Arduino_UnifiedStorage * storage, String storageType) { testMovingFile(root); Serial.println("\n========= FS Contents after File Tests ========="); - Serial.println("Should be empty if deletion was succesful"); + Serial.println("Should be empty if deletion was successful"); printFolderContents(root); Serial.println("=============================\n");