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

Commit 3712949

Browse files
authored
v1.3.2 to be compatible with old codes
### Releases v1.3.2 1. Make compatible with old libraries and codes
1 parent 24bf986 commit 3712949

12 files changed

+138
-31
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ BBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB
574574

575575
```
576576
Start StoreNameAndSurname on SEEED_XIAO_M0
577-
FlashStorage_SAMD v1.3.1
577+
FlashStorage_SAMD v1.3.2
578578
EEPROM length: 1024
579579
EEPROM is empty, writing WRITTEN_SIGNATURE and some example data:
580580
Insert your name : John
@@ -589,7 +589,7 @@ You can reset to check emulated-EEPROM data retention.
589589

590590
```
591591
Start StoreNameAndSurname on SEEED_XIAO_M0
592-
FlashStorage_SAMD v1.3.1
592+
FlashStorage_SAMD v1.3.2
593593
EEPROM length: 1024
594594
Hi John Doe, nice to see you again :-)
595595
Clearing WRITTEN_SIGNATURE for next try
@@ -604,7 +604,7 @@ Done clearing signature in emulated EEPROM. You can reset now
604604

605605
```
606606
Start EEPROM_Clear on SEEED_XIAO_M0
607-
FlashStorage_SAMD v1.3.1
607+
FlashStorage_SAMD v1.3.2
608608
609609
Emulated EEPROM length (bytes) = 1024
610610
@@ -616,7 +616,7 @@ Done clearing emulated EEPROM. Time spent (ms) = 11
616616

617617
```
618618
Start EEPROM_Clear on SEEED_XIAO_M0
619-
FlashStorage_SAMD v1.3.1
619+
FlashStorage_SAMD v1.3.2
620620
Emulated EEPROM length (bytes) = 2048
621621
Done clearing emulated EEPROM. Time spent (ms) = 22
622622
```
@@ -625,7 +625,7 @@ Done clearing emulated EEPROM. Time spent (ms) = 22
625625

626626
```
627627
Start EEPROM_Clear on SEEED_XIAO_M0
628-
FlashStorage_SAMD v1.3.1
628+
FlashStorage_SAMD v1.3.2
629629
Emulated EEPROM length (bytes) = 4096
630630
Done clearing emulated EEPROM. Time spent (ms) = 42
631631
```
@@ -638,7 +638,7 @@ Done clearing emulated EEPROM. Time spent (ms) = 42
638638

639639
```
640640
Start EEPROM_get on SEEED_XIAO_M0
641-
FlashStorage_SAMD v1.3.1
641+
FlashStorage_SAMD v1.3.2
642642
EEPROM length: 1024
643643
EEPROM doesn't store valid data, writing WRITTEN_SIGNATURE and some example data
644644
Float written to EEPROM: 123.456
@@ -655,7 +655,7 @@ Reset to see how you can retrieve the values by using EEPROM_get!
655655

656656
```
657657
Start EEPROM_get on SEEED_XIAO_M0
658-
FlashStorage_SAMD v1.3.1
658+
FlashStorage_SAMD v1.3.2
659659
EEPROM length: 1024
660660
EEPROM has valid data with WRITTEN_SIGNATURE. Now read some example data
661661
Read float from EEPROM: 123.456
@@ -714,16 +714,16 @@ Submit issues to: [FlashStorage_SAMD issues](https://github.com/khoih-prog/Flash
714714

715715
### DONE
716716

717-
1. Basic emulated-EEPROM for SAMD21/SAMD51.
718-
2. Add `EEPROM.put()` and `EEPROM.get()` functions to read/write the whole struct in emulated-EEPROM
719-
3. Similar features for STM32F/L/H/G/WB/MP1.
720-
4. Add Table of Contents
721-
5. Add support to Industruino SAMD21 DG21 and Industruino SAML21 420MAKER boards
722-
6. Add support to **Sparkfun SAMD21 and SAMD51 boards**
723-
7. Fix `multiple-definitions` linker error.
724-
8. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA`
725-
9. Clean-up by reducing the number of library files
726-
717+
1. Basic emulated-EEPROM for SAMD21/SAMD51.
718+
2. Add `EEPROM.put()` and `EEPROM.get()` functions to read/write the whole struct in emulated-EEPROM
719+
3. Similar features for STM32F/L/H/G/WB/MP1.
720+
4. Add Table of Contents
721+
5. Add support to Industruino SAMD21 DG21 and Industruino SAML21 420MAKER boards
722+
6. Add support to **Sparkfun SAMD21 and SAMD51 boards**
723+
7. Fix `multiple-definitions` linker error.
724+
8. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA`
725+
9. Clean-up by reducing the number of library files
726+
10. Make compatible with old libraries and codes
727727

728728
---
729729
---

changelog.md

Lines changed: 5 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.3.2](#releases-v132)
1516
* [Releases v1.3.1](#releases-v131)
1617
* [Releases v1.3.0](#releases-v130)
1718
* [Releases v1.2.1](#releases-v121)
@@ -25,6 +26,10 @@
2526

2627
## Changelog
2728

29+
### Releases v1.3.2
30+
31+
1. Make compatible with old libraries and codes
32+
2833
### Releases v1.3.1
2934

3035
1. Clean-up by reducing the number of library files

examples/multiFileProject/multiFileProject.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
2525
#endif
2626

27-
#define FLASH_STORAGE_SAMD_VERSION_MIN_TARGET "FlashStorage_SAMD v1.3.1"
28-
#define FLASH_STORAGE_SAMD_VERSION_MIN 1003001
27+
#define FLASH_STORAGE_SAMD_VERSION_MIN_TARGET "FlashStorage_SAMD v1.3.2"
28+
#define FLASH_STORAGE_SAMD_VERSION_MIN 1003002
2929

3030
#include "multiFileProject.h"
3131

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "FlashStorage_SAMD",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"keywords": "storage,data,flash,flashstorage,flash-storage,eeprom,emulated-eeprom",
55
"description": "The FlashStorage library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory of SAMD21/SAMD51. It's using the buffered read and write to minimize the access to Flash. It now supports writing and reading the whole object, not just byte-and-byte.",
66
"authors": [
@@ -32,5 +32,5 @@
3232
"license": "LGPL-3.0",
3333
"frameworks": "arduino",
3434
"platforms": "atmelsam",
35-
"headers": ["FlashStorage_SAMD.h", "FlashStorage_SAMD.hpp"]
35+
"headers": ["FlashStorage_SAMD.h", "FlashStorage_SAMD.hpp", "FlashAsEEPROM_SAMD.h", "FlashAsEEPROM_SAMD.hpp"]
3636
}

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=FlashStorage_SAMD
2-
version=1.3.1
2+
version=1.3.2
33
author=Cristian Maglie <c.maglie@bug.st>, Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
license=GPLv3
@@ -8,4 +8,4 @@ paragraph=Useful if the EEPROM is not available or too small. Currently, ATSAMD2
88
url=https://github.com/khoih-prog/FlashStorage_SAMD
99
architectures=samd
1010
category=Data Storage
11-
includes=FlashStorage_SAMD.h,FlashStorage_SAMD.hpp
11+
includes=FlashStorage_SAMD.h,FlashStorage_SAMD.hpp,FlashAsEEPROM_SAMD.h,FlashAsEEPROM_SAMD.hpp

src/FlashAsEEPROM_SAMD.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/******************************************************************************************************************************************
2+
FlashAsEEPROM_SAMD.h
3+
For SAMD21/SAMD51 using Flash emulated-EEPROM
4+
5+
The FlashStorage_SAMD library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory
6+
of SAMD21/SAMD51. It now supports writing and reading the whole object, not just byte-and-byte.
7+
8+
Based on and modified from Cristian Maglie's FlashStorage (https://github.com/cmaglie/FlashStorage)
9+
10+
Built by Khoi Hoang https://github.com/khoih-prog/FlashStorage_SAMD
11+
Licensed under LGPLv3 license
12+
13+
Orginally written by Cristian Maglie
14+
15+
Copyright (c) 2015 Arduino LLC. All right reserved.
16+
Copyright (c) 2020 Khoi Hoang.
17+
18+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
19+
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
20+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
22+
You should have received a copy of the GNU Lesser General Public License along with this library.
23+
If not, see (https://www.gnu.org/licenses/)
24+
25+
Version: 1.3.2
26+
27+
Version Modified By Date Comments
28+
------- ----------- ---------- -----------
29+
1.0.0 K Hoang 28/03/2020 Initial coding to add support to SAMD51 besides SAMD21
30+
1.1.0 K Hoang 26/01/2021 Add supports to put() and get() for writing and reading the whole object. Fix bug.
31+
1.2.0 K Hoang 18/08/2021 Optimize code. Add debug option
32+
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
33+
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
34+
1.3.1 K Hoang 25/01/2022 Reduce number of library files
35+
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
36+
******************************************************************************************************************************************/
37+
38+
// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
39+
// The .h contains implementations, and can be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
40+
41+
#pragma once
42+
43+
#ifndef FlashAsEEPROM_SAMD_h
44+
#define FlashAsEEPROM_SAMD_h
45+
46+
#include <FlashStorage_SAMD.hpp>
47+
#include <FlashStorage_SAMD_Impl.h>
48+
49+
#endif //#ifndef FlashAsEEPROM_SAMD_h

src/FlashAsEEPROM_SAMD.hpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/******************************************************************************************************************************************
2+
FlashAsEEPROM_SAMD.hpp
3+
For SAMD21/SAMD51 using Flash emulated-EEPROM
4+
5+
The FlashStorage_SAMD library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory
6+
of SAMD21/SAMD51. It now supports writing and reading the whole object, not just byte-and-byte.
7+
8+
Based on and modified from Cristian Maglie's FlashStorage (https://github.com/cmaglie/FlashStorage)
9+
10+
Built by Khoi Hoang https://github.com/khoih-prog/FlashStorage_SAMD
11+
Licensed under LGPLv3 license
12+
13+
Orginally written by Cristian Maglie
14+
15+
Copyright (c) 2015 Arduino LLC. All right reserved.
16+
Copyright (c) 2020 Khoi Hoang.
17+
18+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
19+
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
20+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
22+
You should have received a copy of the GNU Lesser General Public License along with this library.
23+
If not, see (https://www.gnu.org/licenses/)
24+
25+
Version: 1.3.2
26+
27+
Version Modified By Date Comments
28+
------- ----------- ---------- -----------
29+
1.0.0 K Hoang 28/03/2020 Initial coding to add support to SAMD51 besides SAMD21
30+
1.1.0 K Hoang 26/01/2021 Add supports to put() and get() for writing and reading the whole object. Fix bug.
31+
1.2.0 K Hoang 18/08/2021 Optimize code. Add debug option
32+
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
33+
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
34+
1.3.1 K Hoang 25/01/2022 Reduce number of library files
35+
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
36+
******************************************************************************************************************************************/
37+
38+
// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
39+
// The .h contains implementations, and can be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
40+
41+
#pragma once
42+
43+
#ifndef FlashAsEEPROM_SAMD_hpp
44+
#define FlashAsEEPROM_SAMD_hpp
45+
46+
#include <FlashStorage_SAMD.hpp>
47+
48+
#endif //#ifndef FlashAsEEPROM_SAMD_hpp

src/FlashStorage_SAMD.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library.
2323
If not, see (https://www.gnu.org/licenses/)
2424
25-
Version: 1.3.1
25+
Version: 1.3.2
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
@@ -32,6 +32,7 @@
3232
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3333
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
3434
1.3.1 K Hoang 25/01/2022 Reduce number of library files
35+
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
3536
******************************************************************************************************************************************/
3637

3738
// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error

src/FlashStorage_SAMD.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library.
2323
If not, see (https://www.gnu.org/licenses/)
2424
25-
Version: 1.3.1
25+
Version: 1.3.2
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
@@ -32,6 +32,7 @@
3232
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3333
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
3434
1.3.1 K Hoang 25/01/2022 Reduce number of library files
35+
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
3536
******************************************************************************************************************************************/
3637

3738
// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
@@ -54,13 +55,13 @@
5455
#endif
5556

5657
#ifndef FLASH_STORAGE_SAMD_VERSION
57-
#define FLASH_STORAGE_SAMD_VERSION "FlashStorage_SAMD v1.3.1"
58+
#define FLASH_STORAGE_SAMD_VERSION "FlashStorage_SAMD v1.3.2"
5859

5960
#define FLASH_STORAGE_SAMD_VERSION_MAJOR 1
6061
#define FLASH_STORAGE_SAMD_VERSION_MINOR 3
61-
#define FLASH_STORAGE_SAMD_VERSION_PATCH 1
62+
#define FLASH_STORAGE_SAMD_VERSION_PATCH 2
6263

63-
#define FLASH_STORAGE_SAMD_VERSION_INT 1003001
64+
#define FLASH_STORAGE_SAMD_VERSION_INT 1003002
6465

6566
#endif
6667

src/FlashStorage_SAMD21.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
You should have received a copy of the GNU Lesser General Public License along with this library.
2323
If not, see (https://www.gnu.org/licenses/)
2424
25-
Version: 1.3.1
25+
Version: 1.3.2
2626
2727
Version Modified By Date Comments
2828
------- ----------- ---------- -----------
@@ -32,6 +32,7 @@
3232
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3333
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
3434
1.3.1 K Hoang 25/01/2022 Reduce number of library files
35+
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
3536
******************************************************************************************************************************************/
3637

3738
// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error

0 commit comments

Comments
 (0)