Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 088cf4b

Browse files
authored
Update README.md and use allman astyle
1 parent c29cc94 commit 088cf4b

File tree

10 files changed

+347
-203
lines changed

10 files changed

+347
-203
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18-
* `Arduino mbed_rp2040` Core Version (e.g. Arduino mbed_rp2040 core v2.6.1)
18+
* `Arduino mbed_rp2040` Core Version (e.g. Arduino mbed_rp2040 core v3.4.1)
1919
* `RP2040` Board type (e.g. Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, GENERIC_RP2040, etc.)
2020
* Contextual information (e.g. what you were trying to achieve)
2121
* Simplest possible steps to reproduce
@@ -28,13 +28,13 @@ Please ensure to specify the following:
2828

2929
```
3030
Arduino IDE version: 1.8.19
31-
Arduino mbed_rp2040 core v2.6.1
31+
Arduino mbed_rp2040 core v3.4.1
3232
RASPBERRY_PI_PICO board
3333
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
34+
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3535
3636
Context:
37-
I encountered a crash while using TimerInterrupt.
37+
I encountered a crash while using this library
3838
3939
Steps to reproduce:
4040
1. ...
@@ -43,12 +43,33 @@ Steps to reproduce:
4343
4. ...
4444
```
4545

46+
---
47+
4648
### Sending Feature Requests
4749

4850
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
4951

5052
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/LittleFS_Mbed_RP2040/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
5153

54+
---
55+
5256
### Sending Pull Requests
5357

5458
Pull Requests with changes and fixes are also welcome!
59+
60+
Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)
61+
62+
1. Change directory to the library GitHub
63+
64+
```
65+
xy@xy-Inspiron-3593:~$ cd Arduino/xy/LittleFS_Mbed_RP2040_GitHub/
66+
xy@xy-Inspiron-3593:~/Arduino/xy/LittleFS_Mbed_RP2040_GitHub$
67+
```
68+
69+
2. Issue astyle command
70+
71+
```
72+
xy@xy-Inspiron-3593:~/Arduino/xy/LittleFS_Mbed_RP2040_GitHub$ bash utils/restyle.sh
73+
```
74+
75+

README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
77
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/LittleFS_Mbed_RP2040.svg)](http://github.com/khoih-prog/LittleFS_Mbed_RP2040/issues)
88

9-
<a href="https://www.buymeacoffee.com/khoihprog6" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 50px !important;width: 181px !important;" ></a>
9+
10+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
11+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
13+
<a href="https://profile-counter.glitch.me/khoih-prog-LittleFS_Mbed_RP2040/count.svg" title="LittleFS_Mbed_RP2040 Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-LittleFS_Mbed_RP2040/count.svg" style="height: 30px;width: 200px;"></a>
1014

1115

1216
---
@@ -46,11 +50,20 @@
4650

4751
### Important Notes
4852

49-
The LittleFS of the new **Nano_RP2040_Connect** board ( see [New board](pics/New_Board.png) ), using ISSI Flash chip, is currently not working with [`Arduino mbed_rp2040 core 2.4.1`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/2.4.1). Please downgrade to [`Arduino mbed_rp2040 core 2.3.1`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/2.3.1)
53+
The LittleFS of the new **Nano_RP2040_Connect** board (see picture below), using `ISSI` Flash chip, is currently **not working** with [`Arduino mbed_rp2040 core 2.4.1+`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/2.4.1). Please downgrade to [`Arduino mbed_rp2040 core 2.3.1`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/2.3.1)
54+
55+
<p align="center">
56+
<img src="https://github.com/khoih-prog/LittleFS_Mbed_RP2040/raw/main/pics/New_Board.png">
57+
</p>
5058

5159
Check [**RP2040 Connect board has faulty components in newest purchase** #318](https://github.com/arduino/ArduinoCore-mbed/issues/318#) for more information of when and how the issue will be fixed.
5260

53-
The old board ( see [Old board](pics/Old_Board.png) ), using Adesto Flash chip, is currently working with [`Arduino mbed_rp2040 core 2.4.1`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/2.4.1).
61+
The old board (see picture below), using `Adesto` Flash chip, is currently working with [`Arduino mbed_rp2040 core 2.4.1+`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/2.4.1).
62+
63+
64+
<p align="center">
65+
<img src="https://github.com/khoih-prog/LittleFS_Mbed_RP2040/raw/main/pics/Old_Board.png">
66+
</p>
5467

5568
---
5669
---
@@ -102,7 +115,7 @@ Another way to install is to:
102115

103116
1. Install [VS Code](https://code.visualstudio.com/)
104117
2. Install [PlatformIO](https://platformio.org/platformio-ide)
105-
3. Install [**LittleFS_Mbed_RP2040** library](https://platformio.org/lib/show/12420/LittleFS_Mbed_RP2040) by using [Library Manager](https://platformio.org/lib/show/12420/LittleFS_Mbed_RP2040/installation). Search for **LittleFS_Mbed_RP2040** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22)
118+
3. Install [**LittleFS_Mbed_RP2040** library](https://registry.platformio.org/libraries/khoih-prog/LittleFS_Mbed_RP2040) by using [Library Manager](https://registry.platformio.org/libraries/khoih-prog/LittleFS_Mbed_RP2040/installation). Search for **LittleFS_Mbed_RP2040** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22)
106119
4. Use included [platformio.ini](platformio/platformio.ini) file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at [Project Configuration File](https://docs.platformio.org/page/projectconf.html)
107120

108121

@@ -120,7 +133,7 @@ Another way to install is to:
120133

121134
### Example [Littlefs_Test](examples/Littlefs_Test)
122135

123-
```
136+
```cpp
124137
#define LFS_MBED_RP2040_VERSION_MIN_TARGET "LittleFS_Mbed_RP2040 v1.1.0"
125138
#define LFS_MBED_RP2040_VERSION_MIN 1001000
126139

@@ -455,6 +468,8 @@ void loop()
455468
{
456469
}
457470
```
471+
472+
458473
---
459474
---
460475
@@ -464,7 +479,7 @@ void loop()
464479
465480
The following is the sample terminal output when running example [LittleFS_Counting](examples/LittleFS_Counting) on MBED RaspberryPi Pico
466481
467-
```
482+
```cpp
468483
Start LittleFS_Counting on RaspberryPi Pico
469484
LittleFS_Mbed_RP2040 v1.1.0
470485
[LFS] LittleFS size (KB) = 256
@@ -490,12 +505,14 @@ Times have been run = 3
490505
=> Open to write OK
491506
```
492507

508+
---
509+
493510
### 2. LittleFS_Test on RaspberryPi Pico
494511

495512
The following is the sample terminal output when running example [LittleFS_Test](examples/LittleFS_Test) on MBED RaspberryPi Pico
496513

497514

498-
```
515+
```cpp
499516
Start LittleFS_Test on RaspberryPi Pico
500517
LittleFS_Mbed_RP2040 v1.1.0
501518
[LFS] LittleFS size (KB) = 256
@@ -548,7 +565,6 @@ Deleting file: /littlefs/hello2.txt => OK
548565
====================================================
549566

550567
Test complete
551-
552568
```
553569
554570
---
@@ -637,6 +653,6 @@ If you want to contribute to this project:
637653

638654
## Copyright
639655

640-
Copyright 2021- Khoi Hoang
656+
Copyright (c) 2021- Khoi Hoang
641657

642658

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
77
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/LittleFS_Mbed_RP2040.svg)](http://github.com/khoih-prog/LittleFS_Mbed_RP2040/issues)
88

9+
10+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
11+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
13+
<a href="https://profile-counter.glitch.me/khoih-prog-LittleFS_Mbed_RP2040/count.svg" title="LittleFS_Mbed_RP2040 Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-LittleFS_Mbed_RP2040/count.svg" style="height: 30px;width: 200px;"></a>
14+
915
---
1016
---
1117

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************************************************************
22
LittleFS_Counting.ino - Filesystem wrapper for LittleFS on the Mbed RP2040
3-
3+
44
For MBED RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040.
55
Written by Khoi Hoang
66
@@ -22,87 +22,94 @@
2222

2323
LittleFS_MBED *myFS;
2424

25-
void setup()
25+
void setup()
2626
{
2727
Serial.begin(115200);
28+
2829
while (!Serial)
2930

30-
delay(1000);
31+
delay(1000);
3132

32-
Serial.print("\nStart LittleFS_Counting on "); Serial.println(BOARD_NAME);
33+
Serial.print("\nStart LittleFS_Counting on ");
34+
Serial.println(BOARD_NAME);
3335
Serial.println(LFS_MBED_RP2040_VERSION);
3436

3537
#if defined(LFS_MBED_RP2040_VERSION_MIN)
38+
3639
if (LFS_MBED_RP2040_VERSION_INT < LFS_MBED_RP2040_VERSION_MIN)
3740
{
3841
Serial.print("Warning. Must use this example on Version equal or later than : ");
3942
Serial.println(LFS_MBED_RP2040_VERSION_MIN_TARGET);
4043
}
44+
4145
#endif
4246

4347
myFS = new LittleFS_MBED();
4448

45-
if (!myFS->init())
49+
if (!myFS->init())
4650
{
4751
Serial.println("LITTLEFS Mount Failed");
48-
52+
4953
return;
5054
}
5155

5256
char fileName[] = MBED_LITTLEFS_FILE_PREFIX "/counts.txt";
5357

54-
#define BUF_SIZE 32
55-
58+
#define BUF_SIZE 32
59+
5660
char buff[BUF_SIZE];
5761
int count = 1;
5862

5963
#if START_COUNT_OVER
60-
Serial.print("Deleting file: "); Serial.print(fileName);
61-
62-
if (remove(fileName) == 0)
64+
Serial.print("Deleting file: ");
65+
Serial.print(fileName);
66+
67+
if (remove(fileName) == 0)
6368
{
6469
Serial.println(" => OK");
6570
}
6671
else
6772
{
6873
Serial.println(" => Failed");
6974
}
75+
7076
#endif
71-
77+
7278
FILE *file = fopen(fileName, "r");
73-
74-
if (file)
79+
80+
if (file)
7581
{
7682
Serial.println(" => Open to read OK");
77-
83+
7884
bzero(buff, BUF_SIZE);
79-
85+
8086
uint32_t numRead = fread((uint8_t *) buff, BUF_SIZE - 1, 1, file);
81-
87+
8288
if ( numRead )
8389
{
8490
sscanf(buff, "%d", &count);
8591
//Serial.print("Times have been run = "); Serial.println(count);
8692
}
87-
93+
8894
fclose(file);
8995
}
9096

91-
Serial.print("Times have been run = "); Serial.println(count);
92-
97+
Serial.print("Times have been run = ");
98+
Serial.println(count);
99+
93100
sprintf(buff, "%d\n", ++count);
94-
101+
95102
file = fopen(fileName, "w");
96-
97-
if (file)
103+
104+
if (file)
98105
{
99106
Serial.println(" => Open to write OK");
100-
107+
101108
fwrite((uint8_t *) buff, 1, BUF_SIZE - 1, file) ;
102109
fclose(file);
103110
}
104111
}
105112

106-
void loop()
113+
void loop()
107114
{
108115
}

0 commit comments

Comments
 (0)