Commit Graph

5 Commits (258125449270af8124fb9b05a303eb2e6d63e907)

Author SHA1 Message Date
Lingkai Dong 2581254492 SFDP: Fix sector map table allocation check
When passing an allocation size directly to `std::make_unique`,
`std::nothrow` is unavailable, so any failed allocation results in
an exception which we cannot catch because Mbed OS is compiled with
`-fno-exceptions`. To fix this, chain `std::make_unique` with
`new (std::nothrow)`, and the allocated `unique_ptr` retains the
`nullptr` property.
2021-09-10 09:45:11 +01:00
Lingkai Dong 651099225e SFDP: Set region count to 1 for no sector map
A flash device with no sector map table has uniform sectors, and we
treat the whole flash as one region. In this case the function
`sfdp_parse_sector_map_table()` sets the single region's size and high
boundary accordingly, but it lacks setting of region count to 1, so
users of the SFDP parser may not get the correct number of regions.
This commit fixes the issue.
2021-08-06 14:30:16 +01:00
Lingkai Dong 68694255b5 SFDP: Move handling of no sector map into `if`
When a flash chip's SFDP table has no sector map, we treat the whole
flash as a single region. As an optimization, this should only be
done if there is indeed no sector map.
2021-08-04 14:03:24 +01:00
Lingkai Dong 23702ff2b3 Update include paths to SFDP.h 2020-11-26 17:31:31 +00:00
Lingkai Dong 5d2fbdc11e Move SFDP into blockdevice where it belongs to 2020-11-26 17:31:31 +00:00