File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,15 @@ bd_size_t FlashIAPBlockDevice::get_erase_size() const
151151 return erase_size;
152152}
153153
154+ bd_size_t FlashIAPBlockDevice::get_erase_size (bd_addr_t addr) const
155+ {
156+ uint32_t erase_size = _flash.get_sector_size (_base + addr);
157+
158+ DEBUG_PRINTF (" get_erase_size: %" PRIX32 " \r\n " , erase_size);
159+
160+ return erase_size;
161+ }
162+
154163bd_size_t FlashIAPBlockDevice::size () const
155164{
156165 DEBUG_PRINTF (" size: %" PRIX64 " \r\n " , _size);
Original file line number Diff line number Diff line change @@ -110,6 +110,14 @@ class FlashIAPBlockDevice : public BlockDevice {
110110 */
111111 virtual bd_size_t get_erase_size () const ;
112112
113+ /* * Get the size of an erasable block given address
114+ *
115+ * @param addr Address within the erasable block
116+ * @return Size of an erasable block in bytes
117+ * @note Must be a multiple of the program size
118+ */
119+ virtual bd_size_t get_erase_size (bd_addr_t addr) const ;
120+
113121 /* * Get the total size of the underlying device
114122 *
115123 * @return Size of the underlying device in bytes
You can’t perform that action at this time.
0 commit comments