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

Commit

Permalink
v1.3.2 to be compatible with old codes
Browse files Browse the repository at this point in the history
### Releases v1.3.2

1. Make compatible with old libraries and codes
  • Loading branch information
khoih-prog authored Jan 26, 2022
1 parent 24bf986 commit 3712949
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 31 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ BBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB

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

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

```
Start EEPROM_Clear on SEEED_XIAO_M0
FlashStorage_SAMD v1.3.1
FlashStorage_SAMD v1.3.2
Emulated EEPROM length (bytes) = 1024
Expand All @@ -616,7 +616,7 @@ Done clearing emulated EEPROM. Time spent (ms) = 11

```
Start EEPROM_Clear on SEEED_XIAO_M0
FlashStorage_SAMD v1.3.1
FlashStorage_SAMD v1.3.2
Emulated EEPROM length (bytes) = 2048
Done clearing emulated EEPROM. Time spent (ms) = 22
```
Expand All @@ -625,7 +625,7 @@ Done clearing emulated EEPROM. Time spent (ms) = 22

```
Start EEPROM_Clear on SEEED_XIAO_M0
FlashStorage_SAMD v1.3.1
FlashStorage_SAMD v1.3.2
Emulated EEPROM length (bytes) = 4096
Done clearing emulated EEPROM. Time spent (ms) = 42
```
Expand All @@ -638,7 +638,7 @@ Done clearing emulated EEPROM. Time spent (ms) = 42

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

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

### DONE

1. Basic emulated-EEPROM for SAMD21/SAMD51.
2. Add `EEPROM.put()` and `EEPROM.get()` functions to read/write the whole struct in emulated-EEPROM
3. Similar features for STM32F/L/H/G/WB/MP1.
4. Add Table of Contents
5. Add support to Industruino SAMD21 DG21 and Industruino SAML21 420MAKER boards
6. Add support to **Sparkfun SAMD21 and SAMD51 boards**
7. Fix `multiple-definitions` linker error.
8. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA`
9. Clean-up by reducing the number of library files

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

---
---
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.3.2](#releases-v132)
* [Releases v1.3.1](#releases-v131)
* [Releases v1.3.0](#releases-v130)
* [Releases v1.2.1](#releases-v121)
Expand All @@ -25,6 +26,10 @@

## Changelog

### Releases v1.3.2

1. Make compatible with old libraries and codes

### Releases v1.3.1

1. Clean-up by reducing the number of library files
Expand Down
4 changes: 2 additions & 2 deletions examples/multiFileProject/multiFileProject.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
#endif

#define FLASH_STORAGE_SAMD_VERSION_MIN_TARGET "FlashStorage_SAMD v1.3.1"
#define FLASH_STORAGE_SAMD_VERSION_MIN 1003001
#define FLASH_STORAGE_SAMD_VERSION_MIN_TARGET "FlashStorage_SAMD v1.3.2"
#define FLASH_STORAGE_SAMD_VERSION_MIN 1003002

#include "multiFileProject.h"

Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FlashStorage_SAMD",
"version": "1.3.1",
"version": "1.3.2",
"keywords": "storage,data,flash,flashstorage,flash-storage,eeprom,emulated-eeprom",
"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.",
"authors": [
Expand Down Expand Up @@ -32,5 +32,5 @@
"license": "LGPL-3.0",
"frameworks": "arduino",
"platforms": "atmelsam",
"headers": ["FlashStorage_SAMD.h", "FlashStorage_SAMD.hpp"]
"headers": ["FlashStorage_SAMD.h", "FlashStorage_SAMD.hpp", "FlashAsEEPROM_SAMD.h", "FlashAsEEPROM_SAMD.hpp"]
}
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=FlashStorage_SAMD
version=1.3.1
version=1.3.2
author=Cristian Maglie <c.maglie@bug.st>, Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
license=GPLv3
Expand All @@ -8,4 +8,4 @@ paragraph=Useful if the EEPROM is not available or too small. Currently, ATSAMD2
url=https://github.com/khoih-prog/FlashStorage_SAMD
architectures=samd
category=Data Storage
includes=FlashStorage_SAMD.h,FlashStorage_SAMD.hpp
includes=FlashStorage_SAMD.h,FlashStorage_SAMD.hpp,FlashAsEEPROM_SAMD.h,FlashAsEEPROM_SAMD.hpp
49 changes: 49 additions & 0 deletions src/FlashAsEEPROM_SAMD.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/******************************************************************************************************************************************
FlashAsEEPROM_SAMD.h
For SAMD21/SAMD51 using Flash emulated-EEPROM
The FlashStorage_SAMD library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory
of SAMD21/SAMD51. It now supports writing and reading the whole object, not just byte-and-byte.
Based on and modified from Cristian Maglie's FlashStorage (https://github.com/cmaglie/FlashStorage)
Built by Khoi Hoang https://github.com/khoih-prog/FlashStorage_SAMD
Licensed under LGPLv3 license
Orginally written by Cristian Maglie
Copyright (c) 2015 Arduino LLC. All right reserved.
Copyright (c) 2020 Khoi Hoang.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 28/03/2020 Initial coding to add support to SAMD51 besides SAMD21
1.1.0 K Hoang 26/01/2021 Add supports to put() and get() for writing and reading the whole object. Fix bug.
1.2.0 K Hoang 18/08/2021 Optimize code. Add debug option
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
// The .h contains implementations, and can be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error

#pragma once

#ifndef FlashAsEEPROM_SAMD_h
#define FlashAsEEPROM_SAMD_h

#include <FlashStorage_SAMD.hpp>
#include <FlashStorage_SAMD_Impl.h>

#endif //#ifndef FlashAsEEPROM_SAMD_h
48 changes: 48 additions & 0 deletions src/FlashAsEEPROM_SAMD.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/******************************************************************************************************************************************
FlashAsEEPROM_SAMD.hpp
For SAMD21/SAMD51 using Flash emulated-EEPROM
The FlashStorage_SAMD library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory
of SAMD21/SAMD51. It now supports writing and reading the whole object, not just byte-and-byte.
Based on and modified from Cristian Maglie's FlashStorage (https://github.com/cmaglie/FlashStorage)
Built by Khoi Hoang https://github.com/khoih-prog/FlashStorage_SAMD
Licensed under LGPLv3 license
Orginally written by Cristian Maglie
Copyright (c) 2015 Arduino LLC. All right reserved.
Copyright (c) 2020 Khoi Hoang.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 28/03/2020 Initial coding to add support to SAMD51 besides SAMD21
1.1.0 K Hoang 26/01/2021 Add supports to put() and get() for writing and reading the whole object. Fix bug.
1.2.0 K Hoang 18/08/2021 Optimize code. Add debug option
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
// The .h contains implementations, and can be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error

#pragma once

#ifndef FlashAsEEPROM_SAMD_hpp
#define FlashAsEEPROM_SAMD_hpp

#include <FlashStorage_SAMD.hpp>

#endif //#ifndef FlashAsEEPROM_SAMD_hpp
3 changes: 2 additions & 1 deletion src/FlashStorage_SAMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.1
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -32,6 +32,7 @@
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
Expand Down
9 changes: 5 additions & 4 deletions src/FlashStorage_SAMD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.1
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -32,6 +32,7 @@
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

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

#ifndef FLASH_STORAGE_SAMD_VERSION
#define FLASH_STORAGE_SAMD_VERSION "FlashStorage_SAMD v1.3.1"
#define FLASH_STORAGE_SAMD_VERSION "FlashStorage_SAMD v1.3.2"

#define FLASH_STORAGE_SAMD_VERSION_MAJOR 1
#define FLASH_STORAGE_SAMD_VERSION_MINOR 3
#define FLASH_STORAGE_SAMD_VERSION_PATCH 1
#define FLASH_STORAGE_SAMD_VERSION_PATCH 2

#define FLASH_STORAGE_SAMD_VERSION_INT 1003001
#define FLASH_STORAGE_SAMD_VERSION_INT 1003002

#endif

Expand Down
3 changes: 2 additions & 1 deletion src/FlashStorage_SAMD21.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.1
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -32,6 +32,7 @@
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
Expand Down
3 changes: 2 additions & 1 deletion src/FlashStorage_SAMD51.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.1
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -32,6 +32,7 @@
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

// The .hpp contains only definitions, and can be included as many times as necessary, without `Multiple Definitions` Linker Error
Expand Down
3 changes: 2 additions & 1 deletion src/FlashStorage_SAMD_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License along with this library.
If not, see (https://www.gnu.org/licenses/)
Version: 1.3.1
Version: 1.3.2
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -32,6 +32,7 @@
1.2.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.3.0 K Hoang 25/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards.
1.3.1 K Hoang 25/01/2022 Reduce number of library files
1.3.2 K Hoang 26/01/2022 Make compatible with old libraries and codes
******************************************************************************************************************************************/

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

0 comments on commit 3712949

Please sign in to comment.