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

Commit 141121e

Browse files
authored
v1.2.1 to add support to Seeeduino nRF52
### Releases v1.2.1 1. Add support to Seeeduino nRF52840-based boards such as **SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `mbed` core 2. Add astyle using `allman` style. Restyle the library 3. Display compile warning only when `_FS_LOGLEVEL_ > 3`
1 parent be5c87d commit 141121e

File tree

11 files changed

+421
-260
lines changed

11 files changed

+421
-260
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ 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_nano` Core Version (e.g. Arduino mbed_nano core v2.6.1)
19-
* `nRF52840-based Nano_33_BLE` Board type (e.g. Nano_33_BLE, Nano_33_BLE_Sense, etc.)
18+
* `nRF52840 mbed` Core Version (e.g. Arduino mbed_nano core v3.4.1, Seeeduino mbed core v2.7.2)
19+
* `nRF52840-based Nano_33_BLE` Board type (e.g. Nano_33_BLE, Nano_33_BLE_Sense, SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE, etc.)
2020
* Contextual information (e.g. what you were trying to achieve)
2121
* Simplest possible steps to reproduce
2222
* Anything that might be relevant in your opinion, such as:
@@ -28,13 +28,13 @@ Please ensure to specify the following:
2828

2929
```
3030
Arduino IDE version: 1.8.19
31-
Arduino mbed_nano core v2.6.1
31+
Arduino mbed_nano core v3.4.1
3232
Nano_33_BLE board
3333
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.4.0-94-generic #106-Ubuntu SMP Thu Jan 6 23:58:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
34+
Linux xy-Inspiron-3593 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 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,31 @@ 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/FS_Nano33BLE/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/ESPAsync_WiFiManager_GitHub/
66+
xy@xy-Inspiron-3593:~/Arduino/xy/ESPAsync_WiFiManager_GitHub$
67+
```
68+
69+
2. Issue astyle command
70+
71+
```
72+
xy@xy-Inspiron-3593:~/Arduino/xy/ESPAsync_WiFiManager_GitHub$ bash utils/restyle.sh
73+
```

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.2.1](#releases-v121)
1516
* [Releases v1.2.0](#releases-v120)
1617
* [Releases v1.1.0](#releases-v110)
1718
* [Initial Releases v1.0.0](#initial-releases-v100)
@@ -21,6 +22,12 @@
2122

2223
## Changelog
2324

25+
### Releases v1.2.1
26+
27+
1. Add support to Seeeduino nRF52840-based boards such as **SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `mbed` core
28+
2. Add astyle using `allman` style. Restyle the library
29+
3. Display compile warning only when `_FS_LOGLEVEL_ > 3`
30+
2431
### Releases v1.2.0
2532

2633
1. Use correct NANO33BLE_FS_START address without wasting flash space. Check [Half size of flash #2](https://github.com/khoih-prog/FS_Nano33BLE/discussions/2)

examples/FS_Counting/FS_Counting.ino

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/****************************************************************************************************************************
22
FS_Counting.ino - Filesystem wrapper for FS (LittleFS and FATFS) on the Mbed Nano-33-BLE
3-
3+
44
For MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense.
55
Written by Khoi Hoang
66
77
Built by Khoi Hoang https://github.com/khoih-prog/FS_Nano33BLE
88
Licensed under MIT license
99
*****************************************************************************************************************************/
1010

11-
#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.2.0"
12-
#define FS_NANO33BLE_VERSION_MIN 1002000
11+
#define FS_NANO33BLE_VERSION_MIN_TARGET "FS_Nano33BLE v1.2.1"
12+
#define FS_NANO33BLE_VERSION_MIN 1002001
1313

1414
#define _FS_LOGLEVEL_ 1
1515

@@ -29,90 +29,99 @@
2929

3030
FileSystem_MBED *myFS;
3131

32-
void setup()
32+
void setup()
3333
{
3434
Serial.begin(115200);
35-
while (!Serial)
35+
36+
while (!Serial && millis() < 5000);
3637

3738
delay(1000);
3839

39-
Serial.print("\nStart FS_Counting on "); Serial.println(BOARD_NAME);
40+
Serial.print("\nStart FS_Counting on ");
41+
Serial.println(BOARD_NAME);
4042
Serial.println(FS_NANO33BLE_VERSION);
4143

4244
#if defined(FS_NANO33BLE_VERSION_MIN)
45+
4346
if (FS_NANO33BLE_VERSION_INT < FS_NANO33BLE_VERSION_MIN)
4447
{
4548
Serial.print("Warning. Must use this example on Version equal or later than : ");
4649
Serial.println(FS_NANO33BLE_VERSION_MIN_TARGET);
4750
}
51+
4852
#endif
4953

50-
Serial.print("FS_size (KB) = "); Serial.println(NANO33BLE_FS_SIZE_KB);
51-
Serial.print("FS_ Start Address = 0x"); Serial.println(NANO33BLE_FS_START, HEX);
54+
Serial.print("FS_size (KB) = ");
55+
Serial.println(NANO33BLE_FS_SIZE_KB);
56+
Serial.print("FS_ Start Address = 0x");
57+
Serial.println(NANO33BLE_FS_START, HEX);
5258

5359
myFS = new FileSystem_MBED();
5460

55-
if (!myFS->init())
61+
if (!myFS->init())
5662
{
5763
Serial.println("FS Mount Failed");
58-
64+
5965
return;
6066
}
6167

6268
char fileName[] = MBED_FS_FILE_PREFIX "/counts.txt";
6369

64-
#define BUF_SIZE 32
65-
70+
#define BUF_SIZE 32
71+
6672
char buff[BUF_SIZE];
6773
int count = 1;
6874

6975
#if START_COUNT_OVER
70-
Serial.print("Deleting file: "); Serial.print(fileName);
71-
72-
if (remove(fileName) == 0)
76+
Serial.print("Deleting file: ");
77+
Serial.print(fileName);
78+
79+
if (remove(fileName) == 0)
7380
{
7481
Serial.println(" => OK");
7582
}
7683
else
7784
{
7885
Serial.println(" => Failed");
7986
}
87+
8088
#endif
81-
89+
8290
FILE *file = fopen(fileName, "r");
83-
84-
if (file)
91+
92+
if (file)
8593
{
8694
Serial.println(" => Open to read OK");
87-
95+
8896
bzero(buff, BUF_SIZE);
89-
97+
9098
uint32_t numRead = fread((uint8_t *) buff, BUF_SIZE - 1, 1, file);
91-
99+
92100
if ( numRead )
93101
{
94102
sscanf(buff, "%d", &count);
95103
//Serial.print("Times have been run = "); Serial.println(count);
96104
}
97-
105+
98106
fclose(file);
99107
}
100108

101-
Serial.print("Times have been run = "); Serial.println(count);
102-
109+
Serial.print("Times have been run = ");
110+
Serial.println(count);
111+
103112
sprintf(buff, "%d\n", ++count);
104-
113+
105114
file = fopen(fileName, "w");
106-
107-
if (file)
115+
116+
if (file)
108117
{
109118
Serial.println(" => Open to write OK");
110-
119+
111120
fwrite((uint8_t *) buff, 1, BUF_SIZE - 1, file) ;
112121
fclose(file);
113122
}
114123
}
115124

116-
void loop()
125+
void loop()
117126
{
118127
}

0 commit comments

Comments
 (0)