Skip to content

Commit 85cbc29

Browse files
authored
Merge pull request #10158 from ARMmbed/release-candidate
5.12.0-rc3
2 parents c093978 + 32762d6 commit 85cbc29

File tree

61 files changed

+124191
-115420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+124191
-115420
lines changed

components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,14 @@ const char *FlashIAPBlockDevice::get_type() const
256256
return "FLASHIAP";
257257
}
258258

259+
bool FlashIAPBlockDevice::is_valid_erase(bd_addr_t addr, bd_size_t size) const
260+
{
261+
/* Calculate address alignment for the full flash */
262+
bd_addr_t base_addr = addr + (_base - _flash.get_flash_start());
263+
264+
return (
265+
addr + size <= this->size() &&
266+
base_addr % get_erase_size(addr) == 0 &&
267+
(base_addr + size) % get_erase_size(addr + size - 1) == 0);
268+
}
259269
#endif /* DEVICE_FLASH */

components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ class FlashIAPBlockDevice : public mbed::BlockDevice {
127127
*/
128128
virtual const char *get_type() const;
129129

130+
/** Convenience function for checking block erase validity
131+
*
132+
* @param addr Address of block to begin erasing
133+
* @param size Size to erase in bytes
134+
* @return True if erase is valid for underlying block device
135+
*/
136+
virtual bool is_valid_erase(bd_addr_t addr, bd_size_t size) const;
137+
138+
130139
private:
131140
// Device configuration
132141
mbed::FlashIAP _flash;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Permissive Binary License
2+
3+
Version 1.0, September 2015
4+
5+
Redistribution. Redistribution and use in binary form, without
6+
modification, are permitted provided that the following conditions are
7+
met:
8+
9+
1) Redistributions must reproduce the above copyright notice and the
10+
following disclaimer in the documentation and/or other materials
11+
provided with the distribution.
12+
13+
2) Unless to the extent explicitly permitted by law, no reverse
14+
engineering, decompilation, or disassembly of this software is
15+
permitted.
16+
17+
3) Redistribution as part of a software development kit must include the
18+
accompanying file named "DEPENDENCIES" and any dependencies listed in
19+
that file.
20+
21+
4) Neither the name of the copyright holder nor the names of its
22+
contributors may be used to endorse or promote products derived from
23+
this software without specific prior written permission.
24+
25+
Limited patent license. The copyright holders (and contributors) grant a
26+
worldwide, non-exclusive, no-charge, royalty-free patent license to
27+
make, have made, use, offer to sell, sell, import, and otherwise
28+
transfer this software, where such license applies only to those patent
29+
claims licensable by the copyright holders (and contributors) that are
30+
necessarily infringed by this software. This patent license shall not
31+
apply to any combinations that include this software. No hardware is
32+
licensed hereunder.
33+
34+
If you institute patent litigation against any entity (including a
35+
cross-claim or counterclaim in a lawsuit) alleging that the software
36+
itself infringes your patent(s), then your rights granted under this
37+
license shall terminate as of the date such litigation is filed.
38+
39+
DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
40+
CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
41+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
42+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43+
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
45+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
46+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
47+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
48+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
49+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)