Skip to content

Commit 7dceb37

Browse files
docs: Update quick guide with latest changes.
1 parent 7be7f10 commit 7dceb37

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

docs/quick-guide.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,30 @@ Initialise a File System instance with a MicroPython Intel Hex string and start
1616
var micropythonFs = new microbitFs.MicropythonFsHex(IntelHexStr);
1717
var micropythonFsWithFiles = = new microbitFs.MicropythonFsHex(UploadedHexWithUserFiles);
1818

19+
// Import files from a different MicroPython hex file with filesystem
1920
var addedFilenames = micropythonFs.importFilesFromIntelHex(UploadedHexWithUserFiles);
21+
addedFilenames = micropythonFs.importFilesFromIntelHex(UploadedHexWithUserFiles, {overwrite: false, formatFirst: false});
2022

23+
// File operations
2124
micropythonFs.create('filename.txt', 'Error thrown if file already exists.');
22-
micropythonFs.write('filename.txt', 'Create or overwrites file.');
25+
micropythonFs.write('filename.txt', 'Create or overwrite a file.');
2326
// Append not yet implemented
24-
micropythonFs.append('filename.txt', 'Adds additional content.');
25-
var content = micropythonFs.read('filename.txt');
26-
var contentByteArray = micropythonFs.readBytes('filename.txt');
27+
micropythonFs.append('filename.txt', 'Add additional content.');
28+
var fileContent = micropythonFs.read('filename.txt');
29+
var fileContentByteArray = micropythonFs.readBytes('filename.txt');
2730
if (micropythonFs.exists('filename.txt')) {
2831
micropythonFs.remove('filename.txt');
2932
}
3033
var fileSizeInBytes = micropythonFs.size('filename.txt');
3134
var fileList = micropythonFs.ls();
3235

36+
// Filesystem size information
37+
var fsSize = micropythonFs.getStorageSize();
38+
var fsAvailableSize = micropythonFs.getStorageUsed();
39+
var fsUsedSize = micropythonFs.getStorageRemaining();
40+
41+
// Generate a new hex string with MicroPython and the files
3342
var intelHexWithFs = micropythonFs.getIntelHex();
34-
var MicroPythonFsSize = micropythonFs.getFsSize();
3543
```
3644

3745
Public interface can be found in the `src/fs-interface.ts` file.
@@ -50,7 +58,6 @@ if (microbitFs.isAppendedScriptPresent(finalHexStr)) {
5058

5159
```js
5260
var uicrData = getIntelHexUicrData(IntelHexStr);
53-
console.log('' + );
5461
console.log('Flash Page Size:' + uicrData.flashPageSize);
5562
console.log('Runtime Start Page:' + uicrData.runtimeStartPage);
5663
console.log('Runtime Start Address:' + uicrData.runtimeStartAddress);

0 commit comments

Comments
 (0)